fast-langgraph vs LangGraph: 737× faster checkpoints, same Python API
fast-langgraph is a Rust+PyO3 drop-in for LangGraph, the stateful agent framework. It replaces the pure-Python checkpoint serializer with Rust+serde+SIMD; the graph definition is unchanged.
$ pip install fast-langgraph fast-langgraph is a Rust-backed drop-in for
LangGraph. Same API, faster hot paths.
Install: pip install fast-langgraph.
737× faster checkpoint serialization (0.1ms vs 73.5ms, 50-message agent state).
fast-langgraph vs LangGraph: the facts
737× faster checkpoint serialization (0.1ms vs 73.5ms, 50-message agent state).
Pure-Python `json.dumps` with custom encoders; allocates Python objects for every value.
151× faster checkpoint deserialization (0.3ms vs 45.2ms).
Pure-Python `json.loads`; copies the entire state tree into Python objects.
46× faster full state-update cycle (2.0ms vs 92.0ms).
SQLite writes are serialised by per-row fsync overhead.
2.8× faster end-to-end 10-step agent execution (443ms vs 1,240ms).
Network-bound by LLM calls; the 2.8× is everything *except* the LLM call.
Zero code changes: `export FAST_LANGGRAPH_AUTO_PATCH=1`.
Direct Python import.
MIT licensed, prebuilt wheels, Python 3.9+, any LangGraph 0.2.x.
MIT licensed.
Benchmarks
Reproduction instructions in the project README. Numbers measured on AMD Ryzen 9 7950X, 64GB DDR5, NVMe SSD, Python 3.12.
| Metric | fast-langgraph | LangGraph |
|---|---|---|
| Checkpoint serialization (50-msg state) | 0.1ms | 73.5ms |
| Checkpoint deserialization | 0.3ms | 45.2ms |
| Full state update | 2.0ms | 92.0ms |
| 10-step agent end-to-end | 443ms | 1,240ms |
When to use fast-langgraph
- You run LangGraph agents with >5 steps (so checkpoint overhead matters).
- You do long-running research / coding agents where the checkpoint dominates.
- You want 100× infrastructure speedup with zero code changes.
When NOT to use fast-langgraph
- You only use LangGraph for tiny toy graphs (<3 steps).
- Your bottleneck is the LLM API itself — the 2.8× end-to-end speedup is infrastructure-only.
Frequently asked questions
Does fast-langgraph work with LangGraph's PostgreSQL checkpointer?
The auto-patch mode works with any backend for the serialization layer. The RustSQLiteCheckpointer is the headline win; PostgreSQL support is on the roadmap.
Will fast-langgraph break my existing LangGraph agents?
No. fast-langgraph preserves the full LangGraph API. The auto-patch mode has version detection and silent fallback.
Why is the end-to-end speedup only 2.8× when serialization is 737× faster?
End-to-end time includes the LLM API call (network latency, ~500ms), which fast-langgraph does not optimize. In agents with many steps and few LLM calls (e.g. data processing pipelines), the end-to-end improvement is much higher.
How does fast-langgraph compare to using orjson instead of json?
orjson gives a 2-5× speedup. fast-langgraph bypasses Python object allocation entirely and parallelises across Rust threads, plus adds batched SQLite writes — 737× vs 2-5×.