Grounding is configured per template in Prompt Builder. The steps assume you already have a template in draft state with a clear task definition.
- Open the template in Prompt Builder
Setup, Prompt Builder, open the template. The Resources panel on the right is where grounding sources live.
- Add the primary record resource
Click Add Resource, pick Record, select the object (Case, Account, Contact). The merge syntax {!Input:Case.Subject} appears for fields you reference. Add only the fields the task needs.
- Add related records or knowledge
For service templates, add Knowledge as a resource and configure the search query. For sales templates, add Related Records to pull child records like opportunities or contacts. For cross-system context, add Data Cloud entities.
- Preview with a real record ID
Click Preview, paste a record ID, run. The preview shows the full grounded prompt and the model's response. Test with records that have thin context to see how the model handles sparse data.
- Activate and gate behind a permission set
Activate the template. Create or update a permission set that grants Use Prompt Template on this specific template. Assign to a small pilot group before opening to all users.
Pulls fields from the current record and related records. Respects sharing and field-level security. The default for transactional tasks.
Semantic search against published knowledge articles. Required for case summary, reply recommendation, and similar service features.
Pulls from unified profile data, including web behavior, marketing engagement, and ingested external data. Requires Data Cloud and a defined data graph.
Pulls from attached files and Content libraries. Useful when the answer lives in a PDF or document rather than a record field.
Custom Apex invocable that returns text. Used when the grounding source is an external system or a calculation. Counts against the context window like any other resource.
- Context windows have token limits. Stuffing too much grounding dilutes the relevant context and degrades the response. Pick narrow, ranked grounding.
- Grounding does not throw an error when the source is empty. The model just generates from memory. Always design a sparse-grounding fallback in the template.
- Stale data grounds confident wrong answers. A knowledge article that has not been updated since the product changed is worse than no article. Audit knowledge freshness.
- Field-level security applies to grounded record data. A user without read access on a field sees the field absent from their grounded prompt. Test with different profiles.
- Knowledge articles in draft state are not retrieved, only published ones. The same article in two languages produces two retrievable entries.