A Salesforce LWC that automatically generates an AI-powered record summary when visible, with no user interaction required.
Standard Salesforce AI Summary generates context when a user clicks a button. This component changes that interaction by running automatically as soon as it becomes visible.
While the Prompt Template runs in the background, the card takes up very little space, showing only a pulsing "AI Summary" title with a sparkle icon. Once the response is ready, the full summary renders directly inside the card, giving users immediate context the moment they open a record.
Warning
This component consumes tokens on page load. Consider using it for orgs on an unmetered token tier.
Open App Builder on any Record Page, drag Instant AI Summary onto the layout and select the Prompt Template of type Record Summary you want to use. Save and activate the page.
Navigate to any record of that object type and the summary will appear automatically on load.
| Component | Type | Description |
|---|---|---|
instantAiSummary |
LWC | Renders the AI-generated summary card on a record page. |
AiSummaryGenerateFromPrompt |
Apex | Calls the Einstein LLM API to run the prompt template against the current record. |
AiSummaryPromptsFilterByObject |
Apex | Dynamic picklist that filters available prompt templates by the page's object type, used in App Builder configuration. |
EinsteinLLMService |
Apex | Interface for the Einstein LLM ConnectApi calls, enabling dependency injection in tests. |
EinsteinLLMServiceImpl |
Apex | Production implementation of EinsteinLLMService that delegates to ConnectApi.EinsteinLLM. |
Run the setup script to create a scratch org, install the package, deploy test metadata, and seed a sample PersonAccount:
cd test
./scripts/setup.sh- Salesforce org with Generative AI enabled
