PocketFlow is a free, open source ai development platforms project written in Python and released under MIT. It has 11,296 GitHub stars, 1,212 forks and 75 open issues, and was last pushed 3 months ago. On this registry it ranks #62 of 155 tracked projects in AI Development Platforms, with 5 head-to-head comparisons available. It gained 83 stars over the last 30 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 ★☆☆ Beginner A parallel image processing showing 8x speedup
Thinking ★☆☆ Beginner Solve complex reasoning problems through Chain-of-Thought
Memory ★☆☆ Beginner A chat bot with short-term and long-term memory
Text2SQL ★☆☆ Beginner Convert natural language to SQL queries with an auto-debug loop
Code Generator ★☆☆ Beginner Generate test cases, implement solutions, and iteratively improve code
MCP ★☆☆ Beginner Agent using Model Context Protocol for numerical operations
Agent Skills ★☆☆ Beginner Route requests to reusable markdown skills and apply them in an agent flow
A2A ★☆☆ Beginner Agent wrapped with A2A protocol for inter-agent communication
Streamlit FSM ★☆☆ Beginner Streamlit app with finite state machine for HITL image generation
FastAPI WebSocket ★☆☆ Beginner Real-time chat interface with streaming LLM responses via WebSocket
FastAPI Background ★☆☆ Beginner FastAPI app with background jobs and real-time progress via SSE
Voice Chat ★☆☆ Beginner An interactive voice chat application with VAD, STT, LLM, and TTS.
Judge ★☆☆ Beginner LLM-as-Judge evaluator-optimizer loop for iterative content refinement
Debate ★☆☆ Beginner Adversarial reasoning with two advocates and an impartial judge
Agentic RAG ★☆☆ Beginner Agent-driven RAG that decides which documents to read
Self-Healing Mermaid ★☆☆ Beginner Generate Mermaid diagrams with automatic error recovery
Heartbeat ★☆☆ Beginner ClawBot-like always-on periodic monitoring with nested flows
Lead Generation ★★☆ Intermediate Sales pipeline: scrape, enrich, score, and personalize emails
Newsletter ★★☆ Intermediate AI newsletter curation: search, filter, summarize, and format
Invoice Processing ★★☆ Intermediate Extract and validate invoice data from PDFs using vision
NotebookLM ★★☆ Intermediate Turn documents into a podcast with two AI hosts
Deep Research ★★☆ Intermediate Recursive map-reduce research with iterative refinement
Coding Agent ★★★ Advanced Production coding agent with 6 tools, memory, and patch-as-subflow

👀 Want to see other tutorials for dummies? Create an issue!

How to Use Pocket Flow?

🚀 Through Agentic Coding—the fastest LLM App development paradigm-where humans design and agents code!


IMAGE ALT TEXT

✨ Below are examples of more complex LLM Apps:

App Name Difficulty Topics Human Design Agent Code
Website Chatbot
Turn your website into a 24/7 customer support genius
★★☆
Medium
Agent
RAG
Design Doc Flow Code
Danganronpa Simulator
Forget the Turing test. Danganronpa, the ultimate AI experiment!
★★★
Advanced
Workflow
Agent
Design Doc Flow Code
Codebase Knowledge Builder
Life's too short to stare at others' code in confusion
★★☆
Medium
Workflow Design Doc Flow Code
Build Cursor with Cursor
We'll reach the singularity soon ...
★★★
Advanced
Agent Design Doc Flow Code
Ask AI Paul Graham
Ask AI Paul Graham, in case you don't get in
★★☆
Medium
RAG
Map Reduce
TTS
Design Doc Flow Code
Youtube Summarizer
Explain YouTube Videos to you like you're 5
★☆☆
Beginner
Map Reduce Design Doc Flow Code
Cold Opener Generator
Instant icebreakers that turn cold leads hot
★☆☆
Beginner
Map Reduce
Web Search
Design Doc Flow Code
  • Want to learn Agentic Coding?

    • Check out my YouTube for video tutorial on how some apps above are made!

    • Want to build your own LLM App? Read this post! Start with this template!

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,296 GitHub stars.