Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

WatchHub/PocketFlow

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | 中文 | Español | 日本語 | Deutsch | Русский | Português | Français | 한국어

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!

Get started with Pocket Flow:

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

How does Pocket Flow work?

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


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


✨ Below are basic tutorials:
Name Difficulty Description
Chat ☆☆☆
Dummy
A basic chat bot with conversation history
Structured Output ☆☆☆
Dummy
Extracting structured data from resumes by prompting
Workflow ☆☆☆
Dummy
A writing workflow that outlines, writes content, and applies styling
Agent ☆☆☆
Dummy
A research agent that can search the web and answer questions
RAG ☆☆☆
Dummy
A simple Retrieval-augmented Generation process
Batch ☆☆☆
Dummy
A batch processor that translates markdown content into multiple languages
Streaming ☆☆☆
Dummy
A real-time LLM streaming demo with user interrupt capability
Chat Guardrail ☆☆☆
Dummy
A travel advisor chatbot that only processes travel-related queries
Map-Reduce ★☆☆
Beginner
A resume qualification processor using map-reduce pattern for batch evaluation
Multi-Agent ★☆☆
Beginner
A Taboo word game for asynchronous communication between two agents
Supervisor ★☆☆
Beginner
Research agent is getting unreliable... Let's build a supervision process
Parallel ★☆☆
Beginner
A parallel execution demo that shows 3x speedup
Parallel Flow ★☆☆
Beginner
A parallel image processing demo showing 8x speedup with multiple filters
Majority Vote ★☆☆
Beginner
Improve reasoning accuracy by aggregating multiple solution attempts
Thinking ★☆☆
Beginner
Solve complex reasoning problems through Chain-of-Thought
Memory ★☆☆
Beginner
A chat bot with short-term and long-term memory
Text2SQL ★☆☆
Beginner
Convert natural language to SQL queries with an auto-debug loop
MCP ★☆☆
Beginner
Agent using Model Context Protocol for numerical operations
A2A ★☆☆
Beginner
Agent wrapped with Agent-to-Agent protocol for inter-agent communication
Web HITL ★☆☆
Beginner
A minimal web service for a human review loop with SSE updates

👀 Want to see other tutorials for dummies? Create an issue!

How to Use Pocket Flow?

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



✨ Below are examples of more complex LLM Apps:

App Name Difficulty Topics Human Design Agent Code
Build Cursor with Cursor
We'll reach the singularity soon ...
★★★
Advanced
Agent Design Doc Flow Code
Codebase Knowledge Builder
Life's too short to stare at others' code in confusion
★★☆
Medium
Workflow Design Doc Flow 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
  • Want to learn Agentic Coding?

    • Check out my YouTube for video tutorial on how some apps above are made!

    • Want to build your own LLM App? Read this post! Start with this template!

About

Pocket Flow: 100-line LLM framework. Let Agents build Agents!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 67.8%
  • Jupyter Notebook 30.0%
  • HTML 1.6%
  • CSS 0.6%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.