Pocket Flow

A minimal graph-based framework for composing LLM workflows, agents, and RAG applications.

Stars
★ 11k
Last updated
3mo ago
License
MIT
Primary language
Python

At a glance

How it runs
Library / SDKFramework
Works with
Universal · cross-platform
Cost
Free software; you pay for model usage
Setup effort
Low · running in minutes
Typical use
A Python developer who wants a small graph framework for a chat bot with conversation history can start from the Chat tutorial.
Not a fit if
  • Teams wanting a turnkey hosted service or built-in model integrations
  • Teams expecting vendor wrappers for models, vector stores, or tools
  • Teams needing documented production ops, persistence, and security boundaries

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.

  1. A Python developer who wants a small graph framework for a chat bot with conversation history can start from the Chat tutorial.
  2. A developer extracting fields from resumes through prompting can use the Structured Output example as a concrete flow.
  3. A content team that needs to sequence outlining, drafting, and styling can adapt the Workflow writing example.
  4. A team building a research assistant that searches the web before answering can examine the Agent tutorial.
  5. A developer building document-grounded answers, or a flow that decides which documents to read, can use the RAG and Agentic RAG examples.
  6. 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.

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.

What are this agent's strengths and limitations?

Pros
  • 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__.py source 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.
Limitations
  • 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 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.

Key facts side by side with the most closely related agents.

Agent Source review Form / cost Stars Updated Language Full support on
Pocket Flow This agent 41 · Major gaps Library / SDKFree + model costs ★ 11k 3mo ago Python —
Dynamiq Agent Orchestration 61 · Some gaps Library / SDKFree + model costs ★ 1.1k 1d ago Python OpenAI API
Mastra 52 · Major gaps CLIFree + model costs ★ 29k today TypeScript OpenAI API · Claude API
BeeAI Framework 51 · Major gaps Library / SDKFree + model costs ★ 3.5k 3d ago Python —

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Major gaps
41/ 100 5-point scale 2.1 / 5
Trust 0/29
Reliability 8/14
Adaptability 10/18
Convention 10/18
Effectiveness 9/13
Verifiability 4/8
Why each dimension lost points
Trust0 / 29 · 0.0/5

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.

Reliability8 / 14 · 2.9/5

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.

Adaptability10 / 18 · 2.8/5

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.

Convention10 / 18 · 2.8/5

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.

Effectiveness9 / 13 · 3.5/5

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.

Verifiability4 / 8 · 2.5/5

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.

Risks and how to mitigate them
  • Not found in source: least-privilege scopingGrant only what the task needs: a dedicated account or read-only token, scoped to specific directories and repos.
  • Not found in source: confirmation before actingTurn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
  • Not found in source: data-flow disclosureWatch which external services it contacts (proxy or firewall logs) and keep sensitive data out until you know where it goes.
  • Not found in source: sensitive-data handlingUse dedicated, low-privilege, revocable API keys — never production credentials — and keep secrets out of logs.
  • Not found in source: dependency securityPin versions and run a dependency audit (npm audit, pip-audit) before installing; prefer running it in a container.
  • Not found in source: disclosed external effectsEstablish which external systems it writes to, sends to or changes, and verify with test accounts or repos before production.
  • Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
  • Not found in source: verifiable attributionInstall from the official repo or registry and check the publisher and URL to avoid look-alike packages.
  • 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.
Evidence confidence: Low Reviewed Aug 09, 2026 Reviewed revision f74d023f9360
See the full review method →

Recent releases

Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.

  1. v0.0.0 Pre-release

FAQ

Does Pocket Flow have a framework license cost?
The repository is marked MIT licensed. The supplied material does not state pricing for model, search, voice, or other external services, so their costs cannot be determined here.
Does it include OpenAI, Anthropic, or other provider adapters?
The README claims zero vendor lock-in, and its comparison table lists no vendor-specific wrappers for Pocket Flow. The supplied material does not list any built-in provider adapter.
Does it support MCP?
The repository includes the pocketflow-mcp cookbook, described as an agent that uses Model Context Protocol for numerical operations. Configuration details are not supplied.
Can it be deployed directly as a production service?
The supplied material documents no deployment command or hosted runtime. It includes FastAPI WebSocket and FastAPI Background examples, but does not describe production deployment configuration.
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related agents