What Git was to source code, AgentStateGraph is to agent state — a content-addressed, branchable, blameable state primitive, designed from the ground up for AI agents as the primary actor.
Rust core · 5 language bindings (Py / TS / Go / WASM / C FFI) · 27 MCP tools · HTTP API · Plans & Tasks · schema migrations
A future where AI is responsible for an entire infrastructure — rollouts, tracing, observability, alerts, reports — and is accountable for it mechanically rather than socially. Every change carries why, who authorized it, what alternatives existed, and what the agent expected vs. observed, across every branch, forever.
Why this matters
These aren't hypotheticals. They're the conversations happening right now in every company deploying AI agents.
An agent managing your production cluster detects a node failure at 2 AM. It reroutes traffic with 73% confidence. At 8 AM, the CTO walks in and asks what happened.
With logs: two hours reconstructing events from CloudWatch, Slack threads, and guesswork.
With AgentStateGraph: blame /cluster/node-3/status — full chain in three minutes. Who detected it, what alternatives were considered, why this approach was chosen, what confidence level, what happened next.
Your company deploys AI agents that touch the billing system. A regulator asks for a complete record of every change, who authorized it, and why.
With observability tools: a two-week log reconstruction project. Engineers dig through LangSmith traces, piece together timelines, and pray the retention policy hasn't expired.
With AgentStateGraph: one query, one sealed epoch export, handed to the auditor. Tamper-evident, independently verifiable, done in 30 seconds.
A planning agent needs to decide how to migrate a database. Instead of picking one approach and hoping, it creates three speculations — O(1) branches that cost nothing to create and nothing to discard.
Each speculation runs independently. The agent compares outcomes side by side, commits the winner with full reasoning, and discards the rest.
If the winner was wrong, the blame trail shows exactly what the agent expected vs. what happened, what alternatives it considered, and why it chose this one. Accountability by construction, not by accident.
How it works
Git commits answer "what changed." AgentStateGraph commits answer everything else too.
Use It From Anywhere
Rust is the reference implementation. Every other binding rides on the same core and the same commit format — a Python agent and a Go agent can write to the same repository and see each other's intent annotations.
cargo add agentstategraph pip install agentstategraph npm install @agentstategraph/core go get github.com/nosqltips/AgentStateGraph/bindings/go npm install @agentstategraph/wasm cargo build -p agentstategraph-ffi --release The Workspace
ASG is a Cargo workspace: a small, I/O-free core; pluggable storage; a user-facing facade; and the extensions that make it useful across a fleet — tasks, migrations, MCP, FFI, WASM.
agentstategraph-core core Content-addressed commits, intent categories, blame. Zero I/O dependencies — pure types and algorithms. Everything else builds on this.
agentstategraph-storage storage Pluggable backends: in-memory for tests, SQLite for single-node, extensible for Postgres and S3-backed deployments. All behind one trait.
agentstategraph facade The user-facing crate most callers depend on. Re-exports core + storage and presents the ergonomic Repository API — get, set, branch, merge, log, blame, speculate.
agentstategraph-tasks new in 0.4 Plans, tasks, assignments, blockers, derived status. A shared primitive so every ASG consumer — CTXone, ThreadWeaver, Console — agrees on what a "task" is. Prevents plan-rot across the fleet.
agentstategraph-migrate new in 0.4 Schema-version registry and migration runner. Tag your repo with a schema version; register forward migrations; run migrate check / migrate run on any ref.
agentstategraph-mcp server Model Context Protocol server exposing 27 tools plus an HTTP REST API. Drop-in for Claude Desktop, Cursor, or any MCP-speaking agent.
agentstategraph-ffi ffi Stable C ABI. What Go, and any future Java / Ruby / C# binding calls. One header, one static lib — no Rust toolchain needed on the consumer.
agentstategraph-wasm wasm wasm-bindgen build for browsers, Deno, and Node. Run ASG in a browser tab against an in-memory repo — ideal for demos, client-side prototypes, and the Explorer.
Get Started
What it is not
AgentStateGraph is a state primitive. It is the layer on which a next-generation IaC tool, a next-generation GitOps tool, and agent-native ops tooling can all be built.
License
AgentStateGraph is a state primitive designed to become infrastructure. Infrastructure primitives are strip-mining targets: cloud providers offer them as managed services, capture the value, and contribute nothing back. BSL 1.1 closes that gap.
Because the project wouldn't survive it. An MIT-licensed infrastructure primitive that gains traction gets absorbed by a hyperscaler within 18 months. BSL 1.1 lets the project grow, stay independent, and convert to a fully permissive license once it's established enough that strip-mining is no longer an existential threat.
This is the same reasoning MongoDB, Elastic, and MariaDB used — with one difference: we committed to the conversion date upfront.
See it in action
AI chat with branchable conversations, multimodal, tool calling, MCP integration. Every feature powered by AgentStateGraph.
Visit threadweaver.org GitHub