The AI Gazette

Agent memoryContext and memory

Salesforce precomputes customer context so its help agent needs one lookup

In a post dated 23 November, Salesforce engineers describe how Data 360 data graphs, prejoined per-customer JSON views fetched by key, serve context to the company's in-app Help Agent. Production lookups now take under 200 milliseconds at the median, and validation checks caught 2,765 tenants with missing or mismatched account IDs before release.

Consider a simple question to a support agent: what products does this customer own? Answering it exactly can mean walking through orders, order items, product codes, product hierarchies, provisioning status and effective dates. Calling source systems at runtime adds network hops and repeated identity matching. Warehouse joins resolve the relationships but leave heavy computation inside the conversation; one scoring workload over more than half a billion records took 7 to 30 seconds at the calling team's endpoint. Similarity search over documents, the usual retrieval approach, cannot reliably tell whether a specific entitlement is active. The post, by Akshay Sharma, describes a fourth approach.

The first lesson is to compute answers before the agent asks. One tenant had more than 1,000 product codes on record and more than 800 cancelled orders. Earlier, ad hoc services assembled entitlements on the fly while also handling sign-in and personalization, outside the company's usual data governance, so their answers were hard to verify. Salesforce moved the rules upstream: a calculated insight derives active, provisioned products, filters cancelled orders and normalizes names, and the tenant graph stores the results. The agent retrieves the answer instead of reconstructing the rules, and every entitlement can now be traced back to its orders.

Precomputing trades speed for freshness. The tenant graph refreshes hourly, so an upgrade made just before a support conversation can take up to an hour to appear, while customer-success scores refresh weekly or monthly. The team learned how much this matters when an upstream feed stopped updating for weeks. The graph kept returning well-formed responses, but the information was out of date. The post's advice is to set a freshness threshold for each source and monitor it next to lookup success, since a fast answer with outdated entitlements can do as much harm as a failed request.

The second lesson concerns shape. One huge graph returns more than the agent needs and slows retrieval, while many tiny graphs push the stitching back into the conversation. Salesforce grouped its graphs around recurring questions, namely the person and their role, the tenant's products and entitlements, and customer-success health, each keyed by an ID the caller already has. Large, slow-changing scores sit in their own graph so their rebuilds do not hold up faster context. Early lookups took about 400 milliseconds; production monitoring now shows a median under 200. The authors warn that their measurements come from different setups and are not one controlled experiment.

The third lesson is to enforce privacy in the architecture rather than the prompt. A consultant who opens cases for two customers is correctly recognized as one person, yet an agent serving one customer must never show the other's cases, and asking the model to ignore unauthorized records is not access control. Salesforce sets three boundaries: a data space that holds only the objects needed, agent access to specific graphs rather than the whole space, and an authorization service that decides which customers the signed-in user may select and supplies the permitted key. The agent never takes a customer identifier from the conversation text.

The fourth lesson is that more context is not better context. The case history holds about 13.5 million cases going back to 2009, and even 50 transcripts of about 2,000 tokens each would use roughly 100,000 tokens before the agent began to answer. The largest tenant's full score history ran past three million characters. So the graph carries the structured facts agents need most, such as current entitlements, product ownership, open-case counts and recent case status, while full transcripts stay searchable for questions that need them. Before adding a field to default context, the team asks whether the agent needs it routinely, whether it fits as a structured fact, and whether it changes the answer.

The fifth lesson is to automate deployment and validation from the first graph. Definitions and dependencies are packaged as data kits and promoted through development, testing, acceptance and production, with reusable checks on key counts, uniqueness, completeness and freshness. During acceptance testing of the scores graph, those checks found 2,765 tenants with missing or mismatched account IDs and ten tenants with scores but no tenant record. Automated sandbox recovery cut a process that once took days to about eight minutes. The wider effort shipped five major releases in six months, though the authors note it built on identity and serving pieces that already existed.

Next, the team wants a standard way for any group at the company to package, govern and serve context to its agents, rather than building each graph by hand. It is also exploring context packs that adapt to the questions agents actually ask and learn which context improves their answers. The closing argument applies well beyond Salesforce: the most useful context is the information someone has already done the engineering work to prepare, which is rarely the largest amount an agent could be given.

From other editions

Say hi.