Why Logs Should Be the Agent Itself, Not Just a Byproduct
The article analyzes Yohei Nakajima’s "The Log is the Agent" paper, showing how ActiveGraph unifies goals, rules, tool calls, LLM responses, and artifacts into a single append‑only event log, enabling deterministic replay, cheap forking, and full provenance for LLM‑driven agents.
Yohei Nakajima recently published the paper "The Log is the Agent". The core idea—treating the log as the agent itself rather than a by‑product—feels natural yet had not been applied before.
State is scattered across six places, nobody manages their relationships
In conventional agent architectures, goals live in the prompt, rules in code or system messages, tool calls in internal state, reasoning traces in transcripts, artifacts in databases, and a compressed "memory" in a vector index. These pieces are isolated, making it hard to answer questions such as why a fact appears in the agent’s work set, what the agent believed before a rule change, or what would happen if a different branch were taken.
ActiveGraph puts everything into a single log
ActiveGraph stores goals, rule changes, tool calls, LLM responses, and produced objects as events in one append‑only log. Each event carries an id, type, payload, producer, optional caused_by pointer, and timestamp. The paper shows a real run log that starts from pack loading, goal creation, behavior start, to object creation, with each object containing a provenance block that records which behavior and event created it.
Behavior is driven by graph subscriptions, not orchestration code
Behaviors declare subscriptions; when matching changes appear on the graph, the runtime triggers the corresponding execution unit. Four behavior forms exist: ordinary functions, classes, LLM‑driven routines, and relation‑behaviors attached to typed edges. The paper explains why a graph is needed beyond a flat event stream—topological predicates like "a statement that answered an unanswered question" cannot be expressed without graph patterns. Relations let computation attach to edges between objects, while the log ensures state reproducibility.
Comparison table
Traditional agent loops cannot deterministically reconstruct state, fully replay history, fork at arbitrary points, or produce structured diffs. Memory‑layer systems such as MemGPT, Zep, and Mem0 provide cross‑session persistence but only partial provenance and no replay/fork capabilities. ActiveGraph checks all seven dimensions.
671 events, no orchestration code
The due‑diligence demo generated 671 events, 93 objects, 76 relations, 103 model calls, and 48 tool calls—all without a single line of orchestration code. A planner behavior created a company entity, a question‑generator asked research questions, and a researcher fetched information. Coordination emerged from event‑matching subscriptions; each coordination decision itself is an event, enabling uniform replay, forking, and inspection.
Determinism is a property of log replay, not an Agent promise
LLM calls are inherently nondeterministic. ActiveGraph does not claim to eliminate this; it records the first execution’s response and, on replay, uses a content‑hash cache to return the recorded response. Two replay modes exist: relaxed (cache fallback) and strict (event‑by‑event comparison that throws a divergence error at the first mismatch). A strict replay that passes proves the run is reproducible.
To guarantee replay reliability, behavior authors must obey a determinism contract: no direct reads of randomness, system clock, new UUIDs, external I/O, or mutable global state. Violations are caught dynamically during replay, not at write time. LLM behaviors are exempt on first execution because their responses are recorded for later deterministic replay.
Forking is cheap: first 149 steps free
Because replay and the determinism contract share the prefix log, branching at any event copies the parent log up to the split point, then proceeds with an independent suffix. The shared prefix incurs no additional model or tool calls. In a 200‑step run forked at step 150, the first 149 steps—including all model calls—are free. Event IDs are shared, making lineage verification trivial. Most agent frameworks cannot fork because state cannot be rebuilt; those that can usually must re‑execute the prefix, paying again for each model call.
Provenance matters more than the memo itself
The demo emphasizes lineage: a statement like "Northwind Q3 revenue grew 28% to $42 M" carries a provenance block linking it to the behavior, triggering event, and the specific model request that produced it. Typed relationships connect the statement to the question, source document, and supporting evidence. The entire run can be executed offline without an API key, completing in thirty seconds and yielding byte‑identical logs on repeated runs.
An old idea revived by LLMs
The paper acknowledges its intellectual roots: event sourcing and CQRS from data systems, incremental reactive computation from data‑flow and spreadsheet engines, and the blackboard architecture of the 1970s‑80s, where independent knowledge sources read and wrote a shared structure. Those older systems lacked scale because knowledge sources and control logic were hand‑written. LLMs now supply the knowledge sources and control logic, making the blackboard approach viable for modern agents.
Unsolved problems the paper admits
Potential runaway loops or deadlocks are mitigated only by budget caps, not static guarantees. Replay cost grows linearly with log length; currently millions of events require full replay with no checkpointing or compression. External tools with side effects are only recorded, not replayed. Concurrency and multi‑agent contention on the shared graph remain open. The determinism contract is enforced only at replay time. The paper provides no large‑scale performance evaluation.
Future direction: self‑improving agents
Because rules and behaviors are part of the log, self‑modification becomes a logged event. One can replay the pre‑modification run, fork at the modification point, apply the change, run to completion, and perform a structured diff against the parent branch—costing near zero thanks to shared prefix caching.
The authors conclude: treating an append‑only event log as the agent itself yields deterministic replay of model‑involved computation, cost‑free counterfactual forking, and full provenance from goal to output—properties essential for long‑running agents that must be explainable, reproducible, and correctable.
Open‑source implementation is Apache‑2.0 licensed. Install with pip install activegraph and run activegraph quickstart to execute the demo without an API key.
Paper: https://arxiv.org/abs/2605.21997<br/>Repository: https://github.com/yoheinakajima/activegraph<br/>Docs: https://docs.activegraph.ai
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
AI Engineering
Focused on cutting‑edge product and technology information and practical experience sharing in the AI field (large models, MLOps/LLMOps, AI application development, AI infrastructure).
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
