
PocketFlow
A tiny Python framework (about 100 lines) for wiring LLM calls into graphs of steps and agents.
- Stars
- 11.3k
- Forks
- 1.2k
- Licence
- MIT
- Language
- Python
- Last update
- 3 months ago
- Type
- Library
What it is
Pocket Flow is a minimalist framework for building LLM applications, based on a graph abstraction where small nodes are connected into flows. The README says the core is about 100 lines with no dependencies and no vendor-specific wrappers, and that it can be used to build agents, workflows, and retrieval-augmented generation (RAG) systems. People use it when they want to understand and control their LLM code instead of relying on a large framework.
- Build a basic chat bot that keeps conversation history (cookbook example)
- Create a research agent that searches the web and answers questions (cookbook example)
- Run a batch job that translates markdown into multiple languages (cookbook example)
- Build a retrieval-augmented generation process (cookbook example)
Great for
- Developers who want a small, readable LLM framework they can inspect in full
- Python programmers building agents, multi-step workflows, or RAG pipelines
- People who want to copy the source directly into a project instead of adding a dependency
- Developers experimenting with AI coding assistants that generate agent code
Not ideal for
- Teams that need many prebuilt integrations with vendors and vector databases, since the README says it includes none ('None' in its comparison table)
- Non-programmers, because it is a code library rather than a ready-to-use app
- Projects needing a formal, versioned release, since the repository shows no latest release
How to get it
- 1
Install with a package manager
You'll need: Python
Install from PyPI
pip install pocketflow - 2
Run it
- Install the package with pip install pocketflow, or copy the source file pocketflow/__init__.py into your project.
- Open the basic tutorials listed in the README, starting with the Chat example.
- Read the documentation at the-pocket.github.io/PocketFlow for how nodes and flows are defined.
- Run one cookbook example and adapt it to your own task.
- 3
Get the most out of it
- Start with the cookbook examples in order of difficulty, from Chat to Multi-Agent
- Use the Discord community linked in the README to ask questions about building with it
- Try the sibling implementations in TypeScript, Java, C++, Go, Rust, or PHP if your stack is not Python
- Follow the design pattern guides for agents, workflows, and RAG in the documentation
Downloads
Strengths
- Very small codebase (about 100 lines), so the whole framework is easy to read and audit
- No dependencies and no vendor lock-in, according to the README
- Includes tutorials from a dummy-level chat example up to multi-agent and parallel demos
Trade-offs
- Provides few built-in integrations, so you write your own connections to LLM providers and tools
- The README is truncated in the source provided, so some details could not be verified
- Documentation and examples are spread across the README, a docs site, and a cookbook folder
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| PocketFlow (this) | 11.3k | Library | intermediate | 3 months ago | Developers who want a small, readable LLM framework they can inspect in full |
| langchain | 149k | Framework | intermediate | 4 days ago | Python developers building LLM-powered applications |
| langgraph | 44.3k | Library | intermediate | 4 days ago | Python developers building multi-step AI agents that must survive failures or long waits |
| crewAI | 60.4k | Library | intermediate | 4 days ago | Python developers prototyping multi-agent workflows |
| ruflo | 80.6k | Dev tool | intermediate | 4 days ago | Developers already using Claude Code or Codex who want multiple agents working together |
| PocketFlow-Tutorial-Codebase-Knowledge | 12.7k | Dev tool | intermediate | 5 months ago | Developers who need to understand a large unfamiliar open-source project |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.