Glossary

Entity memory

Entity memory organises an AI agent’s memory around the people, companies, products and projects a conversation is about, keeping a record of facts for each entity.

Entity memory is a way of organising an AI agent’s memory around the things a conversation is about: people, companies, products, projects, places and accounts. Instead of storing conversation turns in order, the agent keeps a record for each entity and adds facts to it as they come up, so that when “Acme” or “Priya” is mentioned again, everything known about that entity can be retrieved at once. The idea was popularised by LangChain’s ConversationEntityMemory, which used a model to spot entities in each message and keep a short running summary for each one. Modern memory systems apply the same principle more broadly, linking entities to each other and tracking how their attributes change over time.

Why organise memory by entity

Conversations jump between subjects, but questions are usually about one of them. A sales rep asks about a single account; a support agent needs the history of one order; a research assistant is asked what is known about one compound. When memory is stored as a timeline, answering those questions means searching the whole history for scattered mentions. When it is stored by entity, the relevant facts are already gathered in one place.

Entity memory also gives the agent a stable reference point when the same thing is mentioned in different ways. Once “the Berlin office”, “our EMEA hub” and “Alexanderplatz” are known to be the same entity, a fact learned under one name helps answer a question asked under another. That step, deciding which mentions refer to which entity, is entity resolution, and it is the part of entity memory that most often goes wrong. What is entity resolution in agent memory? covers it in depth.

How entity memory works

Most implementations follow the same four steps for each new message or document.

Detect entities. A model or a named entity recognition step identifies the entities mentioned: “Priya”, “the Q3 renewal”, “Acme Ltd”.

Resolve them. Each mention is matched to an existing entity record or creates a new one. “Priya” in this conversation is matched to Priya Shah, the customer’s head of procurement, and not to a different Priya at another account.

Update the record. New facts about the entity are added, and facts that change replace older ones. If the message says the renewal has moved from September to October, the renewal entity’s date is updated, ideally keeping the old value as history.

Retrieve by entity. When a later message mentions an entity, its record is loaded into the prompt, along with records for closely related entities when they are relevant.

Resolution usually weighs several signals together: the name and its variants, the surrounding context (which company, which project), attributes already known (an email address or account number settles most cases), and recency, since a “Priya” mentioned in a conversation about Acme is far more likely to be the Acme contact than someone from last year. When the evidence is weak, the safer choice is to keep a separate record and merge later, because a wrong merge is much harder to undo than a missed one.

The resulting records can be stored in several ways, each with different strengths.

Storage approach

What an entity record looks like

Strengths

Weaknesses

Summary per entity

A short paragraph that is rewritten as facts arrive

Simple, compact, easy to put in a prompt

Loses specifics with each rewrite, like conversation summary memory

Attribute table

Typed fields such as role, company, renewal date

Precise, easy to validate and query

Rigid; facts that do not fit a field get lost

Facts linked to entities

Individual memories tagged with the entities they mention

Keeps every fact retrievable on its own

Needs good retrieval and consolidation

Graph

Entities as nodes, relationships as typed edges

Captures how entities relate, supports multi-step questions

More work to build, maintain and query

Entity memory and knowledge graphs

Entity memory and a knowledge graph overlap heavily. A graph stores entities and the relationships between them, such as “Priya Shah works at Acme” or “Acme owns licence 4471”, and entity memory can be built on one. The graph form helps when questions depend on relationships: “who else at Acme has been involved in the renewal?” requires following edges from the account to people to events. Adding time to those edges gives a temporal knowledge graph, which can answer “who owned this account in March?” as well as “who owns it now?”.

Graphs are usually stored in a graph database as a property graph or as subject, predicate and object triples in a triple store. An ontology defines which entity and relationship types exist, which keeps extraction consistent: without one, the same relationship can end up recorded as “works at”, “employed by” and “is at”. Knowledge graph vs ontology and vector database vs knowledge graph explain where each structure fits, and what is a knowledge graph gives a broader introduction.

Not every entity memory needs a full graph. Many products do well with facts linked to entities and a few relationship types, and add graph traversal only for the questions that need it.

Where entity memory fits among memory types

Entity memory is mostly semantic memory: general facts about things, detached from when they were learned. Events involving an entity, such as “Priya approved the quote on 2 November”, are episodic memory attached to that entity. A user profile is a special case of entity memory where the entity is the user, and conversational memory describes the wider set of patterns, from conversation buffer memory at one end to structured long-term stores at the other.

Retrieval for entity memory combines two signals. Mentioning an entity by name should reliably bring back its record, which favours exact and keyword matching. Questions that describe an entity without naming it (“the client who complained about invoicing”) need semantic search. Hybrid search handles both, and metadata filtering narrows results to the entities in scope.

Common failure modes

Over-merging. Two different entities with similar names are treated as one, so facts about one contaminate the other. Two contacts called John at different companies are the classic case. Over-merging is the more damaging error, because the agent will confidently state facts that belong to someone else.

Fragmentation. The opposite problem: one entity is split across several records because its mentions were never linked. Facts are stored but not found together, and the agent behaves as if it knows less than it does.

Stale attributes. An entity’s role, status or owner changes, but the old value is never retired. The agent then mixes old and new facts. Contradiction resolution addresses this by letting newer facts supersede older ones.

Unbounded records. Busy entities accumulate hundreds of facts, many of them duplicates. Memory consolidation merges them so that loading an entity’s record stays affordable.

Cross-tenant leakage. In multi-customer products, an entity such as a shared supplier may appear for several customers. Entity records must stay inside each customer’s boundary, which is a question of memory isolation.

A worked example

A sales copilot listens to calls and reads emails for an account team. Over two months it builds entity records for the account (Acme Ltd: 320 seats, renewal due 31 October, uses SSO), three contacts (Priya Shah, head of procurement, prefers written proposals; Tom Ellis, IT lead, raised a security questionnaire; Dana Ruiz, executive sponsor, joined in week six) and one open deal (expansion to 450 seats, pricing objection raised by Priya on 2 November).

Before the next call, the rep asks: “What do I need to know before speaking to Priya?”. The copilot resolves “Priya” to Priya Shah at Acme, loads her record, follows the links to the account and the open deal, and returns a brief: her role, her preference for written proposals, the pricing objection she raised and the renewal date. When Tom later mentions that procurement has moved to a new head, the copilot updates the account’s procurement contact and marks Priya’s role as past, so the next brief does not send the rep to the wrong person. The same structure underpins legal agents tracking parties and matters, and research agents tracking compounds, authors and findings. The sales memory copilot example shows a build of this kind, and sales copilots that remember every call discusses the product side.

Where Exabase fits

Exabase provides memory infrastructure that handles entity-centred memory without you building the extraction and resolution pipeline; the agent’s behaviour and any domain schema stay with you. Exabase Memory runs on the M-1 engine, which extracts facts, preferences and events from conversations and builds a dynamic ontology of concepts and relationships. Entity resolution and memory drift are handled when memories are written, so a user who moves from Toronto to Berlin ends up with one current city, and related facts are consolidated over time. Retrieval combines semantic and keyword search with recency bias, so naming an entity and describing it both work.

Memories are added through the memories endpoint, and the about memories guide explains how memories self-organise under concepts. Each customer’s entities can be kept in their own Base, and the agent memory solution describes the overall approach. For comparisons with entity and graph-focused systems, see Exabase vs Zep, Exabase vs Graphiti and best knowledge graphs for AI agents.

Frequently asked questions

What is entity memory in AI agents?

It is a way of organising an agent’s memory around entities such as people, companies, products and projects, so that everything known about an entity can be retrieved when it is mentioned.

How is entity memory different from conversation buffer memory?

Buffer memory stores the conversation in order and resends it. Entity memory extracts facts and files them under the entities they concern, so they can be retrieved across long conversations and across sessions.

What is the difference between entity memory and entity resolution?

Entity memory is the store of facts about entities. Entity resolution is the step that decides which mentions refer to the same entity, so facts land in the right record.

Does entity memory need a knowledge graph?

No. Many systems link facts to entities without a full graph. A graph helps when questions depend on relationships between entities or on how those relationships changed over time.

What goes wrong with entity memory?

The common problems are merging different entities that share a name, splitting one entity across several records, keeping outdated attributes and letting records grow without consolidation.

Is ConversationEntityMemory still used in LangChain?

LangChain has deprecated its legacy memory classes, and entity-style memory is now usually built with a dedicated memory layer or with LangGraph persistence plus custom extraction.

Can Exabase handle entity memory?

Yes. Exabase Memory extracts facts and builds an ontology of concepts and relationships, with entity resolution and contradiction handling applied when memories are written.

Related pages: Entity resolution, Knowledge graph, Temporal knowledge graph, User profile, Conversational memory, Context graph, What is entity resolution in agent memory?, Sales copilots, Agent memory solution, Exabase vs Cognee, User modeling, CRM enrichment

Cut your token spend and give your agent precise context.

Get started in minutes.

Cut your token spend and give your agent precise context.

Get started in minutes.