EasyDeepLearn

How is 'memory' typically implemented in agents?

medium

Answer

  • (1) Short-term: full conversation in the context window (up to model's context limit).
  • (2) Summarized memory: periodically summarize old turns to compress.
  • (3) Long-term / episodic: store past traces + facts in a vector DB, retrieve relevant ones per new query (RAG-over-memory).
  • (4) Structured memory: extract entities/facts into a database (name, address, preferences) and query it.
  • (5) Reflection memory: agent writes 'lessons learned' after each task and retrieves them next time.
  • Modern frameworks (LangGraph, LlamaIndex, Mem0) provide these primitives.
Check yourself — multiple choice
  • Only context window
  • Short (in-context) + summarized + long-term (vector DB) + structured (DB) + reflection — layered memory
  • Only file storage
  • Impossible

Agent memory: layered — context / summarized / long-term / structured / reflection.

#agents

Practise LLMs & GenAI

214 interview questions in this topic.

Related questions