Combining merge fields with retrieval grounding
Key Takeaway
To make a retriever search for knowledge about the record a prompt template runs on, put merge fields from the prompt template inputs into the retriever's Search Text.
A prompt template can ground an LLM in two ways. Record merge fields drop exact values from a Salesforce record into the prompt, and retrievers search knowledge indexed in Data 360 and return relevant results. You can combine the two by putting merge fields inside the retriever's search. Then each search is about the record the prompt is running on.
Record merge fields and retrievers
Record merge fields give the LLM up-to-the-minute data from Salesforce objects. When the prompt template resolves into a prompt, each merge field is replaced with the real value from the selected record.
Retrievers search for and return relevant information from knowledge indexed in Data 360, such as knowledge article chunks or similar case chunks. They suit information that is not a field on the record. For example, a retriever suits account descriptions that are kept as unstructured data in an internal knowledge store.