Pocket Flow logo

Pocket Flow

Build AI apps with a 100‑line, dependency‑free framework

Pocket Flow is a 100‑line, zero‑dependency LLM framework that offers graph‑based agents, workflows, RAG, and multi‑language ports, enabling rapid, vendor‑agnostic AI application development.

Pocket Flow banner

Overview

Highlights

100‑line core graph abstraction
Zero external dependencies
Built‑in support for agents, workflows, RAG
Ports for TypeScript, Java, C++, Go, Rust, PHP

Pros

  • Tiny footprint (~56 KB) makes it easy to audit
  • No vendor lock‑in; works with any LLM API
  • Fast to prototype and understand
  • Cross‑language implementations broaden ecosystem

Considerations

  • Limited out‑of‑the‑box integrations (e.g., vector stores)
  • Smaller community compared to larger frameworks
  • Advanced features may require custom code
  • Performance optimizations depend on user implementation

Managed products teams compare with

When teams consider Pocket Flow, these hosted platforms usually appear on the same shortlist.

Relevance AI logo

Relevance AI

No-code platform to build a team of AI agents with rich integrations

Looking for a hosted option? These are the services engineering teams benchmark against before choosing open source.

Fit guide

Great for

  • Developers who need a lightweight, transparent LLM core
  • Educational settings teaching LLM orchestration concepts
  • Rapid prototyping of custom AI workflows
  • Projects targeting multiple programming languages

Not ideal when

  • Enterprises requiring extensive pre‑built toolkits and support
  • Production systems needing built‑in scaling and monitoring
  • Teams that rely on ready-made vendor SDKs
  • Use cases demanding heavy‑weight graph analytics out of the box

How teams use it

Chatbot with memory

A conversational agent that retains short‑term and long‑term context using Pocket Flow’s graph nodes.

Retrieval‑augmented generation pipeline

Combine external document retrieval with LLM generation for accurate Q&A without external wrappers.

Multi‑agent research assistant

Two agents coordinate via async graph to browse web, synthesize information, and produce reports.

Parallel image processing workflow

Process multiple images concurrently, achieving up to 8× speedup using Pocket Flow’s parallel flow support.

Tech snapshot

Python71%
Jupyter Notebook21%
HTML8%
CSS1%

Tags

retrieval-augmented-generationflow-engineeringworkflowaiagentsagentic-workflowllm-agentagentic-frameworkaiagentflow-based-programmingai-frameworksartificial-intelligencelarge-language-modelai-frameworkagentic-aiagentspocketflowllm-frameworklarge-language-modelsworkflow-orchestrationpocket-flow

Frequently asked questions

How do I install Pocket Flow?

Run `pip install pocketflow` or copy the single 100‑line source file into your project.

Does Pocket Flow have any external dependencies?

No. The core library is dependency‑free; optional language ports may have their own standard libraries.

Can I use Pocket Flow with any LLM provider?

Yes. The framework abstracts the LLM call, so you can plug in OpenAI, Anthropic, or self‑hosted models by implementing a simple interface.

What languages are supported?

Beyond Python, there are community ports for TypeScript, Java, C++, Go, Rust, and PHP.

Is Pocket Flow suitable for production workloads?

It is ideal for prototyping and lightweight services; production use may require additional tooling for scaling, monitoring, and security.

Project at a glance

Active
Stars
10,157
Watchers
10,157
Forks
1,109
LicenseMIT
Repo age1 year old
Last commit3 weeks ago
Primary languagePython

Last synced 2 hours ago