# Active Graph Agent Runtime (BabyAGI 4)

Yohei Nakajima, Untapped Capital | AI Engineer World's Fair 2026 | 17:34

Source: https://www.youtube.com/watch?v=khVX_BUnEwU
Channel: AI Engineer (https://www.youtube.com/@aiDotEngineer). Summarised by AIE Talks.
Page: https://aietalks.com/talks/active-graph-agent-runtime-babyagi-4
Published: 2026-07-22
Tags: agents, evals, memory, reliability

## TL;DR
- ActiveGraph makes an immutable typed event log the source of truth for an agent, allowing state replays, rollbacks, and forks.
- Behaviors react to graph changes, while policies control which changes an agent can make without approval or testing.
- Self-improvement works through proposed patches, sandbox checks, and measured evaluation, so failed changes remain available as experience.

## Summary
Yohei Nakajima presents ActiveGraph, an experimental open-source runtime for building agents around an immutable event log rather than around an LLM session. Every agent action and change becomes a typed event. The log projects the agent's graph state, which enables replays, rollbacks, forks, and clearer debugging. Behaviors watch graph changes and emit new events, while policies decide which changes can happen automatically and which need tests, contradiction checks, or a human. Nakajima connects this design to blackboard systems and Kafka, with independent workers communicating through shared state. He describes memory retrieval from the structured log, an API-key failure that resumed a 500-question evaluation near where it stopped, and reference coding and research agents built on the runtime. He then shows self-modification loops and ActiveGraph Lab, which runs approved experiments and fixed a bug in its own code. His closing hypothesis is that agents need an experiential world model built from their own history.

## Key ideas
### ActiveGraph makes the event log the agent's source of truth
[01:53](https://www.youtube.com/watch?v=khVX_BUnEwU&t=113s)
Nakajima contrasts the usual LLM-centered design with ActiveGraph's log-centered runtime. In a conventional system, the LLM, response API, tools, memory, and logging are assembled separately. ActiveGraph flattens both what the agent does and how the agent changes into one immutable event log. That log projects the graph that represents the current agent state. A prompt can be edited multiple times while a master prompt remains available for queries. Because every change is recorded, the runtime provides replays, rollbacks, and forks without adding those features later.

### Behaviors turn graph changes into agent activity
[03:04](https://www.youtube.com/watch?v=khVX_BUnEwU&t=184s)
Behaviors monitor graph changes and emit events that update the agent's state, potentially triggering other behaviors. A planner can react to a newly created goal by adding research and writing tasks, while a relation behavior can unblock memo writing after research finishes. Subscriptions can use graph queries, such as detecting when a new claim contradicts another claim and triggering a contradiction detector. Views provide another way to manage context: a behavior queries a relevant subset of the graph instead of receiving the whole state.

### Policies decide which changes require control
[06:03](https://www.youtube.com/watch?v=khVX_BUnEwU&t=363s)
Policies define what the agent may modify by itself. Adding a source article might be allowed automatically, while changing a prompt could require a human. A new fact might need a check for contradictions. Other changes can require a proposed patch and tests before approval. This gives the runtime a place to express limits on self-modification. Nakajima describes policies, behaviors, schemas, tools, and LLM behaviors as modular pieces that can be assembled into packs and combined into larger agents.

### Independent workers communicate through shared graph state
[07:23](https://www.youtube.com/watch?v=khVX_BUnEwU&t=443s)
ActiveGraph replaces the familiar while-not-done loop and message-passing model with many behaviors that monitor shared state. Nakajima connects the design to blackboard architectures from the 1970s and 1980s, and to Kafka's micro-workers communicating through shared state. Earlier blackboard systems were difficult to write because workers were slim and deterministic. He argues that LLMs change this tradeoff because they can write the code and give workers reasoning ability. He also shows that a ReAct-style agent can be rebuilt on top of ActiveGraph.

### The structured log can provide memory and recovery
[08:12](https://www.youtube.com/watch?v=khVX_BUnEwU&t=492s)
Nakajima tested the log as memory on LongMemEval. He embedded the query, searched for relevant messages, retrieved nearby messages based on their order in the log, and fit the result into context. The approach did not use semantic ingestion, fact extraction, or entity extraction, though he later tried semantic ingestion as a separate improvement. During a 500-question run, his API key failed around question 350. After updating the key, ActiveGraph rolled back one step and resumed around question 353 instead of restarting the long evaluation.

### Reference agents inherit graphs and logs automatically
[09:52](https://www.youtube.com/watch?v=khVX_BUnEwU&t=592s)
Nakajima asked Replit to build a coding agent on ActiveGraph and then asked for a deep research agent. Both produced an event-log graph as part of the result. The research agent showed where evidence came from and which items contradicted each other. He says frameworks such as LangSmith can provide similar logging, but he did not have to separately design the event log or graph. He also describes packs for tools, secrets, memory, identity, communication, and chat. Each pack bundles object types and behaviors, so packs can be swapped or attached together.

### Self-modification is accepted only after tests and measured improvement
[11:11](https://www.youtube.com/watch?v=khVX_BUnEwU&t=671s)
In the Regimes project, the agent classified failures and limited each failure type to specific parts of the agent it could edit. The loop evaluated questions, proposed a self-change, ran static and sandbox checks, and accepted the patch only when the result improved. Across repeated loops, some proposed patches were rejected. Nakajima reports modest, statistically significant gains on LongMemEval and says the system also learned which changes did not work. The event log preserves those failed attempts instead of losing them after an unsuccessful run.

### ActiveGraph Lab can run approved experiments and repair its code
[12:26](https://www.youtube.com/watch?v=khVX_BUnEwU&t=746s)
ActiveGraph Lab reads Nakajima's blog posts and GitHub repositories, proposes experiments, asks him for permission to run them, and writes a blog post about the results. In one case, it found an error in its own code, asked to fix it, wrote a pull request, and Nakajima merged it. The lab also installed an ActiveGraph pack into itself and concluded that packs were modular across repositories. Nakajima presents this as early work rather than a finished autonomous research system.

### An experiential world model would give an agent identity from its history
[15:35](https://www.youtube.com/watch?v=khVX_BUnEwU&t=935s)
Nakajima ends by proposing that long-running agents need an experiential world model alongside a predictive world model. He compares the event log to the hippocampus, which stores immutable state and feeds experience back into priors through replay, dreaming, and sleep. His view is that an agent's identity may come from its beliefs, knowledge, and behaviors derived from its own log, rather than from reasoning capability alone. He also argues that better models may not make the runtime disappear, because the agent still needs a record of its experience.

## Notable quotes
- "ActiveGraph is an event-sourced graph runtime for building auditable agents." (01:53)
- "I'm saying let's flatten that down into a single immutable event log, and this is the ground truth of the agent." (02:33)
- "LLMs don't talk to each other in ActiveGraph. They all communicate through this shared state." (03:04)
- "And it just like rolled back one and was like, "All right, we'll just start from, you know, question number 353."" (09:20)
- "I'm starting to really think that long-running agents need not just a world model and like a predictive world model, but what I might call an experiential world model." (15:35)

## Tools & references mentioned
- ActiveGraph
- BabyAGI
- Untapped Capital
- BabyAGI Wiki
- Instagraph
- Mindgraph
- LongMemEval
- Kafka
- Replit
- LangSmith
- Regimes
- ActiveGraph Lab
- Kaggle
- Claude Code

## Who should watch
- You are building long-running agents and need runs to resume after failures instead of starting over.
- Your agent changes prompts, tools, or knowledge over time and you need approval rules, replays, and rollback points.
- You are exploring self-improving agents and want a concrete pattern for proposing, testing, and accepting changes.
