You are here:
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 and Use Outputs from Predictive Models.
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.
- 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.
- In a prompt template, use flow merge fields to embed that data in the prompt. To learn more, see Ground with Flow Merge Fields.
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.
- In Apex, create an invocable action to request outputs from a predictive model. To learn more, see Get Predictions in Apex.
- In a prompt template, use Apex merge fields to embed that data in the prompt. To learn more, see Grounding with Apex Merge Fields.
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:
- 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.
- Provide those outputs as inputParams when calling the generations endpoint in the Connect REST API. To learn more, see Einstein Prompt Template Generations in the Connect REST API Developer Guide.
Get Predictive Intelligence Using Data Model Objects (DMOs)
DMOs in Data 360 can provide prompts with batch or streamed predictions, prescriptions, and top factors.
- 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 or Use Predictions to Transform Data.
- 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.

