Agent memory is not a feature. It is a data modelling problem with a lifecycle.
Definition
Memory engineering is the practice of designing how agents store, retrieve, expire, and act on information across interactions. It is what makes agents personal and smart. Combined with context engineering, it determines the ceiling of agent usefulness.
Mental Model
Think of agent memory like a database with TTLs, not a notebook.
Every memory has:
- Schema: what shape is this memory? (user preference, task context, learned fact)
- Scope: who does it apply to? (user-level, session-level, global)
- TTL: when does it expire or get demoted? (session end, 7 days, never)
- Retrieval path: how does the agent find it at inference time? (embedding lookup, key match, recency sort)
A notebook grows forever and becomes useless. A well-modelled memory system stays relevant because stale data expires and retrieval is intentional.
Core Insight: Memory Has a Lifecycle
Memories are not permanent. They follow a lifecycle:
Create → Store → Retrieve → Validate → Expire/Promote
- Short-lived (session TTL): current task context, scratch state
- Medium-lived (days/weeks TTL): recent preferences, project context
- Long-lived (no TTL): stable user preferences, verified facts
Without TTL, memory systems accumulate noise. The agent starts hallucinating from outdated context. Designing the expiry policy is as important as designing the storage.
The Equation
Agent intelligence = Model capability + Context engineering + Memory engineering
Context engineering gets the right information into the prompt window. Memory engineering decides what information exists to pull from in the first place. Without memory, every conversation starts cold. Without context engineering, memories never reach the model. You need both.
Design Checklist
When building agent memory:
- Define your memory types (preferences, facts, task state, relationships)
- Assign TTLs per type (what expires, what persists)
- Choose storage (vector DB, key-value, graph, hybrid)
- Design retrieval (how does the right memory surface at the right time)
- Plan for conflicts (what happens when memories contradict each other)
- Build update/invalidation paths (corrections must propagate)
Gotchas
- Treating memory as append-only. Without expiry, you poison your own context.
- Over-indexing on vector search alone. Hybrid retrieval (keyword + semantic) covers more cases.
- Ignoring the data modelling step. Jumping to “store embeddings” without defining schema, scope, and TTL leads to a system that retrieves noise.
- Confusing memory with RAG. RAG retrieves from a static corpus. Memory is dynamic, user-specific, and mutable.
Related Concepts
Sources
- Personal notes from Agentic Engineering session, 2026

