AI Engineer World's Fair 2026
Active Graph Agent Runtime (BabyAGI 4)
Loading slides…
Read the talk
Active Graph Agent Runtime (BabyAGI 4)
An immutable event log can record both what an agent does and how it changes, giving shared-state workers a foundation for memory, recovery and controlled self-modification.
From a talk by Yohei Nakajima
Before you start: Familiarity with LLM tools, agent loops and basic Python is helpful; graph runtimes and event sourcing are explained as they appear.
Why do long-running agents still break?
Long-running agents break. And if agents are becoming capable enough to build software, why must a developer keep rebuilding the agents themselves? For Yohei Nakajima, that question leads to a concrete research goal: build the simplest system that can build itself. ActiveGraph is his experimental answer—an architecture intended to make an agent’s actions and subsequent modifications inspectable.
The search began with BabyAGI, which Nakajima created in March 2023. Its public reception ran ahead of its practical capabilities; in his assessment, the original system did not work. He describes nine iterations, usually exploring some form of self-improvement. Graphs kept returning: first in Instagraph and Mindgraph for retrieval, then in representations of code, functions and logs. Alongside those experiments, he invested in agent companies through Untapped Capital and an agent fund. ActiveGraph brings that recurring graph structure into an event-sourced runtime for auditable agents.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The log projects the agent’s state
The architectural starting point, developed in The Log is the Agent, reverses a familiar construction process. Usually, an agent begins with an LLM, a response API, tools and memory; logging is then added around those components. That arrangement can provide the same kinds of observability and control, provided someone assembles them deliberately. ActiveGraph instead starts with the log.
The crucial addition is a record of changes to the agent, alongside the record of its work. An agent’s execution history and its development history often live in different systems. ActiveGraph puts both into one immutable event history and projects that history into a graph representing current state. A prompt might have been edited several times, for example: the log retains those changes, while a graph query retrieves the effective prompt.
Attach behaviors to that graph, and the state becomes active. A graph change triggers a behavior; the behavior emits events; those events update the graph; the updated graph may trigger another behavior. The workers can be deterministic functions or include LLM calls. They coordinate through shared state rather than talking directly to one another. The resulting typed history records both the work performed and the changes that shaped how the work was performed.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Policies govern changes; events carry them
Not every change should have the same permission requirements. Policies determine how the graph may change:
| Change | Possible policy |
|---|---|
| Add a source article | Allow automatically |
| Edit a prompt | Require human approval |
| Change a fact | Check for contradictory facts |
These are different controls over the same mutation path, rather than separate mechanisms for ordinary work and agent modification.
The typed, immutable history supports replay, rollback and forks. ActiveGraph is therefore a runtime, not a prescribed agent harness: familiar harnesses can be rebuilt on top of it, provided their components communicate through shared state. Logs become the central unit to inspect, taking the place messages often occupy in an LLM-centered design.
The mutation rule is strict: query the graph, but do not edit its state directly. Emit an event instead. Even an operation that looks like adding an object must produce an event so that the graph’s new state remains derivable from its history. Otherwise, the graph could contain changes that replay cannot reconstruct.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
From a goal to research and a memo
Consider a goal that requires research followed by a written memo. A planner subscribes to goal creation and emits additions for two task objects—research and memo writing—and a relationship between them. The dependency itself can carry a relation behavior: once research finishes, an unblock behavior makes the memo task available. Coordination lives in the relationship and the state transitions, rather than in a direct call from one worker to another.
A small Python example makes that event flow concrete. Here, project reconstructs task state from events, and the relation behavior returns another event instead of mutating the memo task. The event names and records below are local teaching definitions, not ActiveGraph API calls.
python
from copy import deepcopy
def project(events):
tasks = {}
for event in events:
if event["kind"] == "add":
tasks[event["id"]] = deepcopy(event["value"])
elif event["kind"] == "update":
tasks[event["id"]].update(event["changes"])
return tasks
def unblock_relation(tasks, dependency):
source = tasks[dependency["from"]]
target = tasks[dependency["to"]]
if source["status"] == "done" and target["status"] == "blocked":
return [{
"kind": "update",
"id": dependency["to"],
"changes": {"status": "ready"},
}]
return []
log = [
{"kind": "add", "id": "research",
"value": {"title": "Research", "status": "ready"}},
{"kind": "add", "id": "memo",
"value": {"title": "Write memo", "status": "blocked"}},
]
dependency = {"from": "research", "to": "memo"}
log.append({"kind": "update", "id": "research",
"changes": {"status": "done"}})
state = project(log)
log.extend(unblock_relation(state, dependency))
state = project(log)
The final projection makes the memo ready while retaining the completed research task and both task titles. The history still contains the transition that caused the unblock.
Subscriptions can express more than an object type. A contradiction detector can subscribe to the creation of a claim only when that claim contradicts another claim in the graph. More elaborate conditions can incorporate confidence values. Views apply a related idea to context: a graph query selects the subset of state available to a behavior. That gives context management a programmatic boundary without preventing the use of other context-selection techniques.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Approval gates and composable packs
For protected state, an intended modification first becomes a proposed patch. Policy determines whether it needs tests, human approval or both before it can change the graph. The proposal and the applied change are different states: an agent can formulate a modification without already having permission to enact it.
A pack bundles object schemas, tools, deterministic behaviors, LLM behaviors and a pack policy. Combining packs builds a harness from both structural definitions and execution rules. This is broader than adding a skill: the module defines what objects exist, what responds to them and how changes are governed. Nakajima finds the composition unintuitive to write by hand, but reports that AI coding tools handle it well.
In the version described in the talk, event types are fixed and object types are user-defined. The current runtime documentation also permits custom application event strings alongside framework events, so that particular restriction should be read as part of the demonstrated version.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Use the log as memory—and as a recovery point
The first experiment asks whether the log itself can serve as memory. The retrieval method combines embeddings with the order already present in the log. On LongMemEval, the basic procedure is:
- Embed the logged messages and the incoming query.
- Retrieve messages relevant to the query.
- Include neighboring messages before and after each match.
- Fit the selected material into the available context and answer.
The initial experiment uses no semantic ingestion, fact extraction or entity extraction. It preserves conversational surroundings by using the log’s structure, rather than relying only on isolated vector matches.
The completed retrieval slide displays an 85.6% LongMemEval result. That is a displayed result, not a fully specified benchmark comparison: the talk does not establish the dataset revision, context budget or full evaluation configuration. The architectural attraction is that memory and logs already contain much of the same information; using one store avoids letting those overlapping records drift apart.
Nakajima subsequently tried semantic ingestion and reports that it improved the score, but moved on before pursuing further optimization. The more memorable operational result came during an interrupted evaluation.
In Nakajima’s account, a 500-question run lost API access around question 350; after he replaced the key, it rolled back one step and resumed around question 353. Completed work did not have to restart from the beginning. This is his reported experience of recovery during a long run, rather than a guarantee about every external tool or side effect an agent might invoke.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Coding, research and interchangeable capabilities
With the runtime in place, Nakajima asked Replit to build a coding agent on top of it. The result exposed an event log and a graph without a separate request to design those records. He explicitly acknowledges that tools such as LangSmith can provide comparable observability; his point is that the runtime made the records part of the construction process. A subsequent research agent similarly represented evidence provenance and contradictions in its graph.
To move toward broader assistants such as OpenClaw or Hermes, he assembled ActiveGraph Packs: core, tool, secret, memory, identity, communication and chat packs. Each contributes object types and behaviors. A memory pack can be replaced with another memory pack because the module includes the objects and rules that implement that capability, rather than only instructions telling an LLM how to use it.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Self-modification needs an acceptance test
Regimes moves from recording agent changes to controlling how those changes are proposed. A failure classifier identifies what went wrong, and that classification determines which part of the agent may be edited. The repair process therefore has a constrained target instead of permission to rewrite anything.
Nakajima recalls diagnosing failures on roughly 20 LongMemEval questions and testing a modification on 50 different questions. The published implementation specifies 50 optimization questions and 100 disjoint confirmation questions; those documented conditions should not be conflated with the exploratory loop recalled on stage. The common mechanism is to separate examples used to motivate a repair from examples used to judge it.
The proposed change follows a gated path:
- Fork the agent and propose a patch to an allowed component.
- Run a static gate check.
- Run a sandbox gate check.
- Evaluate the candidate’s effect on answers.
- Promote it only if it satisfies the acceptance policy.
The talk describes the last step as accepting only accuracy improvements. The paper’s default gate permits zero held-out accuracy change, so its documented rule is non-regression rather than strictly positive improvement. The paper also discusses over-promotion; passing a gate does not establish guaranteed cumulative progress.
Nakajima reports runs with eight or thirteen loops that accepted only four or five patches. He describes the gains as modest and statistically significant. The published evidence is narrower: significance was reported in two of five LongMemEval-S splits, with one result unadjusted for sequential promotion and pooled results treated as descriptive because the splits share a question pool. That supports a bounded experiment, not a general claim that this runtime improves every agent.
The history retains more than the promoted version. It also records proposals that failed the checks or failed to help. Rejected modifications become usable experimental memory, so a later attempt can inspect what was already tried instead of repeatedly rediscovering the same unsuccessful repair.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A lab that researches its own runtime
The next step is ActiveGraph Lab, a research agent that reads the project’s blog posts and repositories, develops ideas and asks Nakajima whether it may run the experiments. After approval, it runs an experiment and writes a blog post about the result. The human authorization boundary remains explicit.
Nakajima reports that the lab found an error in its own code, requested permission to fix it and wrote a pull request that he merged. It also installed a pack from another repository into itself and documented the discovery that packs were modular across repositories. These are early examples of extending and repairing the system, with approval and merging still part of the process.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A deck change becomes an experiment
A Pokémon trading card game competition on Kaggle supplied a different test. The submission consists of a deck and a deterministic agent, with no LLM reasoning during matches. Nakajima describes hourly matches against new competitors that move an Elo-style score up or down. The LLM-assisted work happens outside that match runtime, while developing and evaluating candidate changes.
Using Claude Code and Replit, Nakajima reports about 80 experimental passes. A seemingly casual request—add a couple of energy cards—became a proposal to test rather than an immediate accepted edit. The example evaluation proposed 200 simulated games against three reference agents, with acceptance conditioned on win-rate improvement and a Wilson-score criterion. He does not give precise acceptance thresholds, so the example establishes the structure of the gate rather than a reproducible statistical rule.
Each pass produced a report explaining the change, its result and the verdict. Nakajima estimates that 20–30 of roughly 80 proposals were accepted, with gradual score improvement. He also mentions a figure around 27%, but does not define it well enough to identify it as a win rate or leaderboard position.
The distinctive benefit was the agent’s awareness of unsuccessful experiments. An unstructured sequence of edits can end with something that works while losing the reasons earlier attempts failed. Here, the explicit acceptance policy requires an evaluation before promotion, preserving both the successful candidates and the rejected ones. That history gives the next experiment a better starting point.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Debugging moves into the database
Across these projects, Nakajima’s personal impression is that AI coding tools are effective at designing workers that communicate through shared state. His explanation is a hypothesis: blackboard systems and Kafka have decades of architectural discussion behind them, potentially supplying more training examples than the much newer practice of building LLM agents. That is an explanation for his experience, not a measured comparison of coding performance.
A more concrete workflow change was where debugging happened. His coding agent began querying the ActiveGraph database instead of searching session logs, because the records were already cleanly typed and their structure was known. Cross-repository pack loading, recovery without restarting a long run, and access to failed experiments were other recurring benefits. Together, they made the agent’s own history part of the working development interface.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
An agent needs experience as well as reasoning
The closing proposal goes beyond the runtime mechanics. With an explicit caveat that model training is not his expertise, Nakajima suggests that long-running agents need an experiential world model alongside a predictive one. A predictive model supplies priors; an experiential model retains what this particular agent has encountered and done. He compares that relationship to the hippocampus, replay, dreaming and sleep, imagining recorded experience feeding back into priors. This is a speculative analogy, not an established account of how biological memory works.
That distinction challenges the expectation that better models will make harnesses disappear. Better reasoning does not itself supply the history of a particular agent’s decisions, failures and revisions. Nakajima’s emerging hypothesis is that both are needed. People are not defined only by reasoning capability; beliefs, knowledge and behaviors also emerge from experience. An agent designed along similar lines could derive its identity from its own log.
His proposed way to explore the idea is practical: ask an existing coding agent that knows your preferences to look up ActiveGraph, build something you would find useful, and explain whether the runtime helped. The test is whether a useful implementation benefits from having its actions and evolution recorded in the same place.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
From the talk
Runtime source, architecture overview and a recorded-fixture quickstart requiring no API key.
The architectural argument for event logs, graph projections, replay, branching and causal lineage.
Official benchmark, datasets and evaluation instructions for long-term conversational memory.
Composable assistant capabilities, example bundles and a graph inspector.
Controlled agent modification through diagnosis, constrained repairs and held-out evaluation gates.
Improvement-loop implementation, split definitions, recorded outcomes and reproduction instructions.
Research-agent project for developing ActiveGraph's evidence base.
Further reading
Evaluation harness comparing retrieval and graph-memory approaches under a shared reader and judge.
Pokémon TCG experiment tooling and a deterministic competition agent without live LLM calls.
Full transcript
Loading transcript…