How Agents Persist Context
Agent memory is not a single database. Working memory holds the current turn, episodic memory records what happened across the session, and long-term memory keeps facts that survive restarts. Each stream has a different cost profile.
The replay graph in the video shows context slots being written, evicted, and rehydrated as a task progresses. Watching those writes is the fastest way to spot memory bloat or accidental overwrites.
Pro Tip: Pin Critical Facts
Use the pin API for facts your workflow must never lose, such as identity, budget, and deadlines. Pinned slots survive the eviction policies that would otherwise drop them under token pressure.
A Sample Memory Config
# memory.toml
[streams]
working = { ttl = "10m", max_slots = 8 }
episodic = { ttl = "24h", max_slots = 512 }
long_term = { ttl = "forever", max_slots = 10000 }
[pin]
ids = ["session-budget", "owner-identity"]