activegraph
v1.0 · open sourceMIT · Python 3.11+

activegraph

Continuity for long-running agents.

BabyAGI made agent tasks persistent. activegraph makes the whole operating reality persistent — what the system believes, what it's doing, what depends on what, what's proven, what's stale, what was approved, and why.

A reactive, event-sourced graph runtime that gives long-running agents a shared world to act on, fork, diff, and explain.

From Yohei Nakajima, creator of BabyAGI (2023). activegraph is the architectural answer that years of agent infrastructure work kept pointing toward.

relation_behavior.py
from activegraph import Graph, Runtime, behavior, relation_behavior

graph = Graph()
runtime = Runtime(graph, budget={"max_events": 200, "max_seconds": 60})

# Behaviors react to events and write back to the graph.
@behavior(name="planner", on=["goal.created"])
def planner(event, graph, ctx):
    research = graph.add_object("task", {"title": "Research", "status": "open"})
    memo = graph.add_object("task", {"title": "Draft memo", "status": "blocked"})
    graph.add_relation(research.id, memo.id, "depends_on")

# Edges carry logic. This one knows how to unblock its target.
@relation_behavior(name="unblock", relation_type="depends_on", on=["task.completed"])
def unblock(relation, event, graph, ctx):
    if event.payload["task_id"] == relation.source:
        graph.patch_object(relation.target, {"status": "open"})

runtime.run_goal("Evaluate this idea")
runtime.print_trace()

# Fork the run at any historical event. The shared prefix
# replays from cache — no duplicate LLM calls.
fork = runtime.fork(at_event=4)
relation_behavior

The differentiated primitive. Coordination logic lives on the edge, where the meaning is — not duplicated across every node that might emit a relevant event.

runtime.fork(at_event=…)

Branches the run. The shared prefix replays from cache. Forks don't re-pay for LLM calls already made.

> Get launch updates

Launch notes and deep-dives on the active-graph model.

No spam. Unsubscribe anytime.

Where it fits in the agent stack

A new layer, not a competing framework.

Agent infrastructure has grown layer by layer. Each layer made the loop better. None of them give agents a world to act on.

That's the layer activegraph fills. Workflows model computation. activegraph models the world that computation acts on. Memory remembers conversations. activegraph holds beliefs, evidence, contradictions, decisions, and their lineage.

You bring the model and the loop. activegraph gives them state.

  1. Models
    Claude, GPT, LlamaThe reasoning substrate.
  2. Loops
    LangChain, OpenAI Agents SDKSequencing the model.
  3. Workflows
    Temporal, Inngest, DBOSDurable orchestration.
  4. Statethis layer
    activegraphContinuity of the world the agent acts on.
  5. Memory
    Letta, Mem0, ZepConversational recall.
  6. Agents
    Multi-agent frameworks, planners, evalsOrchestrating roles and goals.

What only activegraph does

Three primitives the loop doesn't give you.

01

Edges that coordinate.

A depends_on relation knows how to unblock its target. A contradicts relation knows how to trigger review. A derived_from relation knows how to mark downstream artifacts stale. Coordination logic lives where the meaning lives — on the edge, not duplicated across every node that might emit a relevant event.

02

Fork any run. Diff any outcome.

Branch a run at any historical event into an independent timeline. The shared prefix replays from cache, so the fork doesn't re-pay for LLM calls already made. Then structurally diff the result against the parent. “Try a different hypothesis from event 142” is a cheap operation, not a research project.

03

The trace is the deliverable.

Every object in the graph traces back to the event that created it, the behavior that emitted that event, the evidence behind it, the LLM call that informed it. For diligence, research, compliance, scientific work — anywhere the reasoning matters as much as the answer — the lineage IS the deliverable.

Try it now

The bundled Diligence pack runs against recorded fixtures.

No API key. No configuration. Byte-deterministic output. Watch a diligence run grow over 10 seconds: three companies. Claims, evidence, contradictions, risks, memos. Forkable. Inspectable. Replayable.

This isn't the framework's hello-world. It's the use case the architecture was designed for.

quickstart
$ pip install activegraph
activegraph quickstart

Ships with activegraph==1.0.0. No API key needed for the bundled fixtures.