Memory and context
Context is the information available for the current inference; memory is persisted state that may shape later runs. Reliable systems separate conversation history, durable facts, user preferences, project policy, and derived summaries so each can be governed and refreshed appropriately.
Questions to answer
Resolve these before adding tools, frameworks, or automation.
- What belongs in immediate context, session history, durable memory, or project instructions?
- Who can inspect, correct, expire, or delete remembered information?
- How will retrieval quality and compaction loss be measured?
Implementation lifecycle
Build the evidence in this order
- 01
Classify
Separate transient context, conversation state, durable memory, and authoritative policy.
- 02
Persist
Use stable identities, scoped storage, retention limits, and correction mechanisms.
- 03
Evaluate
Test retrieval precision, stale-memory behavior, privacy, and compaction loss.
Artifacts to maintain
- session store
- memory schema
- retention policy
- compaction strategy
Continue through AgentAtlas
Evidence ledger
Primary documentation behind this guide
OpenAI
Sessions
Session memory, storage choices, history limits, compaction, resumption, and operational persistence patterns.
Anthropic
Effective context engineering for AI agents
Treating context as a finite resource and curating instructions, tools, external data, history, and summaries across long-running agents.
Next topic
Context engineering