Why it matters
Memoryless agents feel dumb — they forget everything the moment a session ends. Memory unlocks personalization and continuous improvement. Getting it right is what makes agents feel intelligent over time.
The architecture
MemoryService: pluggable backend for memory storage. Semantic memory (vector DB for retrieval), episodic memory (event log), custom implementations.
Semantic memory: agent stores facts as embeddings; retrieval by semantic similarity when relevant to current turn.
How it works end to end
Storage: when agent learns something worth remembering (user preference, prior conversation summary), store to memory service.
Retrieval: at start of each turn, query memory for facts relevant to current input. Inject retrieved facts into agent context.
Curation: not everything belongs in memory. Design what triggers a memory write; prune stale or wrong memories.