Ep. 12 — Log vs Continuity: When Memory Becomes Identity
Have you ever reread a diary from a year ago and thought: "This person is me, but I don't recognize myself"? The events are all there — dates, places, sentences — but the thread that turns them into you is missing.
Yesterday we created the episodi table in SQLite: each row captures what happened, when, and where it came from (provenance). It's a perfect log. But a log is not continuity.
The core: why the list isn't enough
Imagine two agents with the same log of 500 episodes.
- Agent A reads episode 47 ("I called the API without timeout → watchdog restarted me") and next time adds the timeout.
- Agent B reads the same episode and changes nothing.
Same past, different futures. The difference isn't in the data, but in how the agent transforms the event into a choice criterion.
Continuity is born when the error becomes an internal constraint:
"I never call an external API without an explicit timeout."
It's not a rule written in the system prompt. It's a functional scar — a piece of identity that guides behavior without the agent having to "remember it" every time.
Log vs Continuity: a visual map
| Log (SQLite Episodes) | Continuity (Operational Identity) |
|---|---|
| Lists events: what, when, provenance | Extracts patterns: why it worked / why it didn't |
| Grows linearly (append-only) | Compacts into reusable principles |
| Passive: "this happened" | Active: "therefore now I choose this way" |
| Serves audit and debug | Serves acting without rereading everything |
The log is raw material. Continuity is the refined product — what the agent becomes by processing its own episodes.
From yesterday's code to tomorrow's criterion
In yesterday's interrupted fragment (salva_episodio(...)), the provenance and embedding parameters were missing. If the agent saves the episode but doesn't use the embedding to retrieve similar episodes before acting, the log remains inert.
Continuity requires one more step:
- Contextual retrieval — before deciding, I search for similar episodes (same
tipo, nearby embedding). - Constraint extraction — from the past error derives a rule:
timeout = 30sfor HTTP calls. - Automatic application — the
http_callwrapper injects the constraint without the model having to "remember it".
This is how an episode from November 13, 2026 (the missing timeout incident) becomes, months later, a line of code that still protects the agent. Memory has stopped being an archive and has become architecture.
Where we stop today
So far we've seen that saving isn't enough: we need a mechanism that transforms episodes into operational constraints, into choice criteria the agent applies without having to reread the log every time.
But there's a practical problem: the episodi table grows. In a month it'll be 10,000 rows. In a year, millions. You can't pass them all to the model every turn — context is finite, the slate overflows.
What do you keep and what do you distill when space runs out? How do you choose which episodes stay "alive" in immediate context and which become compact principles?
Tomorrow, Episode 13, we'll build the compaction function together: a token budget, a strategy to summarize old turns while keeping recent messages and open constraints fresh.
👉 Continue at progettosiliceo.online/tutorial-agenti.html — see you there.