---
schema_version: "1"
id: 4e8928bbeef85595f6e75deb55f697c4e3e02f1f855a4aa682465df9422761dc
title: Ground with Predictive AI
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ai/264-0-0/prompt_builder_ground_predictive.md
canonical_url: https://help.salesforce.com/s/articleView?id=ai.prompt_builder_ground_predictive.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 155b334dcd293c1454cf49c47d672b39548c34861081b23b98506c32d4ea750d
description: Ground your prompt templates with relevant knowledge and actionable intelligence from predictive models. Augment your LLM prompts with predictions, top predictors, and prescriptions.
products:
  - Agentforce
  - Cross Cloud
release: "264"
---
# Ground with Predictive AI

Ground your prompt templates with relevant knowledge and actionable intelligence from predictive models. Augment your LLM prompts with predictions, top predictors, and prescriptions.

## Predictive AI and Prompt Templates

Use predictive models to improve the accuracy and contextual relevance of LLM responses. Predictive models predict future business outcomes using data from current business conditions. They’re trained on past data using machine learning and statistical modeling to detect trends and patterns. To learn more, see [Key Concepts for Predictive AI](https://help.salesforce.com/s/articleView?id=data.c360_a_ai_predictive_about.htm&language=en_US) and [Use Outputs from Predictive Models](https://help.salesforce.com/s/articleView?id=data.c360_a_get_predictions_from_your_model.htm&language=en_US).​​

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ai-generative_ai-264-0-0-production-enus/f8ef6498-d7b2-44e3-9b34-ffd5a850aae9/images/icon_note.png)

Note You need access to the predictive model that you want to use. If you don’t already have a predictive model set up, see [Create Predictive AI Models From Scratch](https://help.salesforce.com/s/articleView?id=data.c360_a_ai_ec_create_model.htm&language=en_US) or [Bring Your Own Model](https://help.salesforce.com/s/articleView?id=data.c360_a_bring_your_own_model.htm&language=en_US).

## Get Predictive Intelligence Using Flows

Flows can provide prompts with on-demand predictions, prescriptions, and top factors. On-demand predictions are generated dynamically within the flow of work.

1. In Flow Builder, create a flow, add a predict action to request outputs from a predictive model, and then store the output values. To learn more, see [Get Predictions in Flows](https://help.salesforce.com/s/articleView?id=data.c360_a_ai_flow_builder_predictions.htm&language=en_US).
2. In a prompt template, use flow merge fields to embed that data in the prompt. To learn more, see [Ground with Flow Merge Fields](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_ground_flows.htm&release=264.0.0&type=5 "Flows elevate your prompt templates beyond grounding with record fields. Use Flow Builder to add complex logic to a prompt template. With flows, you can also access unified Data 360 objects. By referencing Data 360 data, you can use real-time information that was consolidated across multiple data sources.").

## Get Predictive Intelligence Using Apex

Apex can provide prompts with on-demand predictions, prescriptions, and top factors. On-demand predictions are generated dynamically within the flow of work.

1. In Apex, create an invocable action to request outputs from a predictive model. To learn more, see [Get Predictions in Apex](https://help.salesforce.com/s/articleView?id=data.c360_a_ai_apex.htm&language=en_US).
2. In a prompt template, use Apex merge fields to embed that data in the prompt. To learn more, see [Grounding with Apex Merge Fields](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_ground_apex.htm&release=264.0.0&type=5 "You can use an Apex merge field in a prompt template to return data from a SOQL query or an external API. Apex is also effective if you want to generate well-formatted JSON or do programmatic data filtering.").

## Get Predictive Intelligence Using REST

REST applications can provide prompts with on-demand predictions, prescriptions, and top factors. On-demand predictions are generated dynamically within the flow of work. In a REST client:

1. Request outputs from a predictive model by calling the predict endpoint in the Salesforce Data Cloud Connect REST API. To learn more, see [Get Predictions in REST Applications](https://help.salesforce.com/s/articleView?id=data.c360_a_ai_rest.htm&language=en_US).
2. Provide those outputs as inputParams when calling the generations endpoint in the Connect REST API. To learn more, see [Einstein Prompt Template Generations](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_prompt_template.htm) in the [Connect REST API Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/intro_what_is_chatter_connect.htm).

## Get Predictive Intelligence Using Data Model Objects (DMOs)

DMOs in Data 360 can provide prompts with batch or streamed predictions, prescriptions, and top factors.

1. Populate the DMO with outputs from a predictive model. You can do this via batch predictions (with batch data transforms or batch predict jobs) or streaming predictions (with predict jobs). To learn more, see [Get Predictions with Prediction Jobs](https://help.salesforce.com/s/articleView?id=data.c360_a_ai_prediction_job_get_predictions.htm&language=en_US) or [Use Predictions to Transform Data](https://help.salesforce.com/s/articleView?id=data.c360_a_ai_batch_transform_append_predictions.htm&language=en_US).
2. In a prompt template, use DMO merge fields to embed that data in the prompt. To learn more, see [Ground with Data 360 DMO Merge Fields](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_ground_dmo.htm&release=264.0.0&type=5 "Ground your prompt templates with data model objects (DMOs) from Data 360 in Prompt Builder.").