yoheinakajima/activegraph

Event-sourced graph runtime for durable and stateful agents

What it solves

Active Graph is designed for long-running, agentic systems where auditability, traceability, and the ability to resume or fork runs are critical. It moves away from chat-based agent architectures—where agents talk to each other—toward a shared workspace (a graph) where behaviors react to changes in the world state. This ensures that every mutation is recorded in an append-only event log, making the system's history fully transparent and reproducible.

How it works

The framework operates as 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 is a projection of that log into a graph of objects and typed relations.

Key mechanisms include:

  • Reactive Behaviors: Code (functions, classes, or LLM-backed) that subscribes to specific event types or graph patterns (using a Cypher subset) and produces new events.
  • Relation-Behaviors: Logic attached directly to the edges between objects, allowing coordination to happen on the relation rather than the endpoints.
  • Fork-and-Diff: The ability to branch a run at any event into an independent fork, modify configurations, and structurally diff the result against the parent run without re-executing the shared prefix.
  • Packs: Bundles of object types, behaviors, and tools tailored for specific domains.

Who it’s for

Developers building complex, autonomous agents that require high levels of observability, deterministic replay, and the ability to perform hypothesis testing via forking and diffing.

Highlights

  • Event-Sourcing: Every change is an event, providing a complete audit trail.
  • Deterministic Replay: Runs can be re-executed from the event log with an LLM replay cache to reduce costs.
  • Resumable and Forkable: Any run can be branched at any point to test different paths.
  • Relation-Behaviors: A unique primitive for coordination logic on graph edges.
  • Flexible Persistence: Supports SQLite, Postgres, and FalkorDB as backends.
  • LLM Agnostic: Provides a unified LLMProvider protocol for swapping between providers like OpenAI and Anthropic.

Related

  • Project
  • Project
  • Project
  • Project
  • Project