LangGraphGo is a Go implementation of the core ideas behind LangGraph: a graph-based runtime for building deterministic, stateful LLM workflows with checkpointing, interrupts/resume, and streaming.
This repository focuses on:
- A Pregel-style execution engine (step-based scheduling)
- Durable checkpointing (save/restore) and resume semantics
- Tool calling support through provider adapters
- A practical Go-first API surface (while tracking LangGraphJS semantics)
LangGraphGo lets you define a graph of nodes (functions) connected by edges. Nodes can:
- Read from state channels
- Write updates to channels (with reducer semantics depending on channel type)
- Emit interrupts and resume later using checkpoints
- Stream events/updates during execution
The runtime executes the graph step-by-step, applying writes deterministically and persisting progress via a configurable checkpointer.
Porting LangGraph concepts to Go enables benefits that fit production systems:
- Concurrency & parallelism: goroutines make it natural to run independent node work concurrently.
- Lower overhead, simpler deployments: a single static binary is easy to ship.
- Predictable performance: explicit control over memory and concurrency limits.
- Strong typing where it matters: core runtime contracts are explicit, while state payloads remain flexible (
any) for ergonomics.
This project aims for semantic parity with LangGraphJS, but some surface-area and implementation details differ due to Go idioms:
- Go-first public API: fewer builder/annotation conveniences; focus on explicit types and simple composition.
- Concurrency model: Go may execute work in parallel while preserving deterministic observable semantics.
- Checkpointing contract: checkpointers are pluggable (memory/file/sqlite/postgres/redis/mongo), and checkpoint tuples include pending writes and optional parent linkage.
- Streaming: exposes stream chunks/events using Go channels.
This is an active work-in-progress.
Parity with LangGraphJS is not complete yet. I continue to implement missing pieces when I have time and will keep tightening semantics and public API coverage.
Contributions are welcome.
- Open an issue for feature requests / parity gaps.
- PRs for bug fixes, tests, provider adapters, and documentation improvements are appreciated.
See the repository license file.