PocketFlow
Pocket Flow: 100-line LLM framework. Let Agents build Agents!
What is PocketFlow?
Pocket Flow: 100-line LLM framework. Let Agents build Agents!
Overview of PocketFlow
What it is
Pocket Flow is a 100-line minimalist LLM framework. It is described as lightweight, expressive, and designed for agentic coding. The framework's core abstraction is a Graph, from which popular design patterns like (Multi-)Agents, Workflow, and RAG can be implemented. It has zero dependencies and zero vendor lock-in. The project is open source under the MIT license.
Key features
- Lightweight: only 100 lines of code, zero bloat, zero dependencies, zero vendor lock-in.
- Expressive: supports (Multi-)Agents, Workflow, RAG, and more.
- Agentic Coding: enables AI Agents (e.g., Cursor AI) to build Agents, aiming for a 10x productivity boost.
- Multi-language versions: now available in TypeScript, Java, C++, Go, Rust, and PHP.
- Minimal size: approximately 56KB.
Use cases
Pocket Flow can be used to build a variety of LLM applications. The README lists tutorials for: Chat, Structured Output, Workflow, Agent, RAG, Batch, Streaming, Chat Guardrail, Majority Vote, Map-Reduce, CLI HITL, Multi-Agent, Supervisor, Parallel, Parallel Flow, Thinking, Memory, Text2SQL, Code Generator, MCP, Agent Skills, A2A, Streamlit FSM, FastAPI WebSocket, FastAPI Background, Voice Chat, Judge, Debate, Agentic RAG, Self-Healing Mermaid, Heartbeat, Lead Generation, Newsletter, Invoice Processing, NotebookLM, Deep Research, and Coding Agent. More complex example apps include a Website Chatbot, Danganronpa Simulator, Codebase Knowledge Builder, Build Cursor with Cursor, Ask AI Paul Graham, Youtube Summarizer, and Cold Opener Generator.
Getting started
To install, run: pip install pocketflow or copy the source code (only 100 lines). For more details, see the repository README.
License and pricing
License: MIT. Pricing: open source (free).
Based on the project's public README and repository metadata.