Your AI agent needs to identify what a customer owns, determine which services they are entitled to, and retrieve only the records they’re authorized to see. Now imagine doing all that while keeping production customer-context lookups below 200 milliseconds at the median.
That is the AI context engineering challenge: delivering exact answers from fragmented enterprise systems without making customers wait while an agent reconstructs complex relationships. In a separate customer-success analytics workload, we also managed more than half a billion signal-level records spanning nearly two million tenants. How do you deliver exact, authorized customer context quickly when the underlying data is this complex?
Our team discovered that giving agents more data was not the answer. We needed to resolve relationships, apply business rules, and enforce access before questions arrived.
Our solution was to build Data 360 data graphs that deliver trusted customer context to Salesforce’s in-app Help Agent through a single lookup. By moving complex data preparation out of the conversational critical path, we made context retrieval faster, more consistent, and easier to govern.
Here are five lessons from that effort to help you engineer reliable AI agent context without repeatedly reconstructing enterprise data.
Why traditional data retrieval falls short for AI agents
Consider a straightforward customer question: “What products does this customer own?” Answering accurately may require traversing orders, order items, SKUs, product hierarchies, provisioning status, and effective dates. Your agent cannot anticipate every question, but it still needs to deliver exact answers quickly.
Traditional approaches create tradeoffs. Runtime calls to source systems introduce network hops and repeated identity matching. Warehouse joins can resolve relationships, but they leave expensive computation on the conversational critical path. In one customer success, a scoring workload covering more than half a billion records and roughly 16 months of history took 7 to 30 seconds at the calling team’s endpoint using zero-copy warehouse views. Retrieval-augmented generation (RAG) works well for unstructured documents, but similarity search cannot reliably establish whether a specific entitlement is active.
We took a different approach: a Data 360 data graph, which provides a prejoined, per-customer JSON view built ahead of time and retrieved by key through the Data Graph API. Rather than requiring every agent to reconstruct the same relationships, we made those relationships part of the data product.
That decision addressed the immediate retrieval problem, but it also raised new engineering questions: What should we precompute? How should we organize the results? Who should have access? And how could we keep the information trustworthy over time?

Identity resolution, calculated insights, and joins prepare customer context before retrieval. Data spaces and graph-level access limit what agents can retrieve.
1. Precompute customer context before your AI agent asks
Start with an entitlement question: “What is this customer eligible to use?” If your agent must interpret raw transactions for every request, business-rule calculations become part of the conversation.
That is a problem when no single field contains the answer. In our system, we had to traverse orders and line items, map SKUs through product hierarchies, filter cancelled orders, verify provisioning, and determine which agent-led experiences each customer could use.
One tenant had more than 1,000 SKUs on record and more than 800 cancelled orders in its history. Before the graph, ad hoc services assembled entitlement information from multiple sources while also handling authentication, authorization, and personalization. Their answers were difficult to verify because the services operated outside our standard data governance and lineage practices, and their refresh rates and latency weren’t formally monitored.
We moved those calculations upstream. A Data 360 calculated insight derives active, provisioned products, filters cancelled orders before aggregation, and normalizes product names. The tenant graph then contains both the resulting cloud name and the eligible experiences. Instead of reconstructing the rules, the agent retrieves their results.
The lookup is deliberately simple (illustrative field names):


Ad hoc services combined entitlement logic with access decisions. The revised design separates authorization from governed entitlement calculation and makes results traceable to their source records.
The improvement went beyond speed. We could now trace entitlements back to their underlying orders. If your agent repeatedly applies the same business rules, compute and govern those answers once instead of making every caller derive them independently.
Precomputation, however, introduces a different tradeoff: freshness.
Our tenant graph refreshes hourly, so an upgrade immediately before a support conversation might take up to an hour to appear. Customer-success scores refresh weekly or monthly, while Data 360 also supports streaming and real-time graph options for information requiring faster updates.
We learned why freshness deserves as much attention as retrieval speed when an upstream feed stopped updating for weeks. The graph continued returning well-formed responses, but the information was outdated.
For your architecture, establish acceptable freshness thresholds for each source and monitor them alongside successful lookups. A fast response containing stale entitlements can be just as problematic as a failed request.
2. Design data graphs around your AI agent’s questions
Once you have decided what to precompute, you need to determine how to organize it. Should everything live in one enormous graph or should each data source have its own?
Both approaches introduce problems. Oversized graphs return unnecessary information and can increase retrieval latency. Excessively fragmented graphs force agents to stitch results together at runtime, recreating the complexity precomputation was supposed to eliminate.
We organized our graphs around recurring questions: the person and their role, the tenant’s products and entitlements, and customer-success health. Each graph uses a key the caller already has, such as a contact or tenant ID. Large, slower-changing scores remain separate so their rebuilds don’t hold up faster-moving tenant context.
The guiding principle is to group information that agents frequently need together while separating data with different access patterns or refresh requirements.
Our early graph lookup benchmarks were approximately 400 milliseconds. Production monitoring now shows a median (P50) below 200 milliseconds. In a separate scores-graph storage comparison, moving from zero-copy views to data stored in Data 360 reduced average latency from 2.2 to 1.1 seconds at five concurrent callers and from 4.1 to 2.5 seconds at 30 callers.

Organize graphs around related agent questions rather than returning oversized payloads or requiring numerous small lookups.
Performance comparison: What the measurements actually show
We evaluated several approaches under different workloads and test conditions. Understanding those distinctions is essential when interpreting the results.

Note: Group A compares approaches at the calling team’s endpoint. Group B compares storage strategies under two concurrency levels. Group C reports graph-lookup measurements from different implementation stages. These measurements do not constitute one controlled experiment, and production lookup latency excludes agent response generation.
The clearest storage comparison comes from Group B. Storing the scores graph in Data 360 reduced average latency by approximately 48% at five concurrent callers and 40% at 30. Group C demonstrates production lookup performance, but it should not be compared directly with Group A.
When benchmarking your own architecture, document the workload, endpoint, concurrency, and latency percentile. Without that context, performance numbers can be misleading.
3. Enforce AI agent data privacy in your architecture
Fast retrieval is only useful if your agent retrieves information about the right customer.
Imagine a consultant who opens support cases for two customers. Identity resolution correctly recognizes that consultant as one person, but an agent serving Customer A must never expose Customer B’s cases. Asking the model to ignore unauthorized records is not an access control strategy.
Our Data 360 architecture establishes three boundaries. First, a customer-success data space contains only the objects required for that purpose, with selected objects shared from other spaces. Second, agents access data graphs, not the entire data space, limiting which fields they can retrieve. Third, an authorization service determines which customers the signed-in user may select and supplies the permitted tenant key.
That final boundary is critical. If an agent accepts customer identifiers directly from conversational text, the model effectively participates in authorization decisions. Our design establishes the permitted tenant before retrieving its context, rather than allowing the conversation to invent an identifier.
The lesson is to separate two responsibilities: authorization establishes which customer a user may access, while context retrieval determines what the agent needs to know about that customer. Keeping those decisions independent makes unauthorized information inaccessible before it reaches the model.
4. Optimize AI agent context for relevance, not volume
Even after you have made retrieval fast and secure, another question remains: How much information should your agent receive?
Our case history contains approximately 13.5 million cases dating back to 2009. Sending that entire history into prompts would be expensive and distracting. Even 50 transcripts averaging 2,000 tokens each would consume roughly 100,000 tokens before the agent begins answering.
Structured data creates similar challenges. In our customer success scores workload, the largest tenant’s complete signal history exceeded three million characters. Sending that history to answer a question about current customer health would bury the most relevant information in an enormous payload.
Research on “Lost in the Middle” and subsequent long-context evaluations reinforces the concern: models can struggle to use relevant information buried within large inputs. More context is not automatically better context.
Instead, our Data 360 data graph supplies structured facts agents frequently need, including current entitlements, product ownership, open-case counts, and recent case status. Full transcripts remain searchable when questions require specific historical details. Similarly, agents can retrieve current customer success scores and relevant signals without receiving the entire score history by default.
This creates a useful division of responsibility. Frequently requested structured facts belong in precomputed context, while uncommon details remain available through targeted retrieval. You preserve access to deeper information without making every interaction carry its full weight.
When evaluating a field for your default context, ask three questions: Does the agent need it routinely? Can it be represented accurately as a structured fact? Will it change the agent’s answer or next action? Test those decisions against representative customer questions, and rerun those tests whenever you add or remove a field.

Figure 4. Deliver concise, precomputed customer facts by default. Retrieve detailed historical cases only when a question requires them.
5. Automate data graph deployment and validation
You have now addressed the major retrieval challenges: exact answers, sensible graph boundaries, authorization, and relevant context. But the architecture still needs to operate reliably across environments and releases.
Your first graph should not demand the same manual effort as your fifth. We packaged definitions and dependencies into Data 360 data kits, promoting them through development, QA, UAT, and production. Reusable validation checks verify primary key counts, uniqueness, completeness, and freshness.
Those checks uncovered 2,765 tenants with missing or mismatched account IDs and ten tenants with scores but no tenant record during scores-graph UAT, before release. We also automated sandbox recovery, reducing a process that previously took days to approximately eight minutes.
These findings demonstrate why deployment automation and data validation must work together. A successfully deployed graph isn’t necessarily a trustworthy graph. Its joins must be complete, its keys consistent, and its underlying records sufficiently current.
The broader effort delivered five major releases in six months. This isn’t a like-for-like speed comparison with earlier customer-identity programs because Data 360 already provided identity and serving infrastructure. It does, however, illustrate the value of reusable foundations rather than rebuilding the same plumbing for every graph.
If you are building your first graph, invest in repeatable deployments, automated validations, and recovery procedures from the beginning. Those foundations become increasingly valuable as your architecture expands.
Looking ahead, we see this work as a starting point rather than a finished platform. The next step is a reusable paved path for agentic context: a standard way for any team to package, govern, and serve context to its agents, instead of rebuilding it graph by graph. We are also exploring how these context packs could become dynamic, adapting to the questions agents actually ask and learning over time which context improves their answers. We’ll share more as that work takes shape.
Closing thought
Return to the original challenge: Your AI agent needs to deliver an exact, authorized customer answer without reconstructing fragmented enterprise relationships during every conversation.
At Salesforce, we addressed that challenge by moving identity matching, joins, and entitlement calculations upstream; organizing the results into purpose-built Data 360 graphs; enforcing authorization before retrieval; and reserving detailed searches for questions that require them. Production graph lookups now have a median latency below 200 milliseconds, while governed pipelines make the underlying answers traceable and their freshness observable.
The result is an architecture in which agents spend less time assembling information and more time using it. That’s the central lesson of AI context engineering: The best context is not the most information you can give an agent. It’s the information you’ve already done the engineering work to make useful.
Learn more
- Stay connected by joining our Talent Community.
- Explore our Technology and Product teams to see how you can get involved.