SalesforceAkshay SharmaExplainer
5 Lessons in AI Context Engineering: Why More Context Is Not Better
Summary
AI agents retrieving customer context from fragmented enterprise systems face latency and accuracy tradeoffs, with traditional approaches like runtime calls or warehouse joins adding seconds to responses; one tenant had over 1,000 SKUs and 800 cancelled orders. Salesforce addressed this by building Data 360 data graphs that precompute identity resolution, entitlement calculations, and joins before agent queries, moving complex data preparation out of the conversational critical path. Production graph lookups achieved a median latency below 200 milliseconds, down from early benchmarks of approximately 400 milliseconds. Storing scores in Data 360 reduced average latency by approximately 48% at five concurrent callers and 40% at 30 compared to zero-copy views. The team automated deployment and validation, uncovering 2,765 tenants with missing account IDs during testing and reducing sandbox recovery from days to about eight minutes.
Context
AI agents need to deliver exact, authorized customer context from fragmented enterprise systems quickly, but traditional approaches like runtime calls to source systems or warehouse joins introduce latency and repeated identity matching. Retrieval-augmented generation works for unstructured documents but cannot reliably establish active entitlements. The challenge is to provide fast, accurate, and governed context without reconstructing complex relationships during every conversation.
Approach / What changed
Salesforce built Data 360 data graphs that precompute identity resolution, entitlement calculations, and joins before agent queries. The graphs provide a prejoined, per-customer JSON view retrieved by key through the Data Graph API. Authorization is enforced before retrieval, and data is organized around recurring agent questions. Deployment and validation are automated using data kits and reusable checks.
Takeaways
Precomputing customer context (entitlements, product eligibility) before agent queries reduces latency and makes results traceable, but introduces a freshness tradeoff; the tenant graph refreshes hourly, so changes may take up to an hour to appear.
Organizing data graphs around recurring agent questions (person/role, tenant products, customer health) and separating data with different access patterns or refresh requirements improved median lookup latency from approximately 400 milliseconds to below 200 milliseconds.
Automating deployment and validation of data graphs uncovered 2,765 tenants with missing account IDs during UAT and reduced sandbox recovery from days to about eight minutes, demonstrating the value of repeatable processes.
FAQ
How does precomputation affect data freshness?
Precomputed graphs refresh on a schedule: the tenant graph refreshes hourly, while customer-success scores refresh weekly or monthly. Changes may take up to an hour to appear, so establishing and monitoring acceptable freshness thresholds for each source is important.
What is the performance benefit of storing data in Data 360 vs zero-copy views?
Storing scores in Data 360 reduced average latency by approximately 48% at five concurrent callers and 40% at 30 concurrent callers compared to zero-copy views, as shown in the Group B storage comparison.
How did the team ensure data graph trustworthiness?
They automated validation checks for primary key counts, uniqueness, completeness, and freshness. These 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.
Source and freshness
- Source
- engineering.salesforce.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.