Retriever and Knowledge grounding after template deployment
Key Takeaway
Deploying a template doesn't carry all of its grounding pieces with it. Create Einstein Search retrievers manually in the target org before you deploy, and expect that you can't deploy Agentforce Data Library changes that you make in a sandbox.
A prompt template or agent that uses retrieval depends on pieces that live outside the template itself. Moving the template to another org, or testing in a sandbox, doesn't carry all of those pieces with it. You have to recreate, reconnect, or refresh them in the target org, and then test.
Deploying a template that uses grounding
These are the pieces that live outside the template:
- Einstein Search retrievers
- Search indexes
- Agentforce Data Libraries
- Knowledge articles
- The Data 360 data behind them
If a prompt template uses an Einstein Search retriever, change sets don't include the retriever or its search index metadata. So you must create the retriever manually in the target org before you deploy the template. Metadata API deployments follow the same rule, so switching deployment tools doesn't let you skip creating the retriever.
You can't deploy Agentforce Data Library changes that you make in a sandbox, either to production or to another sandbox.
Grounding a template on the KnowledgeArticleVersion object is supported only for Flex templates. You can't import or export Flex template metadata. The same limit applies to flows and Apex classes that reference Flex templates, and to change sets that move Flex-related artifacts between orgs.