pocketflow/docs/index.md

2.6 KiB
Raw Blame History

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 dependencies, and 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, its easy to implement popular design patterns:

Utility Function

We provide utility functions not in codes, but in docs:

Read to Develop your LLM Apps? Read this guide!