freshcrate
Home > Frameworks > PocketFlow

PocketFlow

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

Description

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

README

Pocket Flow – 100-line minimalist LLM framework

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 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
Majority Vote β˜†β˜†β˜† Dummy Improve reasoning accuracy by aggregating multiple solution attempts
Map-Reduce β˜†β˜†β˜† Dummy Batch resume qualification using map-reduce pattern
CLI HITL β˜†β˜†β˜† Dummy A command-line joke generator with human-in-the-loop feedback
Multi-Agent β˜…β˜†β˜† Beginner A Taboo word game for async communication between 2 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 showing 8x speedup
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
Code Generator β˜…β˜†β˜† Beginner Generate test cases, implement solutions, and iteratively improve code
MCP β˜…β˜†β˜† Beginner Agent using Model Context Protocol for numerical operations
Agent Skills β˜…β˜†β˜† Beginner Route requests to reusable markdown skills and apply them in an agent flow
A2A β˜…β˜†β˜† Beginner Agent wrapped with A2A protocol for inter-agent communication
Streamlit FSM β˜…β˜†β˜† Beginner Streamlit app with finite state machine for HITL image generation
FastAPI WebSocket β˜…β˜†β˜† Beginner Real-time chat interface with streaming LLM responses via WebSocket
FastAPI Background β˜…β˜†β˜† Beginner FastAPI app with background jobs and real-time progress via SSE
Voice Chat β˜…β˜†β˜† Beginner An interactive voice chat application with VAD, STT, LLM, and TTS.
Judge β˜…β˜†β˜† Beginner LLM-as-Judge evaluator-optimizer loop for iterative content refinement
Debate β˜…β˜†β˜† Beginner Adversarial reasoning with two advocates and an impartial judge
Agentic RAG β˜…β˜†β˜† Beginner Agent-driven RAG that decides which documents to read
Self-Healing Mermaid β˜…β˜†β˜† Beginner Generate Mermaid diagrams with automatic error recovery
Heartbeat β˜…β˜†β˜† Beginner ClawBot-like always-on periodic monitoring with nested flows
Lead Generation β˜…β˜…β˜† Intermediate Sales pipeline: scrape, enrich, score, and personalize emails
Newsletter β˜…β˜…β˜† Intermediate AI newsletter curation: search, filter, summarize, and format
Invoice Processing β˜…β˜…β˜† Intermediate Extract and validate invoice data from PDFs using vision
NotebookLM β˜…β˜…β˜† Intermediate Turn documents into a podcast with two AI hosts
Deep Research β˜…β˜…β˜† Intermediate Recursive map-reduce research with iterative refinement
Coding Agent β˜…β˜…β˜… Advanced Production coding agent with 6 tools, memory, and patch-as-subflow

πŸ‘€ 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
Website Chatbot
Turn your website into a 24/7 customer support genius
β˜…β˜…β˜†
Medium
Agent
RAG
Design Doc Flow Code
Danganronpa Simulator
Forget the Turing test. Danganronpa, the ultimate AI experiment!
β˜…β˜…β˜…
Advanced
Workflow
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
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
  • 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!

Release History

VersionChangesUrgencyDate
v0.0.0Latest release: v0.0.0Medium3/27/2026
main@2026-03-27Latest activity on main branchMedium3/27/2026
main@2026-03-27Latest activity on main branchMedium3/27/2026
main@2026-03-27Latest activity on main branchMedium3/27/2026
main@2026-03-27Latest activity on main branchMedium3/27/2026
main@2026-03-27Latest activity on main branchMedium3/27/2026
main@2026-03-27Latest activity on main branchMedium3/27/2026
main@2026-03-27Latest activity on main branchMedium3/27/2026
main@2026-03-27Latest activity on main branchMedium3/27/2026
main@2026-03-27Latest activity on main branchMedium3/27/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

PocketFlow-ZigπŸš€ Build LLM-powered workflows with PocketFlow-Zig, a lightweight framework leveraging Zig's features for efficient, type-safe programming.main@2026-04-21
AGI-Alpha-Agent-v0META‑AGENTIC α‑AGI πŸ‘οΈβœ¨ β€” Mission 🎯 End‑to‑end: Identify πŸ” β†’ Out‑Learn πŸ“š β†’ Out‑Think 🧠 β†’ Out‑Design 🎨 β†’ Out‑Strategise β™ŸοΈ β†’ Out‑Execute ⚑main@2026-04-18
summoner-agentsA collection of Summoner clients and agents featuring example implementations and reusable templatesv1.1.0
agent-archNo descriptionmain@2026-04-21
agent-resourcesπŸ› οΈ Install, manage, and share Claude Code skills effortlessly with one command, streamlining your workflow and enhancing team collaboration.main@2026-04-21