AI Worker worker.md

PocketFlow

Pocket Flow: 100-line LLM framework. Let Agents build Agents!

Automation platform 10,117 stars Python MIT Worker-compatible

Source#

Tags#

agentic-aiagentic-frameworkagentic-workflowagentsai-frameworkai-frameworks

Integration notes#

Repository is workflow-oriented; map each workflow step to explicit worker contracts for predictability.

worker.md example#

Starter worker.md contract mapped from this registry entry. Copy this file and adapt schemas, constraints, and statuses for your task.

---
id: pocketflow-repo-derived-worker
name: PocketFlow Repo-Derived Worker
version: 1.0.0
source_registry_url: https://worker.md/registry/pocketflow/
source_repository: https://github.com/The-Pocket/PocketFlow
repository_default_branch: main
repository_language: Python
repository_license: MIT
repository_updated_at: 2026-03-01
worker_mode: agent-orchestration-worker
derivation_method: github_repository_metadata_plus_raw_readme
derivation_confidence: 0.95
derived_on: 2026-03-01
tags:
  - agentic-ai
  - agentic-framework
  - agentic-workflow
  - agents
  - ai-framework
  - ai-frameworks
---

# PocketFlow Repo-Derived Worker

## Repo-derived summary
- Registry summary: Pocket Flow: 100-line LLM framework. Let Agents build Agents!
- Repository description: Pocket Flow: 100-line LLM framework. Let Agents build Agents!
- Stars (snapshot): 10,117
- Primary language: Python
- Worker mode classification: agent-orchestration-worker

## Extracted from
- https://github.com/The-Pocket/PocketFlow
- https://github.com/The-Pocket/PocketFlow/blob/main/README.md
- https://github.com/The-Pocket/PocketFlow/blob/main/cookbook/pocketflow-batch/translations/README_CHINESE.md
- https://github.com/The-Pocket/PocketFlow/blob/main/cookbook/pocketflow-batch/translations/README_SPANISH.md

## Evidence notes (from repository text)
- README summary paragraph: English | https://github.com/The-Pocket/PocketFlow/blob/main/cookbook/pocketflow-batch/translations/README_CHINESE.md | https://github.com/The-Pocket/PocketFlow/blob/main/cookbook/pocketflow-batch/translations/README_SPANISH.md | https://github.com/The-Pocket/PocketFlow/blob/main/cookbook/pocketflow-batch/translations/README_JAPANESE.md | https://github.com/The-Pocket/PocketFlow/blob/main/cookbook/pocketflow-batch/translations/README_GERMAN.md | https://github.com/The-Pocket/PocketFlow/blob/main/cookbook/pocketflow-batch/translations/README_RUSSIAN.md | https://github.com/The-Pocket/PocketFlow/blob/main/cookbook/pocketflow-batch/translations/README_PORTUGUESE.md | https://github.com/The-Pocket/PocketFlow/blob/main/cookbook/pocketflow-batch/translations/README_FRENCH.md | https://github.com/The-Pocket/PocketFlow/blob/main/cookbook/pocketflow-batch/translations/README_KOREAN.md
- Pocket Flow is a https://github.com/The-Pocket/PocketFlow/blob/main/pocketflow/__init__.py minimalist LLM framework
- - **https://zacharyhuang.substack.com/p/agentic-coding-the-most-fun-way-to**: Let AI Agents (e.g., Cursor AI) build Agents—10x productivity boost!
- Current LLM frameworks are bloated... You only need 100 lines for LLM Framework!
- | LangChain | Agent, Chain | Many (e.g., QA, Summarization) | Many (e.g., OpenAI, Pinecone, etc.) | 405K | +166MB |
- | CrewAI | Agent, Chain | Many (e.g., FileReadTool, SerperDevTool) | Many (e.g., OpenAI, Anthropic, Pinecone, etc.) | 18K | +173MB |

## Installation hints found in README
- `pip install pocketflow```or just copy the [source code](https://github.com/The-Pocket/PocketFlow/blob/main/pocketflow/__init__.py) (only 100 lines).`

## worker.md contract (derived starter)
Purpose: Execute one orchestrated agent task as a bounded worker step.

### Input schema
```json
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "run_id",
    "task",
    "context"
  ],
  "properties": {
    "run_id": {
      "type": "string"
    },
    "task": {
      "type": "string"
    },
    "context": {
      "type": "object"
    }
  }
}
```

### Output schema
```json
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "run_id",
    "status",
    "result"
  ],
  "properties": {
    "run_id": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "ok",
        "retryable_error",
        "invalid_request",
        "invalid_output"
      ]
    },
    "result": {
      "type": "object"
    }
  }
}
```

### Constraints
- timeout_seconds: 30
- max_attempts: 2
- idempotency_key: run_id
- status_enum: [ok, retryable_error, invalid_request, invalid_output]
- notes: adapt to concrete APIs/classes documented in this repository before production use

## How this should be used
1. Treat this file as a repo-derived starter profile, not a claim of an official repository API contract.
2. Replace schemas with exact interfaces from code/docs you adopt.
3. Keep execution bounded and auditable using worker protocol constraints.

How to use#

  • Save this as a worker spec file (for example: pocketflow-my-task.worker.md).
  • Replace the input/output schemas and purpose with your real bounded task.
  • Enforce schema validation + timeout + retry policy in your runtime before production use.

Citation#

Reference URL: https://worker.md/registry/pocketflow/

Source URL: https://github.com/The-Pocket/PocketFlow