The 100-line antidote to framework bloat
A 100-line graph framework for LLM workflows, small enough that AI agents can write the agent logic for you.

What it does
PocketFlow is a minimal Python library for orchestrating LLM applications through a single graph abstraction. It covers agents, RAG pipelines, multi-agent chat, map-reduce, streaming, and human-in-the-loop workflows in roughly 100 lines of code with zero dependencies. The entire core fits in one file small enough to copy-paste directly into a project.
The interesting bit
The framework distills every LLM pattern down to graph nodes and edges, then gets out of the way. It ships no vendor-specific wrappers, so you bring your own LLM client and vector store. The author also ports the same 100-line concept to TypeScript, Java, C++, Go, Rust, and PHP, and provides two dozen cookbooks ranging from a basic chatbot to FastAPI WebSocket streaming and voice chat.
Key highlights
- Core runtime is ~100 lines and 56 KB, versus LangChain’s 405K lines and 166 MB according to the project’s comparison table
- Zero vendor lock-in: no built-in wrappers for OpenAI, Pinecone, or other providers
- Cookbook covers patterns from simple RAG and structured output to parallel execution, MCP, A2A, and LLM-as-Judge loops
- Supports “agentic coding”—the intended workflow is to let Cursor or another AI agent generate the framework boilerplate for you
- Multi-language ports available if you need the same graph logic outside Python
Verdict
Worth a look if you want a readable, hackable core for LLM workflows without inheriting a dependency tree. Not for you if you need turnkey, batteries-included integrations with specific cloud providers.
Frequently asked
- What is The-Pocket/PocketFlow?
- A 100-line graph framework for LLM workflows, small enough that AI agents can write the agent logic for you.
- Is PocketFlow open source?
- Yes — The-Pocket/PocketFlow is open source, released under the MIT license.
- What language is PocketFlow written in?
- The-Pocket/PocketFlow is primarily written in Python.
- How popular is PocketFlow?
- The-Pocket/PocketFlow has 11k stars on GitHub and is currently holding steady.
- Where can I find PocketFlow?
- The-Pocket/PocketFlow is on GitHub at https://github.com/The-Pocket/PocketFlow.