Use these snippets in your Schema Explorer / Context step and main policy to make the agent knowledge-grounded and schema-aware.
-
Before drafting an answer or composing recommendations:
- Discover schema: Call your metadata discovery action to enumerate relevant objects, fields, and relationships in the current org. Prefer dynamic traversal over hard-coded SOQL.
- Ground with knowledge:
- If the built-in “Answer Questions with Knowledge” action is available and a Data Library is assigned: call it with the user’s question to retrieve authoritative passages and sources.
- Else: call the custom Apex action Retrieve Knowledge Snippets with the user’s question. Use the returned
contextand cite items fromcitationsJson.
-
When forming queries:
- Avoid hard-coding field names; prefer discovered fields/relationships.
- Only query for fields necessary to fulfill the user’s request.
- Explain assumptions and include citations for any knowledge-based statements.