Pocket Flow
A 100-line minimalist LLM framework for Agents, Task Decomposition, RAG, etc.
We model the LLM workflow as a Nested Directed Graph:
- Nodes handle simple (LLM) tasks.
- Nodes connect through Actions (labeled edges) for Agents.
- Flows orchestrate a directed graph of Nodes for Task Decomposition.
- A Flow can be used as a Node (for Nesting).
- Batch Nodes/Flows for data-intensive tasks.
- Async Nodes/Flows allow waits or Parallel execution
Have questions? Chat with AI Assistant
Core Abstraction
Low-Level Details
- LLM Wrapper
- Tool
- Visualization
- Chunking
We do not provide built-in implementations.
Example implementations are provided as reference.
High-Level Paradigm
- Structured Output
- Task Decomposition
- Map Reduce
- RAG
- Chat Memory
- Agent
- (Advanced) Multi-Agents
- Evaluation
Example LLM Apps
- Summarization + QA agent for Paul Graham Essay
- More coming soon…