Sub topic 8
Summarizing a record
This chapter covers the standard Summarize Record action: what it does, how to add it to a topic, how to write instructions that trigger it, and where it goes wrong. It assumes you know the Salesforce data model (objects, fields, records) and have used Agentforce Builder to add an action to a topic. It also assumes you have read the previous chapter on finding and reading records.
What the action does
Summarize Record takes one record and returns a short natural-language summary of it. A large language model (LLM) writes the summary from the record's field values. The action is useful when a user asks for an overview ("Give me a rundown of the Acme account") and does not need specific field values.
It differs from the lookup actions in three ways:
- Output is prose. Query Records and Get Record Details return structured data. Summarize Record returns text meant to be shown to the user.
- It needs a record to start from. It does not search. Something earlier in the conversation must have identified exactly one record.
- The LLM chooses what to emphasize. You get a readable overview, but you do not control which fields appear unless you configure the summary.
How it fits into a conversation
The action usually comes second in a chain. A lookup action finds the record. The summary action then receives that record.
The agent's planner decides the order. It reads the topic's instructions, the action descriptions, and the conversation so far. If the instructions say to find the record first, the planner will normally do that before calling the summary action.
Adding the action in Agentforce Builder
- Open the agent in Agentforce Builder and select the topic that handles record questions, for example Account Support.
- In the topic's actions section, choose to add an action and pick Summarize Record from the standard actions list.
- Review the inputs. The main input is the record to summarize. Set it to be filled from a prior action's output rather than asked of the user.
- Review the action's name and description. The planner uses these to decide when to call it, so make them specific.
- Save, then test in the conversation preview.
The record input is the important setting. If it is left to slot filling from user text, the agent may ask the user for a record ID, which is a poor experience. Wiring it to the output of the lookup action avoids that.
Writing instructions that use it
Instructions tell the agent when to call the action, in what order, and when to stop and ask. Here is a version for a summary topic:
Topic: Account Support
Classification description:
Handle questions about a customer's account, such as looking up an account, summarizing it, or updating basic fields.
Instructions:
1. When the user names an account, first find the account record, then use the result for any later step.
2. Use the summary action when the user asks for an overview of an account.
3. If you cannot find exactly one matching record, ask the user to clarify instead of guessing.
4. Do not summarize a record you have not found in this conversation.Each instruction does a specific job:
| Instruction | Problem it prevents |
|---|---|
| Find the record first | The summary action running with no record |
| Use the summary action for overviews | The agent answering from its own general knowledge |
| Ask when zero or several records match | A summary of the wrong account |
| Do not summarize unfound records | Invented content for a record that does not exist |
Keep each instruction to one behavior. Long instructions that combine several rules are followed less reliably.
Summary versus lookup: choosing the right action
Users phrase requests loosely, so the agent must decide between a summary and a field read. Your instructions can make the boundary explicit.
| User request | Better action |
|---|---|
| "Give me an overview of Acme" | Summarize Record |
| "What is Acme's annual revenue?" | Get Record Details |
| "List open opportunities over 50,000" | Query Records |
| "What changed on this account recently?" | Depends on history tracking. A summary of current field values will not show changes. |
A summary is not a reliable source for exact values. The LLM may round numbers, drop fields, or phrase a date loosely. If the user needs a precise figure, route the request to Get Record Details.
Access and data handling
The action runs on behalf of the user who is in the conversation. Object permissions, field-level security, and sharing rules apply to the record data the action can read. If a user cannot see a field, that field's value should not appear in their summary.
Two practical consequences follow:
- Two users can ask for the same account and get different summaries, because their field access differs.
- A "record not found" result can mean the record exists but the user cannot see it.
The LLM request goes through the Einstein Trust Layer, which applies protections such as masking of sensitive data before the prompt reaches the model. A later chapter covers it in detail. For now, the point is that you do not configure these protections per action.
Testing the summary
Use the conversation preview in Agentforce Builder and check three things for every test:
- Which actions ran. Confirm the lookup ran before the summary action.
- What went into the summary action. Confirm the record is the one you intended.
- What came back. Compare the summary text with the record's actual fields.
Test these cases at minimum:
- A name that matches exactly one record.
- A name that matches several records. The agent should ask which one.
- A name that matches nothing. The agent should say so and not produce a summary.
- A user whose permission set hides some fields. The summary should leave them out.
- A vague request such as "tell me about Acme". Check whether the agent chooses the summary or asks a question.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| Agent asks the user for a record ID | Record input is set to slot filling from the user | Map the input to the lookup action's output |
| Summary action never runs | Action description is vague, or instructions never mention it | Rewrite the description and add an instruction naming when to use it |
| Summary describes the wrong record | The lookup matched several records and the agent picked one | Add an instruction to ask for clarification unless exactly one record matches |
| Summary omits a field you expected | Field-level security, or the model left it out | Check the user's access first. If access is fine, use Get Record Details for that field |
| Numbers differ slightly from the record | The LLM paraphrased a value | Send exact-value questions to Get Record Details |
| Agent writes a summary without calling the action | Instructions do not require the action | State that overviews must use the summary action |
Limits of the standard action
The standard action gives you a general summary. You may outgrow it if you need:
- A fixed format, such as a three-line brief with named sections.
- A summary that combines a record with its related records, such as an account with its open cases.
- Emphasis on particular fields for a particular team.
In those cases a custom action backed by a prompt template or a Flow can produce a tailored summary. A later chapter covers when to make that move. Until you hit one of those needs, the standard action is the simpler choice and needs no code.
Exercise
A user asks "Summarize Acme". Your lookup action finds three accounts whose names contain "Acme". Name two instructions in the topic that keep the agent from summarizing the wrong one, and say what you would check in the conversation preview to confirm they work.
Show answer
Use an instruction to find the account record first and use that result for later steps, and an instruction to ask the user to clarify when the lookup does not return exactly one matching record. In the preview, confirm that the lookup ran, that the agent asked which account the user meant, and that the Summarize Record action did not run until the user chose one.
Exercise
A sales rep says the summary shows Annual Revenue as "about 2 million", but the record says 2,140,000. Which standard action should answer questions like this, and why?
Show answer
Get Record Details. Summarize Record uses an LLM that may round or paraphrase values, so it is not a reliable source for exact figures. Get Record Details returns the stored field value directly.