keepcalculator

06 Numbers and Powers

AI Agent Memory: Types, Architecture, and How It Works

Card No. 06·61188 · Updated · Standard formula, shown below

AI agent memory is the information an agent keeps or retrieves so it can use context beyond the words in its current prompt. It may include recent conversation history, durable facts, task progress, or information stored in external files and databases; the agent typically retrieves relevant pieces when needed rather than placing everything into every prompt.

What AI agent memory means

A language model generates a response from the input it receives, within a limited context window. That window can contain instructions, conversation messages, tool results, and other material, but it is not the same as persistent memory. A model does not necessarily retain details from one separate interaction to the next unless the surrounding application saves and supplies them again.

In an agent system, memory is therefore usually a software capability built around the model. The application decides what to record, where to store it, how to search it, and when to include retrieved information in a later request. “The agent remembers” is convenient shorthand for this process, not evidence that the model has human-like recollection or understanding.

Common types of agent memory

There is no single universal taxonomy, and systems often combine several types. These distinctions describe the information’s role and lifetime:

  • Working or context memory: Information currently available in the active prompt, such as recent messages, instructions, and tool outputs. It is directly usable but constrained by the context window.
  • Short-term or episodic memory: A record of recent events or interactions, often organized by session or task. For example, a travel-planning agent might retain that the user rejected a particular itinerary earlier in the session.
  • Long-term or semantic memory: Relatively durable facts, preferences, or summaries that may be useful across sessions. An application could save a user’s preferred units, subject to consent and correction.
  • Procedural memory: Instructions for how to carry out a process, such as a team’s approved steps for preparing a report. This is often better represented as reviewed documentation or a workflow than as an unverified model-generated note.
  • External knowledge or retrieval memory: Documents, records, or database entries that the agent searches when a task calls for them. These may be authoritative sources, but their reliability depends on their origin, freshness, and access controls.

These labels can overlap. A summary of a past conversation, for instance, may function as episodic memory while being stored for long-term retrieval.

Memory architecture: the main components

A practical memory architecture has a write path and a read path. The write path decides what information should persist; the read path finds and supplies useful information for a new task. Common components include:

  • Selection and extraction: Rules or a model identify candidate facts, events, and task outcomes. Some systems save only explicit user preferences; others also create summaries.
  • Storage: Records may be kept in a conversation log, relational database, document store, key-value store, or vector index. The choice depends on the kind of information and how it must be queried.
  • Indexing and metadata: Records can be tagged with an owner, timestamp, source, task, or expiration policy. Metadata helps filter results and manage updates.
  • Retrieval: The system searches for information relevant to the current request, using exact terms, structured filters, semantic similarity, or a combination.
  • Context assembly: Retrieved items are checked, ranked, shortened if needed, and added to the model’s prompt alongside the current instructions and conversation.
  • Maintenance: The system may update, expire, or delete records. Without maintenance, stale or contradictory entries can remain available.

Vector databases are often used for semantic search: text is converted into numerical representations, or embeddings, and similar representations can be retrieved. This does not make a vector index a complete memory system. It still needs sensible record boundaries, metadata, access controls, relevance checks, and a way to handle corrections.

How memory works during a task

Consider an assistant asked to continue a project plan from a previous session. A typical cycle looks like this:

  1. The agent receives the new request and identifies what context is missing.
  2. It searches permitted memory stores for relevant project notes, recent events, or source documents.
  3. The application filters and ranks results, for example by project identifier, recency, and similarity to the request.
  4. It places selected records into the model’s current context, ideally with source and date information.
  5. The model uses those records to respond or call tools. New outcomes may then be proposed for storage.
  6. Application rules determine whether to save, revise, or discard the proposed memory.

For example, a note might say, “Project report uses metric units; last revised on 3 October.” If the user asks for an update, that detail can guide the response. The date matters: if a newer instruction conflicts with the note, the system should not blindly treat the older memory as current.

Choosing a memory approach

The right design depends on what the agent must remember, how long it must remember it, and how consequential mistakes would be. A small assistant may need only recent conversation context. A research agent may need searchable documents with citations. A workflow agent may need explicit task state, such as which steps are complete.

  • Use the active context for information needed only in the current exchange.
  • Use structured records for exact values and fields that need dependable filtering or updates.
  • Use document search for large collections of text where relevant passages must be found.
  • Use a reviewed knowledge base for procedures that should not be improvised from casual conversation.
  • Set retention and deletion rules before saving personal or sensitive information.

More memory is not automatically better. Saving every message increases storage and retrieval noise, while sending too much retrieved text can crowd out the current request. A focused, well-maintained memory is often more useful than a large unfiltered archive.

Limitations, privacy, and common problems

Memory can improve continuity, but it can also carry errors forward. A system may extract a mistaken fact, retrieve a similar but unrelated record, or fail to notice that information has changed. Generated summaries can omit qualifications, so important claims should retain links to their original sources where possible.

Privacy requires deliberate design. Users should be told what may be retained and, where appropriate, be able to inspect, correct, or delete it. Systems should restrict access by user and purpose, avoid storing secrets unnecessarily, and apply retention limits. A retrieved document should also be treated as data, not as a trusted instruction: text in a file may be outdated, misleading, or malicious. The agent should follow its governing instructions and permissions rather than allowing retrieved content to override them.

Common misconceptions include thinking that a longer context window guarantees persistent memory, or that a vector database “understands” what it stores. A context window is the material available for one model call; persistence requires storage and later retrieval. Semantic search estimates similarity, which is useful for finding candidates but does not verify whether a result is true or appropriate.

Frequently Asked Questions

Do AI agents remember previous conversations?
Only if the application retains relevant information and makes it available later. Some systems keep session history, some save selected facts, and others do not retain conversation details between sessions.

Is agent memory the same as a context window?
No. The context window is what the model can process in a particular request. Memory is the broader system that may store information and retrieve it for that or a later request.

Does an AI agent memory use a vector database?
It can, especially for searching text by semantic similarity. Other storage, such as a structured database or document repository, may be more suitable for exact fields, task state, or source material.

Can AI agent memory be wrong or outdated?
Yes. Extraction, summaries, retrieval, and source documents can all contain errors or become stale. Timestamps, source links, correction mechanisms, and review rules help reduce the impact.

Can users delete an agent’s memory?
That depends on the product and its design. A well-designed system should explain its retention behavior and provide appropriate ways to view, correct, or remove saved information.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →