Pocket Flow
A minimal graph-based framework for composing LLM workflows, agents, and RAG applications.
Per-dimension scores and reasoning
Evidence shows a minimalist framework with only 100 lines of core code, lacking built-in permission management, user confirmation, data flow transparency, sensitive data handling, dependency security, external effect control, rollback, or source attribution mechanisms. These aspects are not mentioned in code or documentation, hence score 0. No malicious behavior found, but as a framework, these security features are entirely absent.
Self-consistency: Code and tests show internal logic consistency, with async implementations of nodes and flows matching, score 2. Dependency availability: Framework claims zero dependencies, tests use only standard library, score 2. Failure messages: Tests include error handling, but framework itself does not provide detailed error messages or debugging info, score 1.
Audience and scenarios: README lists numerous tutorials and use cases covering simple to complex scenarios, score 2. Capability boundaries: README clearly states 100-line core without app-specific wrappers, score 2. Trigger precision: Framework uses condition strings for flow control, but documentation does not detail precise trigger control, score 1. Environment fit: Supports Python and multiple language versions, but no specific environment requirements, score 2.
Information architecture: README well-structured with table of contents and tutorial list, score 2. Install notes: Provides pip install and copy source code methods, score 2. Naming stability: Core class names like Node, Flow are stable, score 2. Examples and FAQ: Many examples but no FAQ, score 2. Known limitations: Not explicitly listed, score 1. License: MIT license clear, score 2. Versioning and changelog: No CHANGELOG, score 1. Maintenance responsibility: Has Discord and GitHub, but maintainer not explicit, score 1.
Output usability: Framework outputs state in shared storage, documentation and examples show usage, score 2. Marginal value: Compared to other frameworks, 100-line core provides unique value, score 2. Cost-benefit: Zero dependencies, lightweight, low cost, score 2.
Claim traceability: Claims in README (e.g., 100 lines, zero dependencies) directly verifiable from code, score 2. Cross-source corroboration: Multiple tutorials and external links, but not independently verified, score 1. Fact-inference separation: README distinguishes facts and design philosophy, but some claims lack evidence, score 1.
- The framework itself provides no security mechanisms such as permission control, user confirmation, or data flow transparency; users must implement these themselves.
- No malicious behavior found, but security features are entirely absent as a framework; carefully assess use cases.
- Test coverage is limited, some tests are commented out, and no independent verification is provided.
What does this agent do, and when should you use it?
Pocket Flow is a minimalist LLM framework whose core abstraction is a Graph; the project identifies its core implementation as the 100-line `pocketflow/__init__.py`. It is available as the `pocketflow` Python package and can also be adopted by copying that source file. Its cookbook demonstrates chat, structured extraction, writing workflows, research agents, RAG, batch processing, streaming, multi-agent patterns, supervision, parallel execution, MCP, and human-in-the-loop patterns. It is a library for composing application flows rather than a turnkey hosted agent product: the supplied material documents no deployment service, CLI entry point, or unified model-provider configuration. The project claims zero dependencies and zero vendor lock-in, so adopters need to integrate model, search, voice, or other external services themselves.
The core pocketflow/__init__.py supplies the Graph abstraction used to organize LLM application flows. Cookbook examples demonstrate a chat bot with conversation history, prompt-based extraction of structured resume data, a writing flow that outlines, writes, and styles content, a research agent that searches the web and answers questions, and retrieval-augmented generation. Further examples cover batch Markdown translation, real-time LLM streaming with user interruption, majority voting over multiple solution attempts, map-reduce, CLI human feedback, MCP numerical operations, and A2A agent communication. The supplied material does not define an embedded model caller, provider adapter, or deployment output in the framework itself; those are application flows illustrated by the examples.
- A Python developer who wants a small graph framework for a chat bot with conversation history can start from the Chat tutorial.
- A developer extracting fields from resumes through prompting can use the Structured Output example as a concrete flow.
- A content team that needs to sequence outlining, drafting, and styling can adapt the Workflow writing example.
- A team building a research assistant that searches the web before answering can examine the Agent tutorial.
- A developer building document-grounded answers, or a flow that decides which documents to read, can use the RAG and Agentic RAG examples.
- A developer connecting model work to a real-time interface, background job, or command-line feedback loop can use the FastAPI WebSocket, FastAPI Background, and CLI HITL examples.
What are this agent's strengths and limitations?
- Its core abstraction is explicitly limited to Graph, which suits developers who want direct control over flow structure without many framework layers.
- It supports both package installation and direct adoption of the single
pocketflow/__init__.pysource file. - The cookbook spans concrete patterns from chat and RAG to parallelism, streaming, MCP, A2A, and human-in-the-loop work.
- The README explicitly claims zero vendor lock-in, and its comparison table positions Pocket Flow without vendor-specific wrappers.
- The supplied material does not provide a runnable first API example, import path, or class/function reference, so evaluation requires inspecting code or fuller documentation.
- It does not document model providers, credentials, environment variables, or dependency configuration; production LLM integration must be designed by the adopter.
- The README does not specify deployment topology, production operations, persistence, error recovery, or security boundaries.
- Because it does not include vendor wrappers, existing model, vector-store, and tool integrations from another framework cannot be assumed to migrate directly.
How do you install or deploy this agent?
The documented installation command is: pip install pocketflow. Alternatively, copy the pocketflow/__init__.py source file directly. The supplied material does not specify a Python version, virtual-environment procedure, model-provider credentials, environment variables, or additional dependencies.
How do you use this agent?
Run pip install pocketflow, then select a cookbook that matches the intended pattern, such as pocketflow-chat, pocketflow-rag, or pocketflow-mcp. The supplied material provides no import statement, class or function invocation, runnable first command, model credentials, or runtime configuration, so those details cannot be completed reliably from this evidence.
How does this agent compare with similar options?
Pocket Flow positions itself as retaining only the Graph abstraction. Its README comparison table names LangChain, CrewAI, SmolAgent, LangGraph, and AutoGen, describing them as having varying degrees of application-specific or vendor-specific wrappers, while positioning Pocket Flow as providing neither type of wrapper.
FAQ
Does Pocket Flow have a framework license cost?
Does it include OpenAI, Anthropic, or other provider adapters?
Does it support MCP?
pocketflow-mcp cookbook, described as an agent that uses Model Context Protocol for numerical operations. Configuration details are not supplied.