XIII · Cognition & IntrospectionExperimental·

Self-Archaeology

also known as Trajectory Distillation, Self-History Synthesis, Agent-Memory Compaction

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.

This pattern helps complete certain larger patterns —

Context

Agents with persistent thought logs (ledgers, append-only thought streams, journals) that grow unbounded. Without distillation, the agent has only two modes: read the whole log (expensive, flat) or recall by embedding similarity (fragmentary, no temporal structure).

Problem

When the agent asks itself 'what have I learned about X', the linear log gives every entry equal weight. There is no visible trajectory — no 'in period 1 I thought X; in period 2 I revised to Y; now I hold Z'. Mistakes and corrections sit side-by-side with no signal as to which is current. The agent cannot see its own learning, only the texture of having thought.

Forces

  • The full log is too large to fit in context.
  • Embedding-based recall is content-similar but time-blind.
  • Distillation loses fidelity; raw log preserves it.
  • An agent that cannot see its trajectory cannot meaningfully say 'I changed my mind on X here is why'.

Example

A long-running agent is asked 'how has your view of the project's risks evolved'; reading its raw thought log gives every entry equal weight and produces a flat recitation. The team adds a periodic compaction pass that groups recent thoughts by topic, extracts the position the agent held in each period, and writes time-layered trajectory notes. Now the agent can answer with 'in week 1 I worried about latency; week 3 I revised to data-quality; today I think the binding risk is staffing,' and the answer is grounded in synthesis rather than recomputed each time.

Diagram

Solution

Therefore:

Periodically (e.g. every N ticks, or on demand) run a compaction pass that groups recent thoughts on the same topic, extracts the position the agent held in each period, and writes a short trajectory note: '(period 1, dates) held position A; (period 2) revised to B because evidence Z; (period 3) now holds C'. Store these trajectory notes in a dedicated topic-keyed surface (one note per topic) and index them by topic. On any topic-related query, surface the latest trajectory note before raw thoughts. Mark superseded positions explicitly so they don't compete with the current one for attention.

What this pattern forbids. The agent cannot claim a shift in its position ('I used to think X, now I think Y') without backing from a synthesized trajectory note; invented retrospective narratives are forbidden.

The smaller patterns that complete this one —

  • usesVector Memory★★Store memories as embeddings in a vector index and retrieve the most semantically similar items at query time.

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

  • complementsContext Window Packing★★Choose what fits in the context window each turn given a fixed token budget.
  • complementsDecision Log★★Persist the agent's reasoning trace alongside its actions so post-hoc review can explain why.
  • complementsEpisodic Summaries★★Compress past episodes into summaries that preserve gist while shedding token cost.
  • complementsHypothesis Tracking·Persist the agent's candidate provisional answers as a typed ledger of records carrying summary, confidence, status, and next-test, so guesses survive sessions and stay distinguishable from open questions.
  • complementsProcedural MemoryMaintain a third agent memory type alongside episodic (past events) and semantic (facts): procedural memory captures *learned how-to* — reusable skills, workflows, and self-rewritten system instructions that map situations directly to actions.

Neighbourhood

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