SkillAgentSearch skills...

PocketFlow

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

Install / Use

/learn @The-Pocket/PocketFlow

README

<div align="center"> <img src="https://github.com/The-Pocket/.github/raw/main/assets/title.png" alt="Pocket Flow – 100-line minimalist LLM framework" width="600"/> </div> <!-- For translation, replace English with [English](https://github.com/The-Pocket/PocketFlow/blob/main/README.md), and remove the link for the target language. -->

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

License: MIT Docs <a href="https://discord.gg/hUHHE9Sa6T"> <img src="https://img.shields.io/discord/1346833819172601907?logo=discord&style=flat"> </a>

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!

<div align="center"> <img src="https://github.com/The-Pocket/.github/raw/main/assets/meme.jpg" width="400"/>

| | Abstraction | App-Specific Wrappers | Vendor-Specific Wrappers | Lines | Size | |----------------|:-----------------------------: |:-----------------------------------------------------------:|:------------------------------------------------------------:|:---------------:|:----------------------------:| | LangChain | Agent, Chain | Many <br><sup><sub>(e.g., QA, Summarization)</sub></sup> | Many <br><sup><sub>(e.g., OpenAI, Pinecone, etc.)</sub></sup> | 405K | +166MB | | CrewAI | Agent, Chain | Many <br><sup><sub>(e.g., FileReadTool, SerperDevTool)</sub></sup> | Many <br><sup><sub>(e.g., OpenAI, Anthropic, Pinecone, etc.)</sub></sup> | 18K | +173MB | | SmolAgent | Agent | Some <br><sup><sub>(e.g., CodeAgent, VisitWebTool)</sub></sup> | Some <br><sup><sub>(e.g., DuckDuckGo, Hugging Face, etc.)</sub></sup> | 8K | +198MB | | LangGraph | Agent, Graph | Some <br><sup><sub>(e.g., Semantic Search)</sub></sup> | Some <br><sup><sub>(e.g., PostgresStore, SqliteSaver, etc.) </sub></sup> | 37K | +51MB | | AutoGen | Agent | Some <br><sup><sub>(e.g., Tool Agent, Chat Agent)</sub></sup> | Many <sup><sub>[Optional]<br> (e.g., OpenAI, Pinecone, etc.)</sub></sup> | 7K <br><sup><sub>(core-only)</sub></sup> | +26MB <br><sup><sub>(core-only)</sub></sup> | | PocketFlow | Graph | None | None | 100 | +56KB |

</div>

How does Pocket Flow work?

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

<div align="center"> <img src="https://github.com/The-Pocket/.github/raw/main/assets/abstraction.png" width="900"/> </div> <br>

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

<div align="center"> <img src="https://github.com/The-Pocket/.github/raw/main/assets/design.png" width="900"/> </div> <br> ✨ Below are basic tutorials: <div align="center">

| Name | Difficulty | Description |
| :-------------: | :-------------: | :--------------------- |
| Chat | ☆☆☆ <sup>Dummy</sup> | A basic chat bot with conversation history | | Structured Output | ☆☆☆ <sup>Dummy</sup> | Extracting structured data from resumes by prompting | | Workflow | ☆☆☆ <sup>Dummy</sup> | A writing workflow that outlines, writes content, and applies styling | | Agent | ☆☆☆ <sup>Dummy</sup> | A research agent that can search the web and answer questions | | RAG | ☆☆☆ <sup>Dummy</sup> | A simple Retrieval-augmented Generation process | | Batch | ☆☆☆ <sup>Dummy</sup> | A batch processor that translates markdown into multiple languages | | Streaming | ☆☆☆ <sup>Dummy</sup> | A real-time LLM streaming demo with user interrupt capability | | Chat Guardrail | ☆☆☆ <sup>Dummy</sup> | A travel advisor chatbot that only processes travel-related queries | | Majority Vote | ☆☆☆ <sup>Dummy</sup> | Improve reasoning accuracy by aggregating multiple solution attempts | | Map-Reduce | ☆☆☆ <sup>Dummy</sup> | Batch resume qualification using map-reduce pattern | | CLI HITL | ☆☆☆ <sup>Dummy</sup> | A command-line joke generator with human-in-the-loop feedback | | Multi-Agent | ★☆☆ <sup>Beginner</sup> | A Taboo word game for async communication between 2 agents | | Supervisor | ★☆☆ <sup>Beginner</sup> | Research agent is getting unreliable... Let's build a supervision process| | Parallel | ★☆☆ <sup>Beginner</sup> | A parallel execution demo that shows 3x speedup | | Parallel Flow | ★☆☆ <sup>Beginner</sup> | A parallel image processing showing 8x speedup | | Thinking | ★☆☆ <sup>Beginner</sup> | Solve complex reasoning problems through Chain-of-Thought | | Memory | ★☆☆ <sup>Beginner</sup> | A chat bot with short-term and long-term memory | | Text2SQL | ★☆☆ <sup>Beginner</sup> | Convert natural language to SQL queries with an auto-debug loop | | Code Generator | ★☆☆ <sup>Beginner</sup> | Generate test cases, implement solutions, and iteratively improve code | | MCP | ★☆☆ <sup>Beginner</sup>

Related Skills

View on GitHub
GitHub Stars10.3k
CategoryDevelopment
Updated42m ago
Forks1.1k

Languages

Python

Security Score

100/100

Audited on Mar 27, 2026

No findings