Book a 30-min callBook a call

AI agent memory: short-term context, long-term stores and what to forget

How AI agent memory works: context windows, rolling summaries, retrieval by relevance, recency and importance, write policies, MemGPT, privacy and evaluation.

A conversation strip feeding a small context-window box, a filter funnel above a long-term store of dot clusters, and a dashed arrow to a bin for forgotten items.
Written by
BYD Tech
Published
Topic
Deep dives
Reading time
15 min read

Questions people ask

Is a bigger context window a substitute for memory?

Only partly. A long window lets you resend more history, but every token is billed and processed on every call, history still runs out eventually, and research such as "Lost in the Middle" reports that models use information in the middle of long contexts less reliably. Long-term memory picks the few facts that matter and puts them where the model will use them.

Do I need a vector database for agent memory?

Not always. A small profile of user facts can live in an ordinary table and go into every prompt. Embeddings and vector search start to pay off when the number of memories grows past what you would send each time and you need to find the relevant few by meaning.

How does an agent forget something?

By deleting it from every place it was stored: the record, its embedding, any summary or reflection built from it and cached copies. Time-based forgetting works through TTLs on time-bound facts and through decay that lowers the weight of memories nobody retrieves.

Should the model decide what to remember?

It can, through memory tools, as in MemGPT, Letta or Anthropic’s memory tool, and that suits agents keeping notes on their own work. For facts about users, a fixed extraction pipeline with deduplication, contradiction handling and provenance is more predictable and easier to audit.

Building something like this?