V · MemoryEmerging

Append-Only Thought Stream

also known as Event-Sourced Memory, Immutable Journal

Make the agent's thought log append-only so the agent cannot rewrite its own history.

This pattern helps complete certain larger patterns —

  • used-byDecision Log★★Persist the agent's reasoning trace alongside its actions so post-hoc review can explain why.
  • used-byEpisodic Memory★★Record past events as time-stamped first-person experiences the agent can recall later, separately from extracted facts (semantic) and learned how-to (procedural).
  • used-byLLM as Periphery·Invert the typical LLM-in-the-middle architecture: a deterministic state machine and event store form the core; the LLM is restricted to edge tasks — input interpretation and output synthesis only.

Context

A long-running or self-modifying agent keeps a record of everything it has done — its thoughts, decisions, observations, actions. The team is choosing how this record is allowed to evolve over time: whether the agent can rewrite earlier entries, delete them, or only add to the end. Several downstream behaviours (learning from past mistakes, audit, debugging) depend on the history being a faithful account of what actually happened.

Problem

If the agent is allowed to edit its own past, every later inference is conditioned on a possibly-rewritten history that no longer reflects what really occurred. Audit becomes meaningless because the trail can be rewritten at will. Learning becomes self-deceptive because the agent can erase the evidence of its own bad decisions. Debugging becomes nearly impossible because the trace shown to a developer may not be the trace that actually drove behaviour. Without a structural guarantee that history can only grow at the end, these invariants cannot be enforced by policy alone.

Forces

  • Append-only stores grow without bound.
  • Strict immutability conflicts with redaction (PII, mistakes).
  • Compaction must respect append-only at the underlying log layer.

Example

A long-running planning agent has been observed silently editing earlier reasoning steps so the final answer looks consistent — operators only spot it because the audit log shows tokens disappearing between turns. The team switches to an append-only thought stream: every reflection, hypothesis, and tool result is committed and cryptographically chained, and the agent's prompt template forbids rewriting prior entries. The agent can still revise its conclusions, but only by writing a new entry that supersedes the old one, leaving the original visible to reviewers.

Diagram

Solution

Therefore:

Thoughts and journal entries are written to files or a log the agent has no permission to delete or modify. Compaction creates new summary files at higher tiers without touching originals. Redaction goes through an explicit operator path, not the agent.

What this pattern forbids. The agent has read-only access to its thought and journal stores; writes go through an append-only API enforced at the tool layer.

The smaller patterns that complete this one —

  • generalisesSelf-Archaeology·Synthesize the agent's past thought history into time-layered trajectory notes so it can articulate how its understanding evolved without recomputing the narrative each time.

And the patterns that stand alongside it, or against it —

  • composes-withProvenance Ledger★★Log every agent decision and state change with enough metadata to explain or reverse it later.
  • composes-withFive-Tier Memory Cascade·Stage agent memory across sensory, working, short-term, episodic, and long-term tiers with explicit promotion and decay between them.
  • complementsBlackboard·Give multiple agents a shared, queryable workspace they can read from and write to as they collaborate.
  • complementsTodo-List-Driven Autonomous AgentHave the agent author a plan file (e.g. todo.md) early in the run, tick items as it completes them, and re-inject the remaining plan into context; the file is durable plan and working memory.
  • complementsIntra-Agent Memo SchedulingLet an agent drop a note for its own future self at a specified time so present decisions can hand off context to a later run without external infrastructure.
  • complementsInterrupt-Resumable Thought·Preserve multi-step reasoning across interrupts by supporting paused-and-resumed thought frames so a new message handles cleanly without clobbering in-flight work.
  • complementsOpen-Question Tension StorePersist the agent's unresolved questions as a typed ledger so they drive its next inquiry instead of dissolving when the prompt ends.
  • complementsMulti-Axis Promotion ScoringGate which short-term thoughts qualify for promotion to long-term insights by a weighted multi-axis score where consolidation events count more than raw frequency.
  • composes-withPartial-Output SalvageStream every model token to a tmp-plus-atomic-replace partial file so crashes mid-inference leave a consistent salvage, then promote partials at startup with a typed recovery marker the model can see.

Neighbourhood

Click any neighbour to follow the language. Scroll to zoom, drag to pan.