PocketFlow

PocketFlow

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

Stars: 1484

Visit
 screenshot

Pocket Flow is a 100-line minimalist LLM framework designed for (Multi-)Agents, Workflow, RAG, etc. It provides a core abstraction for LLM projects by focusing on computation and communication through a graph structure and shared store. The framework aims to support the development of LLM Agents, such as Cursor AI, by offering a minimal and low-level approach that is well-suited for understanding and usage. Users can install Pocket Flow via pip or by copying the source code, and detailed documentation is available on the project website.

README:

License: MIT Docs

Pocket Flow is a 100-line minimalist LLM framework

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
Map-Reduce β˜†β˜†β˜†
Dummy
A resume qualification processor using map-reduce pattern for batch evaluation
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
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
Thinking β˜…β˜†β˜†
Beginner
Solve complex reasoning problems through Chain-of-Thought
Memory β˜…β˜†β˜†
Beginner
A chat bot with short-term and long-term memory
MCP β˜…β˜†β˜†
Beginner
Agent using Model Context Protocol for numerical operations

πŸ‘€ 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!


IMAGE ALT TEXT

✨ 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
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

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for PocketFlow

Similar Open Source Tools

For similar tasks

For similar jobs