PocketFlow

An open-source Python LLM framework with no dependencies. Build agents and retrieval workflows using local models or cloud APIs under the MIT license.

Screenshot of PocketFlow website

PocketFlow is a small Python LLM framework for developers who want to build agents and workflows while choosing their own model providers and supporting tools. Its core has no dependencies and uses the MIT license. It can work with models run locally or through vendor APIs, depending on the application you build.

The framework represents tasks as a graph, with a shared store for passing data between them. That gives developers a common foundation for decision-making agents, chained workflows, and retrieval-augmented generation (RAG), where a model answers using retrieved material. It also supports coordinated agents, structured output, and map-reduce patterns for splitting and combining data tasks.

Batch processing handles groups of inputs, while asynchronous and parallel flows support tasks that spend time waiting on external services. Examples cover chat with conversation history, research agents, document translation, and streaming responses that users can interrupt.

PocketFlow leaves model calls and supporting utilities to the application. It provides examples for web search, embeddings, vector databases, and text-to-speech rather than bundling vendor-specific integrations. This makes it a fit for developers who want control over those choices, though they'll need to supply the connections themselves. Where data goes depends on the models and services they choose.

The project includes guidance for building applications with coding agents such as Cursor AI. It also has TypeScript, Java, C++, Go, Rust, and PHP versions.

Similar to PocketFlow