Skip to content
be-human.ai
← Back to the journal

Context & memory

Entity IDs for AI Agent Memory: Stop Duplicate Records Early

Learn how stable IDs for customers, jobs and assets stop AI agent memory from splitting into conflicting records, with a step-by-step plan and matching rules.

Be Human typographic cover with the title: Entity IDs for AI Agent Memory: Stop Duplicate Records Early
Conceptual illustration created with AI · Be Human

Entity IDs for AI agent memory are stable identifiers assigned once to each customer, job or asset, so every note, document and message about that thing attaches to the same record. Without them, an agent that sees the same customer spelled three ways across three conversations writes three memories that drift apart and eventually contradict each other. Assigning and enforcing IDs is the most direct way to stop that split before it reaches an answer a staff member acts on.

Key takeaways

  • Give every customer, job and asset one stable ID that the agent reads from a system of record and never invents on its own.
  • Match new mentions to existing IDs through explicit rules, and send doubtful matches to a person instead of guessing.
  • Store the ID with every fact, so a correction updates one record instead of creating a second one that still says the old thing.
  • Treat creating or merging IDs as a permissioned action with a named owner, not a side effect of a conversation.
  • Test for duplicates on purpose before you trust the memory in daily operations.

Why do split records make an agent contradict itself?

Agent memory is written in many small moments. Each time a message, call note or uploaded document is saved, something has to decide which existing record it belongs to. If that decision relies only on text, the same customer can appear as a company name in one note, a contact person in another and a shortened brand in a third. Each variant becomes its own record with its own history.

The contradiction usually shows up later. A customer asks whether a repair is booked, the agent retrieves the older record, and it confirms a date that was changed in a newer record it never linked. From the outside this looks like the model being unreliable. In most cases the model did its job correctly, and the failure is an identity problem: two records describe one thing, and nothing told the system they were the same. Better retrieval ranking helps only when the right record exists to rank, which is why identity comes first. The deeper pattern is covered in Superintelligent Memory Deduplication: One Fact, One Owned Record.

How do you decide what gets an ID and who owns it?

Not every noun needs an identifier. Give an ID to a thing when a fact about it must be tracked over time and when a person would ask which one is meant. In most operations that means customers, jobs or projects, physical assets such as equipment or vehicles, and sometimes contracts or suppliers. Notes about a meeting room or a general policy usually do not need one.

Ownership matters as much as the list. The ID should come from the system that already governs the thing: the CRM account number, the job number in the field service tool, the asset tag in the maintenance register. The agent references that identifier. It does not coin a new one. When a team that owns the system of record changes an identifier, that change is logged and communicated, and the agent's memory follows it through a defined path.

A short plan for setting this up:

  • List the entity types the agent will touch in its first role, and name the system of record for each.
  • Pick one canonical identifier per entity type and confirm it is stable, unique and never reused.
  • Store known aliases, such as trading names, old job references and abbreviations, as attributes of the record, not as new records.
  • Define which role may create a new ID, which may attach a fact to an existing ID, and which may merge two IDs.
  • Write the matching rules before the first import, so the import does not set precedent.
  • Log every creation, attachment and merge with the time, the source and the person or process responsible.
  • Schedule a recurring review of suspected duplicates, owned by a named person.

The last two steps are where most teams underinvest. A duplicate that nobody reviews keeps getting used.

How does matching work without guessing?

The rule is simple to state. Exact identifiers beat names, and names beat nothing. If a message carries a customer's account number or a job reference, the agent links to that record directly. If it carries only a name, the agent should treat the name as a weak signal and look for corroborating fields such as address, registration number, contact email or the asset serial. When two or more strong fields agree, the link can be made. When the only evidence is a similar name, the agent should stop and ask for confirmation or place the item in a review queue.

This is where the write rules matter. An agent may attach a fact to an existing ID when the match is strong. It may propose a new ID when no candidate exists. It should not create a new ID when a close candidate is present, because that is exactly how duplicates are born. The gate that decides who saves a fact is explained in Memory Write Gates for Superintelligent Agents: Who Saves a Fact. Entity structure itself, including which attributes belong on a customer versus a job, is covered in Entity Memory Schema for AI Agents: Customers, Jobs and Assets.

The idea that an identifier should be created only once, even when a request is retried, is well established in payment and integration APIs. Stripe's documentation on idempotent requests describes the same principle for write operations: a repeated request should not produce a second object. The same discipline applies to memory writes, where a retried import or a duplicated chat event should resolve to the existing ID rather than generate a new one.

A record that cannot be matched confidently should wait in review, not be guessed into place.

What does a split look like in practice?

Illustrative scenario: A field service company uses an agent to answer questions about open repairs. A customer writes in using a street address and a partial job reference. The agent finds two candidate jobs at that address, one opened last spring and one opened this week, and both mention the same boiler. Without an ID rule, the agent would summarize whichever record ranked higher. With the rule in place, the agent sees that the partial reference matches only the newer job, links the message to that ID, and states that the older job is closed. If the partial reference had matched both, the agent would have asked the customer for a second detail rather than merging anything.

Stability over time needs its own rules. IDs should never be reused, even after a customer leaves or an asset is scrapped. When two records are merged, the retired ID should remain resolvable so that old documents still point somewhere sensible. When a name changes, the name becomes an alias and the ID stays. Every merge should be reversible through a snapshot or a change log, so a wrong merge can be undone without rebuilding the memory from scratch.

How Be Human handles this in managed operations

In a Be Human engagement, the first step is to name the entity types the agent needs, identify the system of record for each and agree on the identifier that will be canonical. Permissions are defined so that the agent can attach facts to existing IDs but cannot create or merge them without a rule or a person approving the change. Monitoring tracks suspected duplicates and contradictions between records, and recurring evaluations test whether matching still behaves as intended after integrations or data sources change. Permission review keeps the list of roles that can merge records current as staff and systems change. None of this removes the need for human judgment on hard cases, but it makes the cases visible and the decisions traceable.

How do you test for duplicates before production?

Build a small set of known cases before the agent handles live traffic. Include the variants you already know about: the customer written with and without a legal suffix, an asset referred to by its old tag, a job mentioned by a reference that was later reissued, and a name with a common typo. For each case, write the expected outcome: the same ID, a new ID, or a review item. Run the set after every change to the matching rules, the data import or the underlying model. The approach to building these checks is described in Memory Test Cases for Superintelligent Agents: Recall and Forgetting.

A useful habit is to review a sample of merges and non-merges each month. If the agent is linking too eagerly, you will see wrong facts attached to the wrong record. If it is linking too rarely, you will see the same customer accumulating separate histories. Both failures are fixable once they are measured, and neither is fixable if nobody looks.

Where should a team start?

Start with one entity type that causes the most confusion in daily work, usually customers or jobs, and one role that uses it. Write down its system of record, its canonical ID and its matching rules before you connect anything. Then run the test set, review the first month of decisions and tighten the rules where they failed. A team that does this on one entity type usually finds the next three are easier. If you are not sure which task should go to an agent first, the free Be Human AI diagnostic can help you find the first task worth handing over.

Frequently asked questions

What is an entity ID in AI agent memory? An entity ID is a stable identifier for one real-world thing, such as a customer, a job or an asset, that every fact about it is attached to. The agent references the ID rather than the name, so updates and corrections land on the same record. The identifier should come from the system that already governs the thing, not from the agent.

Can an agent create its own IDs for new customers? It can propose one when no close match exists, but creation should follow a rule and be logged. Letting an agent create IDs freely is the most common way duplicates appear, because a slightly different name in a new conversation looks like a new customer. Restrict creation to a defined role and review the proposals regularly.

What should happen when the agent cannot tell whether two records are the same? It should not pick one. The safer behavior is to ask for a second identifying detail, such as an address, a serial number or a registration field, or to place the item in a review queue for a named person. A delayed answer is almost always better than a confident answer attached to the wrong record.

Do I need a special database to keep entity IDs stable? Not necessarily. Stable IDs are mainly a matter of rules, ownership and logging, and they can be enforced with the systems you already run. Storage matters less than discipline: a canonical identifier, documented matching rules, permissions for merges and a way to test that the rules still hold after changes.

Your next step

See where an AI agent fits in your company first.

Take the free Be Human AI diagnostic. A few questions about your work show which task to hand to an agent first, what it needs to know and where a person approves.

Be Human editorial guidance. Examples are illustrative unless explicitly attributed. Sources provide background; implementation choices depend on your workflow.

Less busywork. More room for you.

Bring us the work you wish you had time for.

Book a call to try a personalized AI agent free for 7 days ↗Or take the free AI diagnostic →