yoheinakajima/activegraph
Event-sourced graph runtime for durable and stateful agents
What it solves
Active Graph is designed for long-running, agentic systems that require high auditability and the ability to resume, fork, or diff runs. Unlike traditional chat-based agents that rely on conversation history, Active Graph uses a shared graph as a workspace where behaviors react to changes in state, making the entire process traceable and reproducible.
How it works
The system is an event-sourced reactive graph runtime. It maintains an append-only event log as the source of truth, and the current state of the world (the graph) is a projection of that log.
- Behaviors: These are the units of reactive code (functions, classes, or LLM-backed) that subscribe to specific event types or graph patterns (using a Cypher subset) and produce new events.
- Relations: It introduces a "relation-behavior" primitive, allowing coordination logic to live on the edges between objects rather than on the endpoints.
- Replay and Forking: Because it is event-sourced, any run can be re-executed from its log. The system supports "fork-and-diff," allowing users to branch a run at any event, change configurations, and structurally diff the result against the parent run without re-executing the shared prefix.
- Packs: Domain-specific logic, object types, and tools are bundled into "packs" for modularity.
Who it’s for
Developers building complex, autonomous agents that need a rigorous audit trail, deterministic replay, and the ability to perform hypothesis testing via forking and diffing.
Highlights
- Event-Sourced Architecture: Every mutation is an event, providing a complete audit trail.
- Fork-and-Diff: Branch runs and compare results structurally, utilizing a cache for LLM calls to keep forking cheap.
- Relation-Behaviors: Logic attached to typed edges for unique coordination patterns.
- Pattern-Driven Subscriptions: Behaviors can trigger based on graph shapes and temporal predicates.
- Deterministic Replay: Supports strict and permissive modes to ensure system behavior is reproducible.