To integrate web activity data from Data Cloud into a prompt template, the correct approach is to enrich the Contact object with the activity records as a related list and use related list grounding (Option B). Here’s why:
Data Cloud Integration: Data Cloud unifies web activity data and associates it with the unified Contact record. By adding these activities as a related list to the Contact, the data becomes accessible to the prompt template.
Prompt Template Grounding: Salesforce prompt templates support grounding on related records. When the Contact is passed to the prompt template, the template can reference the related web activity records (via the related list) to extract insights.
Structured Data Handling: This method aligns with Salesforce best practices for grounding, ensuring the large language model (LLM) receives structured, context-rich data without overwhelming it with raw activity lists.
Why Other Options Are Incorrect:
A. Calling the prompt directly from Data Cloud: Prompt templates are invoked within Salesforce, not directly from Data Cloud. Grounding requires associating data with Salesforce objects, not ad-hoc web activity inclusion.
C. Passing a list of activity records as input: While technically possible, this bypasses Salesforce’s grounding framework, which relies on object relationships. It also risks exceeding LLM input limits and lacks scalability.
Salesforce Data Cloud Implementation Guide: Explains how to enrich standard/custom objects with related data for AI use cases.
Prompt Template Documentation: Highlights grounding on related lists to leverage contextual data for LLM prompts.
Trailhead Module: "Einstein Prompt Builder Basics" demonstrates grounding techniques using related records.