What is PocketFlow?
PocketFlow is a deliberately tiny LLM framework written in about 100 lines of Python. It ships with zero extra dependencies and no vendor-specific wrappers, so there is no bloat and no lock-in to a single model provider. It sits in the Agent Frameworks & Builders category of the Agents & Automation tools and is open-source, written in Python and licensed MIT.
Overview
PocketFlow is a deliberately tiny LLM framework written in about 100 lines of Python. It ships with zero extra dependencies and no vendor-specific wrappers, so there is no bloat and no lock-in to a single model provider.
The whole framework is built around one idea: a graph. Nodes do the work and connect to each other, and from that single abstraction you can express common patterns like agents, workflows, and retrieval-augmented generation (RAG).
Because the core is so small, the project leans into "agentic coding" — using AI assistants such as Cursor to help you build your own agents on top of the framework. There are also community ports for TypeScript, Java, C++, Go, Rust, and PHP.
What it does
- Tiny core: the entire framework is roughly 100 lines of Python with zero dependencies and zero vendor wrappers
- Graph-based design that lets you compose nodes into flows for any LLM application
- Supports popular patterns out of the box: agents, multi-agents, workflows, and RAG
- Model-agnostic — you wire in whichever LLM and tools you want, with no built-in lock-in
- Large cookbook of runnable examples, from a basic chat bot to map-reduce, text-to-SQL, MCP, and voice chat
- Ports available in TypeScript, Java, C++, Go, Rust, and PHP
Getting started
PocketFlow is published on PyPI. You can install it with pip, or simply copy the 100-line source file straight into your project.
Install PocketFlow
Add the package to your Python environment with pip. Alternatively, you can copy the single 100-line source file from the repository instead of installing anything.
pip install pocketflowLearn the patterns from the cookbook
The repository includes a cookbook of small, runnable examples covering chat, structured output, workflows, agents, and RAG. Browsing these is the fastest way to see how nodes and flows fit together before building your own.
Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Building LLM agents and multi-agent systems without pulling in a heavy framework
- Prototyping workflows and RAG pipelines using a small, easy-to-read core you can fully understand
- Teaching or learning how LLM frameworks work by reading the entire 100-line graph abstraction
- Using AI coding assistants to scaffold custom agents on top of a minimal, dependency-free base
How PocketFlow compares
PocketFlow alongside other open-source agent frameworks & builders tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| DeepSeek Harness | ★ 289k | DeepSeek AI's open-source agent harness (dsh), built on Cordis, where models, tools, skills, sessions, sandboxes, storage and the UI are all plugins composed through profiles. |
| AutoGPT | ★ 188k | One of the earliest autonomous agent projects, now a platform for building and running agents from reusable blocks and workflows. |
| DeerFlow | ★ 86k | ByteDance's open-source super agent harness built on LangGraph: skills, sub-agents, sandboxes, a filesystem and long-term memory for long-horizon research, coding and content tasks. |
| nanobot | ★ 50.5k | Lightweight self-hosted personal AI agent framework in Python, with a WebUI, terminal and chat-app channels, tools, long-term memory, MCP and scheduled automations. |
| LangGraph | ★ 45.6k | A library from the LangChain team for building stateful, graph-based agent workflows with explicit control over steps, memory, and human-in-the-loop checkpoints. |
| Agno | ★ 43.3k | A fast Python framework (formerly Phidata) for building agents with memory, tools, and multimodal inputs, plus a runtime for deploying them in production. |
| AgentGPT | ★ 36.3k | AgentGPT lets you name a custom AI, give it a goal, and watch it plan tasks, run them, and learn from the results, all from a web browser. |
| PocketFlow | ★ 11.4k | A 100-line minimalist LLM framework with zero dependencies |

