keepcalculator

06 Numbers and Powers

Salesforce Data Graphs: Prepare Context for AI Agents

Card No. 06·59237 · Updated · Standard formula, shown below

Salesforce Data Graphs can assemble related customer information into a unified view that an AI agent can use as context. This guide explains how to define a graph, make the right data available, and connect its results to an agent while checking access and relevance first. You’ll need Salesforce access to Data Cloud and the Salesforce tools used to configure your agent; exact menus and availability can vary by org and release.

What You’ll Need

  • Permissions to view and configure Data Cloud data spaces, data model objects, data graphs, and any agent or prompt configuration involved.
  • Customer data already ingested into Data Cloud and mapped to data model objects. Confirm that the fields you need are populated and that records can be related through suitable identifiers.
  • A clear agent task, such as answering account questions or summarizing recent service activity. Decide which customer facts the task needs and which it should never expose.
  • A test environment or safe test records, plus a way to inspect the agent’s retrieved context and output.

Step-by-Step

  1. Define the agent’s context requirement. Write down the exact question or action the agent supports. For example, a service agent may need an account’s contact details, open cases, and recent interactions. Specify the fields and related records needed to answer, and exclude unrelated or sensitive data. This scope will guide the graph structure and help keep context small and relevant.
  2. Check the underlying data. In Data Cloud, review the relevant data model objects and their field mappings. Confirm that source data has arrived, identifiers are consistent, and relationships connect the expected records. A graph can organize available data; it cannot fix missing, stale, incorrectly mapped, or duplicated source records. Validate representative records before building.
  3. Choose the customer or other starting object. Open the Data Graphs area in the relevant Data Cloud workspace and start creating a graph. Select the object that represents the entity the agent will ask about, such as an individual or an account, according to your data model. Use an object whose identifier can reliably resolve the customer in the agent’s workflow.
  4. Add only useful related objects and fields. Build out the graph using the available relationships—for example, linking a customer to cases or interactions when those relationships exist in your model. Select fields the agent needs, such as case status or interaction date, rather than copying every field. Follow the configuration options shown in your org for relationship paths, included fields, and any supported limits or filters.
  5. Review identity and relationship behavior. Check how the graph identifies its starting record and how related records are associated. Make sure the identifier supplied by the agent corresponds to the graph’s expected key; an email address, CRM record ID, and unified individual ID are not interchangeable unless your configuration explicitly maps them. Test customers with multiple records and edge cases such as no related cases.
  6. Save, validate, and make the graph available. Use the validation or activation controls provided in the interface. Resolve reported configuration issues before relying on the graph. Some orgs or features may require a data space selection, permissions, or additional setup before a graph can be used. Follow the status shown in your org rather than assuming that saving alone makes it available to an agent.
  7. Connect the graph to the agent’s context flow. In the agent or prompt configuration, use the supported Data Cloud data source, retrieval option, or action that exposes the graph. Configure how the agent identifies the customer and passes the matching key. The exact connection method depends on the Salesforce agent features enabled in your org; don’t assume a graph automatically becomes agent context just because it exists.
  8. Set access and guardrails. Confirm that the agent’s execution context and users have appropriate access to the data and that the graph does not expose fields beyond the intended task. Apply your organization’s existing data access policies and review how permissions are enforced in the chosen integration. Add instructions for the agent to distinguish known facts from missing information and to avoid presenting unrelated records as certain.
  9. Test with realistic prompts and records. Try a customer with complete data, one with missing related records, and one with multiple related records. Inspect what context is retrieved, whether the correct customer was selected, and whether the answer accurately reflects the underlying fields. Test ambiguous requests and requests outside scope too. Adjust the graph or agent configuration when it retrieves excessive, irrelevant, or incomplete information.
  10. Monitor and maintain it. After deployment, review agent responses and retrieval behavior through the monitoring and debugging tools available in your org. When source mappings, relationships, or agent tasks change, reassess the graph and repeat the tests. Assign an owner to check data quality, access, and context relevance as part of normal change management.

Common Mistakes

  • Adding too much data: A broad graph can make context noisy and may reveal fields the task does not need. Start with the smallest useful set.
  • Assuming records are linked: Similar names or email addresses do not guarantee a valid relationship. Verify keys and relationship paths in the data model.
  • Using the wrong identifier: If the agent passes a different key from the graph’s expected identifier, context may be empty or associated with the wrong record.
  • Skipping permissions review: Test access with the same kind of user or execution context the agent will use. A successful administrator test does not prove that normal users can access the same information.
  • Treating retrieved context as complete: Missing or outdated source data can produce a plausible but incomplete answer. Make gaps visible and avoid instructing the agent to guess.

Tips

  • Write a short field inventory before building: field, purpose, source, and whether the agent needs it.
  • Use clear names and descriptions for graphs and fields so administrators can maintain them later.
  • Keep test prompts and expected outcomes for key scenarios, including no-match and multiple-match cases.
  • Separate retrieval from decision-making: provide facts to the agent, then specify what it may do with them and when it must ask for clarification.
  • Check current Salesforce documentation and in-org help for feature prerequisites and exact setup labels, since capabilities and navigation can change.

Troubleshooting

  • The graph returns no context: Confirm it is in the expected data space and available for use, then check that the input key matches the graph’s starting-object identifier. Verify that the source record exists and that data ingestion and mappings completed.
  • Some related records are missing: Inspect the relationship path and the source records’ keys. Check whether filters, object mappings, or data freshness explain the omission, and test with a record known to have the relationship.
  • The agent uses the wrong customer: Review how the agent resolves a person or account when a prompt is ambiguous. Pass a stable identifier where appropriate and add a clarification step rather than relying on a name alone.
  • The agent ignores or misstates retrieved facts: Inspect the actual context supplied to the agent, not only its final answer. Check field names, values, prompt instructions, and whether conflicting or stale records are present. Narrow the context and make the expected source of truth explicit.
  • Access or activation fails: Check permissions, feature availability, data-space selection, and any validation messages. Ask a Salesforce administrator to review the org’s enabled features and assigned permissions if the required controls are unavailable.

Frequently Asked Questions

What is a Salesforce Data Graph?
A Data Graph organizes a selected starting record and related data into a usable customer view. The exact supported configuration depends on the Data Cloud features available in the org.

Does creating a Data Graph automatically give an agent customer context?
No. You generally need to configure a supported connection or retrieval path in the agent or prompt setup, and provide a key that resolves the intended record.

Do I need to create a unified individual first?
Not in every design. The right starting object depends on your data model and task. Use the identity and object your agent can reliably resolve.

Can a Data Graph include every customer field?
It may be technically possible to select many fields, but doing so is rarely a good default. Include only relevant, authorized fields and verify access behavior.

Why does the agent give an incomplete answer?
The source may be missing or stale, a relationship may not resolve, the wrong identifier may be passed, or the agent may not receive or use the intended context. Inspect each stage.

How should I test a graph before release?
Test known records with complete, missing, and multiple related records. Verify the retrieved fields, correct identity matching, access controls, and the agent’s handling of uncertainty.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →