Comparisons / Flue vs LangChain
Flue vs LangChain: Which Agent Framework to Use?
Flue vs LangChain, head to head
Flue and LangChain live in different languages, different runtimes, and different theories of what an agent framework is even for — but they both end up on the shortlist when someone asks "what should I use to build an agent."
LangChain is the incumbent. Python-first, class-heavy, five years of accumulated integrations (~132k GitHub stars, ~3.4M weekly downloads), and paid-for by LangSmith (hosted observability) and LangServe (deployment). AgentExecutor wraps LLMChain wraps PromptTemplate + OutputParser; tools are @tool decorators or BaseTool subclasses; memory injects as a class. When you swap a vector store, you change one class — that's the abstraction earning its cost. LangGraph handles the workflow layer above the loop; 1.0 GA'd October 2025.
Flue is the new arrival. Announced May 1 2026 by Fred K. Schott and the Astro core team (now at Cloudflare), 1.0 beta on June 16 2026. TypeScript-native, declarative-first: createAgent({ model, instructions, tools }) is the whole construction, and state is a Durable Stream — a replayable event log stored in Cloudflare Durable Objects. Deploys to Cloudflare, plain Node, GitHub Actions, and GitLab CI from one config. Built on the Pi harness (same runtime as OpenClaw).
The tradeoff is real. LangChain trades bulk and a class hierarchy for the deepest integration catalog in the space. Flue trades ecosystem depth for a thinner API, native Cloudflare persistence, and a genuinely unusual cross-runtime deploy story. Language is usually the tiebreaker — Python teams pick LangChain, TypeScript teams pick Flue (or Mastra, or Eve).
Pick Flue if
Pick Flue when the team is TypeScript-native and Cloudflare Durable Objects is a real primitive to build on.
- The deploy target is Cloudflare Workers + Durable Objects; per-agent state + locking is essentially free.
- The same agent needs to run in production AND in CI (nightly bots, GitHub Actions research agents) — the cross-runtime config is rare and useful.
- Declarative feels cleaner than class hierarchies for how your team writes code.
- Your team is on the Pi/OpenClaw stack and shared tooling matters.
Pick LangChain if
Pick LangChain when Python is the stack and the integration matrix is what you're paying for.
- Your team writes Python and your data tooling assumes pandas; LangChain.js exists but trails on features.
- You need several vector stores, document loaders for PDF/CSV/HTML, multiple embeddings, and the option to swap LLM vendors behind one interface.
- LangSmith earns its keep — hosted tracing, eval suites, dataset-driven regression tests — and you don't want to build any of that.
- LangGraph is where you'd graduate to for workflows; the ecosystem holds together.
By the numbers
By the numbers
Flue
2.4k
140
TypeScript
MIT
2026-05-01
Fred K. Schott + Astro team (at Cloudflare)
Cloudflare
Cloudflare Durable Objects; also deploys to Node, GitHub Actions, GitLab CI
Yes
LangChain
132.3k
21.8k
Python
MIT
2022-10-17
Harrison Chase
Sequoia Capital, Benchmark
$25M Series A (2023), $25M Series B (2024)
3.5M
LangSmith (observability), LangServe (deployment)
Yes
Used by: Notion, Elastic, Instacart
github.com/langchain-ai/langchain→GitHub stats as of April 2026. Stars indicate community interest, not necessarily quality or fit for your use case.
| Concept | Flue | LangChain |
|---|---|---|
| Agent | `createAgent({ model, instructions, tools })` — declarative config, framework runs the loop | `AgentExecutor` with `LLMChain`, `PromptTemplate`, `OutputParser` |
| Tools | Registered with valibot schemas: `{ name, description, schema, execute }` | `@tool` decorator, `StructuredTool`, `BaseTool` class hierarchy |
| State | Durable Streams — replayable, checkpointed event log stored in Cloudflare Durable Objects | LangGraph state channels with typed reducers |
| Deployment | One config controls deploys to Cloudflare, Node, GitHub Actions, or GitLab CI | — |
| Runtime | The Pi harness — same runtime as OpenClaw, so agents share tooling with that ecosystem | — |
| Cloudflare-native | Durable Objects give per-agent persistence and locking without an external DB | — |
| Agent Loop | — | `AgentExecutor.invoke()` with internal iteration |
| Conversation | — | `ConversationBufferMemory`, `ConversationSummaryMemory` |
| Memory | — | `VectorStoreRetrieverMemory`, `ConversationEntityMemory` |
| Guardrails | — | `OutputParser`, `PydanticOutputParser`, custom validators |
Or build your own in 60 lines
Both Flue and LangChain implement the same 8 patterns. An agent is a function. Tools are a dict. The loop is a while loop. The whole thing composes in ~60 lines of Python.
No framework. No dependencies. No opinions. Just the code.
Build it from scratch →