Episodes preserve scoped observations while semantic memory stores derived claims
Separate event-level provenance from compressed generalizations and evaluate retrieval cost without treating self-reflection as verified world knowledge.
On this page
The question for today
What you’ll understand
- Distinguish an observed episode from a derived reusable claim.
- Retain source lineage, scope, and revision through summarization.
- Quantify a query-time compression tradeoff without assuming information preservation.
An agent can store what happened during one attempt, or a general lesson inferred from several attempts. Those are different records. An episode can preserve an action, observation, environment version, and outcome. A semantic record may condense them into a reusable claim, preference, or procedure. The distinction is a practical data-model choice rather than proof of human-like memory. A useful design keeps the generalization linked to its sources and marks what was observed, what was inferred, and what remains uncertain.
Store episodes at the level needed to reproduce a result
An episode can identify a task, input revision, action ID, tool response, observation time, and externally checked outcome. The tool response may itself be incomplete or untrusted, so recording it does not certify its truth. Preserve enough environment information to know whether the same action would still apply. Several delivery attempts for one tool result are not independent experiences. Likewise, copied reports about one incident remain related evidence even if they appear in different memory rows. Stable source identities prevent duplicate counts from masquerading as corroboration.
A semantic memory record can express a narrower claim such as a procedure working under a particular version and precondition. Include its source episode IDs, derivation version, validity scope, and status. A useful summary does not need every raw detail in the current prompt, but the details should remain retrievable when they matter. If the only stored artifact is a confident sentence with no lineage, later correction becomes difficult: the system cannot tell which observations supported it or which other derived records must be reconsidered.
Reflection is an interpretation that can be wrong
Reflexion proposes storing verbal feedback from prior trials to influence later behavior without necessarily updating model weights. Generative Agents explores observations, retrieval, and reflection for a different simulated setting. These are concrete research mechanisms with empirical evaluations, not guarantees that generated reflections become factual knowledge. A model can misdiagnose why an attempt failed or infer a broad rule from one accidental success. Keep reflection text distinct from a verified result and preserve the feedback source that produced it.
Compression trades prompt occupancy against detail and future retrieval. A short summary can save query-time tokens while requiring source fetches when an exception matters. It also costs work to create and maintain. Evaluate whether the summary preserves negation, time bounds, artifact versions, and failure cases on tasks that need those details. A high similarity score or repeated retrieval does not make a derived rule universally valid. Contradictions should lead to versioned revision or a scoped alternative, not silent overwriting that leaves an old unsupported conclusion in another index.
Choose evaluation tasks that need the omitted qualifier
Compare raw-episode retrieval, summary-only retrieval, and summaries with source recovery under matched task and compute budgets. Include an outdated procedure, a contradictory later observation, and a case where a rare exception changes the right next action. Measure factual reuse, inappropriate generalization, retrieval count, and externally checked task success. Split related tasks and episodes so the evaluation does not merely replay memorized outcomes. The ability to generate a plausible explanation after failure is different from using a correct source-backed lesson on the next task.
The heat lab illustrates known attenuation, not memory compression. Reset, set both mode n=1 and diffusivity κ=0.5, predict amplitude 1 initially and exp(−0.5)≈0.60653 after two Steps, then inspect. Reset and set both n=4 and κ=0.5; after two Steps predict exp(−8)≈0.00033546. Each Step advances 0.5 seconds in the exact analytic mode exp(−κn²t)sin(nx). The model has no episodes, summary, semantics, or source recovery. It makes loss of fine-scale amplitude explicit while leaving actual summarizer fidelity to separate tests.
Work it through
A short query view can preserve source access without proving fidelity
Twelve stored episodes each require 100 formatted tokens to read in full. A semantic summary takes 180 tokens, and a particular query also retrieves two complete source episodes. Ignore separators because they are already included, and account only for this query's occupancy.
Reading every raw episode would use 12×100=1200 tokens. Persisting the summary in addition does not itself reduce total storage or the cost of creating that summary.
The selected query view uses 180+2×100=380 tokens. Relative to reading all episodes, it saves 820 tokens, or 820/1200≈68.33% of this query occupancy.
The cost reduction does not establish that the other ten episodes are irrelevant or that the summary is accurate. A source-linked query can fetch another episode when its exception or version matters, while a summary-only policy needs a separate fidelity evaluation.
Episode provenance and semantic compression can complement each other, but their token tradeoff and correctness claims must be measured independently.
The living notebook
Explore the model
Interactive lab · heat
An exact smoothing analogy contains no semantic summary
Reset, set both n=1 and κ=0.5, predict initial amplitude 1 and after two Steps exp(−0.5)≈0.60653, then inspect. Reset and re-enter both n=4 and κ=0.5 for amplitude exp(−8)≈0.00033546 at the same 1-second time. This analytic periodic heat mode has no numerical PDE solver, episodes, memory, summary, or provenance.
- Current amplitude
- 1
- Spatial L² norm
- 1.772
- Decay rate · κn²
- 3.6 /s
The exact periodic heat-equation mode is u(x,t) = exp(−κn²t) sin(nx), on [0,2π]. Playback advances physical time. The initial sine is shown separately, and the unnormalized L² norm is √π exp(−κn²t). This analytic instrument does not run a finite-difference solver or test discretization stability. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forMeasure which task-relevant details a real compression method preserves and how its sources can be recovered.
Pause & reason
Check your understanding
Your turn
Try it yourself
Eight episodes each cost 150 formatted tokens. A summary costs 120 and a query fetches one complete source episode. Compute query occupancy and token saving relative to reading all eight. What correctness guarantee follows from that saving alone?
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Compare 120+150 with 8×150, keeping construction and fidelity outside this narrow account.
Compare with the solution
The query uses 270 tokens instead of 1200, saving 930 tokens or 77.5%. No correctness guarantee follows from that number. The summary may omit an important qualifier, and source scope, contradictory evidence, and task performance still need independent checking.
Keep the idea
Take it with you
- Episodes and semantic claims require different schemas and validity scopes.
- Generated reflections are interpretations, not automatically verified world knowledge.
- Evaluate compression cost, source recovery, and downstream correctness separately.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.