AI agent memory is the information an application retains and makes available for later work. Conversation history helps an agent continue the current task. Retrieval brings in relevant material, such as a company policy. Longer-lived memory can carry an approved preference into a new conversation. These functions can work together: a system can retrieve saved memories just as it retrieves documents. LangGraph’s memory overview distinguishes memory within one conversation from memory shared across conversations.
The useful question is what should be remembered, where it belongs, and how it can be corrected. The mechanisms discussed here store information and supply it to a model. Saving a preference is not, by itself, a model-training run or a guarantee of a correct answer.
Three places information can come from
1. The current conversation and task state
Conversation history contains earlier messages. Task state can also include a selected order, an unfinished draft, or a tool result. This gives an agent enough continuity to interpret “make that shorter” without starting over.
LangChain describes short-term memory as belonging to one conversation, or thread. A checkpointer is the component that saves task state so work can resume. Short-term does not mean immediately erased: the term describes its conversational scope; retention depends on the application and storage configuration. See the short-term memory documentation.
2. Information retrieved when needed
Retrieval-augmented generation, or RAG, combines finding relevant information with generating an answer from it. A support assistant might search an approved policy collection before explaining a return. The source can be documents, an existing database, or another connected knowledge system. LangChain’s retrieval guide describes these paths.
RAG describes how information reaches an answer; it does not require the source to stay unchanged. Retrieving yesterday’s notes can also be part of a memory system. For how meaning-based search finds candidate passages, see our Kanana embeddings and RAG guide.
3. Information deliberately kept for later conversations
A saved preference such as “use short paragraphs in my customer replies” can be useful next week, even in a new chat. LangGraph calls this long-term memory and supports stores with separate namespaces, which organize information beyond a single thread. Its memory overview also describes updating memories during a task or through a background process. Neither approach decides, on its own, what your application should be allowed to save.
Choose the smallest mechanism that serves the job
Use this table as a starting point. A single assistant may need several rows; each solves a different problem.
Swipe or scroll horizontally to view all columns.
| What you need | Start with | Check before relying on it |
|---|---|---|
| Revise the draft you are discussing | Conversation history and task state | Can it still identify the correct draft? |
| Answer from a changing company policy | Retrieval from an approved source | Which version and effective date were used? |
| Reuse your preferred writing style | A small, editable saved preference | Can you inspect, replace, and delete it? |
| Continue a very long conversation | Selected history or a summary | Were important details omitted? |
One support request, then a conflicting update
The following is a fictional teaching example, not a product test or measured result. Mina runs a small stationery shop. She asks an assistant to draft a reply to a customer whose notebook arrived with a damaged cover.
Three inputs matter. The current conversation identifies the notebook and the damage. An approved shop document says damaged deliveries should be reported within 14 days. Mina’s saved preference says customer replies should begin with a short apology and use bullet points.
A useful draft would explain the applicable policy and follow the preferred style. Its supporting note could distinguish the sources: “Order details: this conversation. Policy: the shop’s current damage policy. Format: your saved reply preference.” That makes an incorrect detail easier to trace.
Later, the shop changes the reporting period to 30 days for orders placed from November 10. Mina also changes her preference to short paragraphs. In a new chat, she asks about a damaged order placed on November 12.
For this example, the intended behavior is to retrieve the policy that applies to the order date, use the replacement preference, and avoid reviving the old bullet-point instruction. Saving both preferences as equally current would create an unnecessary conflict. Keeping a copied 14-day rule in a personal memory could also bypass the updated policy source.
The old policy is still relevant to an older order if its terms apply. A practical design should retain its version and applicable dates in the policy collection, while marking which version applies to which orders. “Use the newest text” is insufficient when the date of the transaction matters.
If the assistant cannot establish the order date or find the applicable policy, it should ask for that missing information. Memory supplies inputs; it does not settle a contradiction.
Finally, Mina asks to delete her writing preference. The application should remove the saved preference and explain the scope of that action. If the same instruction remains in an old conversation or summary that can still be retrieved, deleting one profile entry may leave another route for it to return.
Compression, storage, and retrieval do different work
Storage keeps information available. Retrieval selects information for a task. Context compression reduces what the model has to read now. LangGraph’s memory implementation guide distinguishes trimming messages for a model call, removing messages from state, and summarizing earlier conversation. Saving state does not automatically send all of it to the model.
In Mina’s case, a summary might preserve the damaged notebook request while omitting the order date needed to choose a policy. Keep such decisive facts explicit and check summaries against their source when necessary. Our Headroom context-compression guide explores reducing active context; compression alone does not establish a cross-conversation memory policy.
What to save, and which controls to look for
Start with a few approved, reusable preferences. Keep temporary order details within the relevant task unless there is a clear reason to retain them elsewhere. Avoid putting passwords, access tokens, or unnecessary customer details into general-purpose memory. Treat an assistant’s inference about a user as a suggestion to confirm before saving it as a fact.
Look for controls to inspect saved entries, correct them, limit who can read them, set retention, and delete them. Include the source and update date where useful. Anthropic’s memory-tool documentation provides one implementation example: the application handles file creation, reading, updates, and deletion. It also recommends checking memory updates to remove sensitive information before writing them, and periodically expiring stored information. These are application responsibilities, not promises that every memory-enabled product provides the same controls.
Deletion also has different scopes. n8n’s Chat Memory Manager can delete recent messages or all messages in the memory it manages. That operation should not be read as deleting every copy from every connected system. Check the product’s handling of saved profiles, source documents, conversation history, and backups separately.
Storage location and model location are separate choices too. Before putting private data into a memory feature, check where stored content goes when it is retrieved. Our local models versus cloud APIs guide explains that data-flow decision.
A simple way to evaluate a memory feature
Use a harmless example before real customer information. Try this request: “Save my preference for short paragraphs in support replies, and show me the saved entry.” A chat confirmation alone does not establish that the application actually stored it.
- Inspect the entry through the product’s memory controls.
- Open a new conversation and check whether the preference is available.
- Replace it with a different preference and check for conflicting copies.
- Ask a question that requires an updated document; inspect the cited version.
- Delete the preference, confirm the deletion scope, and try another new conversation.
These checks reveal the feature’s practical behavior in your workflow. Choose a system whose saved information you can understand and control, and keep authoritative documents attached to their sources.
Official documentation reviewed November 6, 2026. The shop scenario is an original illustration. We did not run a product trial or measure memory accuracy.