PocketFlow is a free, open source ai development platforms project written in Python and released under MIT. It has 11,176 GitHub stars, 1,213 forks and 75 open issues, and was last pushed 2 months ago. On this registry it ranks #49 of 61 tracked projects in AI Development Platforms, with 5 head-to-head comparisons available. It gained 5 stars over the last 3 tracked days.

What is PocketFlow?

PocketFlow is a 100-line, zero-dependency Python framework for building LLM agents, multi-agent systems, workflows, and RAG pipelines, aimed at developers who want graph-based orchestration without the weight of larger frameworks.

What it is

PocketFlow lives in the Python LLM development ecosystem and reduces the whole framework down to a single file, pocketflow/__init__.py, which is 100 lines long. Its core abstraction is the Graph: nodes and edges, from which the documentation shows how to build popular design patterns such as Agents, Multi-Agents, Workflow, and RAG. The project ships under the MIT licence, carries 11,177 stars and 1,213 forks, and is published as a Python package named pocketflow.

The concrete problem it solves is the bloat and lock-in of incumbent LLM frameworks. The project's own comparison table measures LangChain at 405K lines and +166MB, CrewAI at 18K lines and +173MB, SmolAgent at 8K lines and +198MB, LangGraph at 37K lines and +51MB, and AutoGen at 7K lines core-only and +26MB, against PocketFlow's 100 lines and +56KB. PocketFlow replaces those installations with zero dependencies, zero app-specific wrappers, and zero vendor-specific wrappers, so the application talks to whatever model or vector store it chooses without a framework-owned adapter layer.

Key capabilities

  • Core Graph abstraction of nodes and edges, from which the documented patterns for Agents, Multi-Agents, Workflow, and RAG are built.
  • The entire framework is 100 lines in pocketflow/__init__.py, small enough to read and copy rather than install.
  • Zero dependencies and zero vendor lock-in, with no bundled OpenAI, Pinecone, or similar wrappers in the comparison table.
  • Installable as the pocketflow PyPI package, or vendored by copying the source file directly.
  • Agentic coding workflow, in which AI coding agents such as Cursor AI generate agent code against the framework, described in the README as a 10x productivity boost.
  • Ports to TypeScript, Java, C++, Go, Rust, and PHP, so the same graph model carries across language ecosystems.
  • Documentation in Chinese, Spanish, Japanese, German, Russian, Portuguese, French, and Korean translations of the cookbook README, alongside the English original.

Who uses it and how

  • Developers practising agentic coding, where an AI coding agent such as Cursor AI writes the agent implementation against PocketFlow's small surface.
  • Teams that need LLM features but refuse framework-owned vendor abstractions, and therefore wire their own model and storage clients into graph nodes.
  • Polyglot engineering groups that start in Python and reuse the same design patterns through the TypeScript, Java, C++, Go, Rust, or PHP ports.
  • International developers, served by the nine cookbook translations, who need the pattern documentation in their own language.
  • Community members who join the project's Discord to compare implementations with other developers building on PocketFlow.

Getting started

Install with pip install pocketflow, or copy the 100-line source from pocketflow/__init__.py into the project. The project homepage at https://the-pocket.github.io/PocketFlow/ and a video tutorial carry the design-pattern documentation.

How it compares

The README positions PocketFlow directly against LangChain, CrewAI, SmolAgent, LangGraph, and AutoGen, and the axes it uses are line count, installed size, and the number of abstraction layers, app-specific wrappers, and vendor-specific wrappers each one carries. PocketFlow claims the smallest footprint of the group at 100 lines and +56KB, with no app-specific or vendor-specific wrappers at all. It concedes scope rather than capability: the larger frameworks bundle tools and integrations that PocketFlow expects the developer to supply.

When to use it — and when not to

Choose PocketFlow when the goal is a small, readable, dependency-free graph layer and the team is willing to write its own model, storage, and tool integrations on top. Avoid it when the project needs prebuilt wrappers, batteries-included tools, or an opinionated application layer, because PocketFlow deliberately ships none. The trade-offs worth knowing are that the repository carries 75 open issues, that the README points outward to the documentation site, cookbook, and video tutorial for substance, and that a framework this thin leaves most integration and error-handling decisions to the application.

project readme (upstream, from github) — read inline
Pocket Flow – 100-line minimalist LLM framework

English | 中文 | Español | 日本語 | Deutsch | Русский | Português | Français | 한국어

License: MIT Docs

Pocket Flow is a 100-line minimalist LLM framework

  • Lightweight: Just 100 lines. Zero bloat, zero dependencies, zero vendor lock-in.

  • Expressive: Everything you love—(Multi-)Agents, Workflow, RAG, and more.

  • Agentic Coding: Let AI Agents (e.g., Cursor AI) build Agents—10x productivity boost!

Get started with Pocket Flow:

Why Pocket Flow?

Current LLM frameworks are bloated... You only need 100 lines for LLM Framework!

Abstraction App-Specific Wrappers Vendor-Specific Wrappers Lines Size
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
SmolAgent Agent Some
(e.g., CodeAgent, VisitWebTool)
Some
(e.g., DuckDuckGo, Hugging Face, etc.)
8K +198MB
LangGraph Agent, Graph Some
(e.g., Semantic Search)
Some
(e.g., PostgresStore, SqliteSaver, etc.)
37K +51MB
AutoGen Agent Some
(e.g., Tool Agent, Chat Agent)
Many [Optional]
(e.g., OpenAI, Pinecone, etc.)
7K
(core-only)
+26MB
(core-only)
PocketFlow Graph None None 100 +56KB

How does Pocket Flow work?

The 100 lines capture the core abstraction of LLM frameworks: Graph!


From there, it's easy to implement popular design patterns like (Multi-)Agents, Workflow, RAG, etc.


✨ Below are basic tutorials:
Name Difficulty Description
Chat ☆☆☆ Dummy A basic chat bot with conversation history
Structured Output ☆☆☆ Dummy Extracting structured data from resumes by prompting
Workflow ☆☆☆ Dummy A writing workflow that outlines, writes content, and applies styling
Agent ☆☆☆ Dummy A research agent that can search the web and answer questions
RAG ☆☆☆ Dummy A simple Retrieval-augmented Generation process
Batch ☆☆☆ Dummy A batch processor that translates markdown into multiple languages
Streaming ☆☆☆ Dummy A real-time LLM streaming demo with user interrupt capability
Chat Guardrail ☆☆☆ Dummy A travel advisor chatbot that only processes travel-related queries
Majority Vote ☆☆☆ Dummy Improve reasoning accuracy by aggregating multiple solution attempts
Map-Reduce ☆☆☆ Dummy Batch resume qualification using map-reduce pattern
CLI HITL ☆☆☆ Dummy A command-line joke generator with human-in-the-loop feedback
Multi-Agent ★☆☆ Beginner A Taboo word game for async communication between 2 agents
Supervisor ★☆☆ Beginner Research agent is getting unreliable... Let's build a supervision process
Parallel ★☆☆ Beginner A parallel execution demo that shows 3x speedup
[Parallel Flow](https://github.com/The-Pocket/PocketFlow/tree

readme truncated — read the full docs on github

Frequently asked questions

Is PocketFlow free to use?

PocketFlow is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does PocketFlow do?

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

What is PocketFlow written in?

PocketFlow is primarily written in Python. Its source is publicly available at https://github.com/The-Pocket/PocketFlow, and it has 11,176 GitHub stars.