Mental model
State is durable application data. Memory is a policy for creating, retrieving, updating, expiring, and presenting selected state to a model.
Theory
Working state supports the current task; episodic records capture prior interactions; semantic memory stores extracted facts; procedural memory represents stable instructions or workflows. Store authoritative facts in typed systems, not only transcripts. Each memory needs provenance, scope, consent, freshness, and deletion behavior.
Alternatives and trade-offs
Conversation replay is simple but noisy. Summaries compress history but can drift. Structured state is precise. Retrieval-based memory scales but requires relevance and deletion controls.
Failure modes and misconceptions
Do not equate a chat log with memory, persist sensitive inferences silently, accept model-written facts without validation, or allow stale memory to override current input.
Knowledge check
Why is memory a policy rather than merely a database table?
Decision scenario
A learning app stores explicit bookmarks and private notes locally, while inferred preferences remain temporary unless the learner chooses to retain them.
Learning outcomes
- Explain State and Memory as a system mechanism rather than a slogan.
- Compare its alternatives, trade-offs, and production failure modes.
- Apply the concept to a decision and identify evidence that would validate it.
Trade-offs
Using State and Memory can improve capability or control, but it also introduces cost, latency, complexity, and failure modes that must be measured against an explicit objective.