Go to file
Zachary Huang a9c379252b
Update communication.md
2025-03-15 15:23:41 -04:00
assets update agent 2025-03-13 18:36:16 -04:00
cookbook para 2025-03-11 16:16:05 -04:00
docs Update communication.md 2025-03-15 15:23:41 -04:00
pocketflow m 2025-02-02 22:30:18 +00:00
tests rename as mini llm flow is poor 2025-01-09 03:01:25 +00:00
.cursorrules update cursor rule 2025-03-11 19:27:43 -04:00
.gitignore update steup.py 2025-03-14 21:57:50 -04:00
LICENSE Create LICENSE 2024-12-26 00:44:17 -05:00
README.md Update README.md 2025-03-14 22:03:05 -04:00
setup.py update steup.py 2025-03-14 21:57:50 -04:00

README.md

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!

  • To install, pip install pocketflowor just copy the source code (only 100 lines).

  • To learn more, check out the documentation. For an in-depth design dive, read the essay.

  • 🎉 We now have a discord!

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

Pocket Flow is also a educational resource for understanding LLM frameworks:

  • Larger frameworks are overly abstract and hide away details.

  • Pocket Flow shows exactly how everything works under the hood.

How to Use Pocket Flow?

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



Below are examples of LLM Apps:

App Name Difficulty Topics Human Design Agent 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

How does Pocket Flow work?

The 100 lines capture the core abstraction of LLM frameworks: Graph!

From there, its easy to implement popular design patterns like (Multi-)Agents, Workflow, RAG, etc.