# the-pocket/pocketflow

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/the-pocket-pocketflow).**

10,046 stars · 1,102 forks · Python · mit

## Links

- GitHub: https://github.com/The-Pocket/PocketFlow
- Homepage: https://the-pocket.github.io/PocketFlow/
- awesome-repositories: https://awesome-repositories.com/repository/the-pocket-pocketflow.md

## Topics

`agentic-ai` `agentic-framework` `agentic-workflow` `agents` `ai-framework` `ai-frameworks` `aiagent` `aiagents` `artificial-intelligence` `flow-based-programming` `flow-engineering` `large-language-model` `large-language-models` `llm-agent` `llm-framework` `pocket-flow` `pocketflow` `retrieval-augmented-generation` `workflow` `workflow-orchestration`

## Description

PocketFlow is a graph-based framework for designing and executing large language model operations and reasoning patterns. It serves as an orchestrator for building goal-oriented autonomous agents, multi-agent systems, and retrieval-augmented generation pipelines.

The system is distinguished by its ability to coordinate autonomous AI agents that use shared memory and tools to solve complex goals, supported by a structured output engine that enforces schema-consistent responses. It utilizes graph-based workflow orchestration to manage sequences of model operations and supports supervisor-based coordination for task delegation and self-correction.

The platform covers a broad range of capabilities, including asynchronous task runtimes, hierarchical workflow nesting, and map-reduce parallel execution for large-scale data processing. It integrates vector database management for semantic retrieval and includes observability tools such as execution stack tracing and workflow hierarchy visualization. Reliability is managed through automatic retry logic and response guardrails.

## Tags

### Artificial Intelligence & ML

- [Multi-Agent Coordination Systems](https://awesome-repositories.com/f/artificial-intelligence-ml/agent-architectures/orchestration-engines/ai-agent/multi-agent-coordination-systems.md) — Provides a framework for specialized agents to collaborate on complex goals through task delegation and shared state. ([source](https://the-pocket.github.io/PocketFlow/))
- [Agentic Workflow Graphs](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-workflow-graphs.md) — Orchestrates autonomous agents and task sequences using directed graphs of nodes and edges.
- [Autonomous Agent Orchestrators](https://awesome-repositories.com/f/artificial-intelligence-ml/autonomous-agent-orchestrators.md) — Acts as a runtime environment that decomposes complex goals into multi-step plans using tools and memory.
- [Agent Memory Stores](https://awesome-repositories.com/f/artificial-intelligence-ml/agent-memory-stores.md) — Implements persistent storage mechanisms to maintain agent state and conversation history across long-running sessions. ([source](https://github.com/The-Pocket/PocketFlow/blob/main/cookbook/pocketflow-batch/translations/README_JAPANESE.md))
- [Autonomous Agents](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-systems-frameworks/agent-orchestration-multi-agent/autonomous-agents.md) — Integrates language models with tools and memory systems to build agents capable of executing autonomous tasks. ([source](https://the-pocket.github.io/PocketFlow/design_pattern/))
- [AI Workflow Orchestrators](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-workflow-orchestrators.md) — Provides a framework for designing repeatable pipelines of prompts and logic steps to achieve complex goals. ([source](https://the-pocket.github.io/PocketFlow/design_pattern/))
- [Language Model Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/artificial-intelligence-tooling/language-model-integrations.md) — Provides adapters and interfaces to connect workflows to various hosted cloud APIs or local language models. ([source](https://the-pocket.github.io/PocketFlow/utility_function/llm.html))
- [Automation Workflows](https://awesome-repositories.com/f/artificial-intelligence-ml/automation-workflows.md) — Builds repeatable pipelines that sequence prompts and logic steps to automate multi-step AI tasks.
- [Tool Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/external-service-integrations/external-knowledge-integrators/tool-integrations.md) — Implements utility functions that allow agents to call external APIs and interact with the real world. ([source](https://the-pocket.github.io/PocketFlow/guide.html))
- [Human-in-the-Loop Workflows](https://awesome-repositories.com/f/artificial-intelligence-ml/human-in-the-loop-workflows.md) — Integrates manual review and approval steps into automated AI workflows to ensure output correctness. ([source](https://github.com/The-Pocket/PocketFlow/blob/main/cookbook/pocketflow-batch/translations/README_JAPANESE.md))
- [Multi-Agent Orchestration Systems](https://awesome-repositories.com/f/artificial-intelligence-ml/multi-agent-orchestration-systems.md) — Provides a platform for coordinating multiple autonomous agents to execute complex, collaborative workflows.
- [Retrieval-Augmented Generation](https://awesome-repositories.com/f/artificial-intelligence-ml/retrieval-augmented-generation.md) — Implements retrieval-augmented generation to ground language model outputs in external data sources.
- [Retrieval Augmented Generation Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/retrieval-augmented-generation-pipelines.md) — Integrates vector database queries into the prompt chain to ground model responses in external data.
- [Structured Data Extraction](https://awesome-repositories.com/f/artificial-intelligence-ml/structured-data-extraction.md) — Implements a structured output engine that enforces schema-consistent responses and data extraction from language models. ([source](https://github.com/The-Pocket/PocketFlow/blob/main/README.md))
- [Structured Output Enforcements](https://awesome-repositories.com/f/artificial-intelligence-ml/structured-output-enforcements.md) — Enforces strict data schemas on model outputs to ensure programmatic reliability and consistent formatting. ([source](https://the-pocket.github.io/PocketFlow/design_pattern/))
- [Supervisor Agent Configurations](https://awesome-repositories.com/f/artificial-intelligence-ml/supervisor-agent-configurations.md) — Coordinates multiple autonomous agents through a central supervisor that manages delegation and self-correction.
- [Task Decomposition Systems](https://awesome-repositories.com/f/artificial-intelligence-ml/task-decomposition-systems.md) — Breaks complex objectives into a chain of smaller, sequential steps for improved reliability. ([source](https://the-pocket.github.io/PocketFlow/design_pattern/workflow.html))
- [Vector Databases](https://awesome-repositories.com/f/artificial-intelligence-ml/vector-databases.md) — Stores and queries high-dimensional embeddings to retrieve relevant context for autonomous agents. ([source](https://the-pocket.github.io/PocketFlow/utility_function/))
- [AI Model APIs](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-model-apis.md) — Standardizes the interaction interface across different LLM providers to ensure workflow portability. ([source](https://the-pocket.github.io/PocketFlow/utility_function/))
- [Chain-of-Thought Modules](https://awesome-repositories.com/f/artificial-intelligence-ml/chain-of-thought-modules.md) — Implements step-by-step reasoning patterns, such as chain-of-thought, to improve the accuracy of complex conclusions. ([source](https://github.com/The-Pocket/PocketFlow/blob/main/cookbook/pocketflow-batch/translations/README_GERMAN.md))
- [Embedding Generators](https://awesome-repositories.com/f/artificial-intelligence-ml/embedding-generators.md) — Integrates text embedding generation to enable semantic search and high-dimensional vector storage for agent context. ([source](https://the-pocket.github.io/PocketFlow/utility_function/))
- [Document Chunking Strategies](https://awesome-repositories.com/f/artificial-intelligence-ml/language-model-orchestration/retrieval-augmented-generation/document-chunking-strategies.md) — Provides document chunking capabilities to optimize retrieval and processing within RAG pipelines. ([source](https://the-pocket.github.io/PocketFlow/utility_function/))
- [RAG Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/language-model-orchestration/retrieval-augmented-generation/rag-pipelines.md) — Implements workflows that augment model outputs by retrieving and integrating relevant external data from document sources.
- [Output Guardrails](https://awesome-repositories.com/f/artificial-intelligence-ml/output-guardrails.md) — Uses guardrails and validation functions to ensure model outputs meet specific quality and format standards. ([source](https://cdn.jsdelivr.net/gh/the-pocket/pocketflow@main/README.md))
- [RAG Frameworks](https://awesome-repositories.com/f/artificial-intelligence-ml/rag-frameworks.md) — Provides a development environment specifically designed for building retrieval-augmented generation applications. ([source](https://cdn.jsdelivr.net/gh/the-pocket/pocketflow@main/README.md))
- [Web Search Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/web-search-integrations.md) — Enables agents to retrieve real-time internet data to provide up-to-date context for accurate responses. ([source](https://the-pocket.github.io/PocketFlow/utility_function/))

### Software Engineering & Architecture

- [Graph-Based Workflow Orchestrators](https://awesome-repositories.com/f/software-engineering-architecture/graph-based-workflow-orchestrators.md) — Uses graph-based abstractions to coordinate sequences of model operations and support parallel reasoning patterns. ([source](https://cdn.jsdelivr.net/gh/the-pocket/pocketflow@main/README.md))
- [LLM Reasoning Workflows](https://awesome-repositories.com/f/software-engineering-architecture/graph-based-workflow-orchestrators/llm-reasoning-workflows.md) — Provides a graph-based framework for designing and executing sequences of LLM operations and reasoning patterns.
- [Hierarchical Nesting](https://awesome-repositories.com/f/software-engineering-architecture/workflow-nodes/hierarchical-nesting.md) — Implements hierarchical nesting by encapsulating complete sub-graphs as individual nodes within larger workflows. ([source](https://the-pocket.github.io/PocketFlow/core_abstraction/flow.html))
- [Asynchronous Execution](https://awesome-repositories.com/f/software-engineering-architecture/architectural-design-patterns/asynchronous-execution.md) — Supports non-blocking operations such as API calls and database reads within the workflow execution sequence. ([source](https://the-pocket.github.io/PocketFlow/core_abstraction/async.html))
- [Asynchronous Task Processors](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-task-processors.md) — Executes non-blocking model calls and external API operations to maintain system responsiveness.
- [Workflow Iteration Engines](https://awesome-repositories.com/f/software-engineering-architecture/workflow-iteration-engines.md) — Provides control flow logic to execute a sequence of operations repeatedly with different parameter sets. ([source](https://the-pocket.github.io/PocketFlow/core_abstraction/batch.html))

### Data & Databases

- [Batch Processing](https://awesome-repositories.com/f/data-databases/batch-processing.md) — Executes workflows across multiple input sets simultaneously to process large volumes of data efficiently. ([source](https://the-pocket.github.io/PocketFlow/core_abstraction/))
- [Parallel Task Batching](https://awesome-repositories.com/f/data-databases/data-processing-pipelines/batch-processing-systems/batch-processing-utilities/parallel-task-batching.md) — Executes large-scale reasoning tasks by splitting data into chunks and processing them in parallel.
- [Shared State Buses](https://awesome-repositories.com/f/data-databases/inter-flow-data-sharing/shared-state-buses.md) — Uses a centralized data store to maintain context and pass information between decoupled nodes in a flow.
- [Parallel Map-Reduce Tools](https://awesome-repositories.com/f/data-databases/parallel-data-transformation/parallel-data-reducers/parallel-map-reduce-tools.md) — Splits large datasets into chunks for parallel processing and aggregates the results into a final output. ([source](https://the-pocket.github.io/PocketFlow/design_pattern/))
- [Cross-Node State Sharing](https://awesome-repositories.com/f/data-databases/shared-memory-data-exchange/reactive-data-sharing/cross-node-state-sharing.md) — Maintains a global data structure that allows all nodes to read and write to decouple schema from logic. ([source](https://the-pocket.github.io/PocketFlow/core_abstraction/communication.html))
- [State Management Stores](https://awesome-repositories.com/f/data-databases/state-management-stores.md) — Implements a centralized data store to establish a data contract between different nodes in a flow. ([source](https://the-pocket.github.io/PocketFlow/guide.html))

### Development Tools & Productivity

- [Parallel Execution](https://awesome-repositories.com/f/development-tools-productivity/parallel-execution.md) — Runs multiple operations concurrently to reduce total processing time and accelerate output generation. ([source](https://cdn.jsdelivr.net/gh/the-pocket/pocketflow@main/README.md))
- [Task Parameterization](https://awesome-repositories.com/f/development-tools-productivity/task-parameterization.md) — Provides programmable tools that support dynamic input and argument handling for precise task execution. ([source](https://the-pocket.github.io/PocketFlow/design_pattern/agent.html))

### Part of an Awesome List

- [Agent Frameworks](https://awesome-repositories.com/f/awesome-lists/ai/agent-frameworks.md) — Minimalist framework for RAG, task decomposition, and agent development.
