2.4 KiB
2.4 KiB
| layout | title | nav_order |
|---|---|---|
| default | Home | 1 |
Pocket Flow
A 100-line minimalist LLM framework for Agents, Task Decomposition, RAG, etc.
-
Expressive: Everything you love from larger frameworks—(Multi-)Agents, Workflow, RAG, and more.
-
Lightweight: Just the core graph abstraction in 100 lines. Zero bloat, zero dependencies, zero vendor lock-in.
-
Principled: Built with modularity and clear separation of concerns at its heart.
-
AI-Friendly: Intuitive enough for AI agents to assist humans in building complex LLM applications.
Core Abstraction
We model the LLM workflow as a Graph + Shared Store:
- Node handles simple (LLM) tasks.
- Flow connects nodes through Actions (labeled edges).
- Shared Store enables communication between nodes within flows.
- Batch nodes/flows allow for data-intensive tasks.
- (Advanced) Async nodes/flows allow waiting for asynchronous tasks.
- (Advanced) Parallel nodes/flows handle I/O-bound tasks.
Design Pattern
From there, it’s easy to implement popular design patterns:
- Structured Output
- Workflow
- Map Reduce
- RAG
- Agent
- (Optional) Chat Memory
- (Advanced) Multi-Agents
- Evaluation
Utility Function
We do not provide built-in utility functions in codes. But we provide example implementations in docs:
- LLM Wrapper
- Tool
- (Optional) Viz and Debug
- (Optional) Web Search
- (Optional) Chunking
- (Optional) Embedding
- (Optional) Vector Databases
- (Optional) Text-to-Speech