Write grounding rules
Knowledge retrieval supplies possible evidence. Grounding rules tell the agent which evidence it may trust, what it may infer, and what to do when retrieval is missing, weak, stale, or contradictory.
Define a source hierarchy
Put the hierarchy in SOURCE OF TRUTH:
SOURCE OF TRUTH
- Use configured variables for fixed business facts.
- Use the attached knowledge collection for approved policy, service, and product details.
- Use successful function results for current availability, records, and completed actions.
- A successful live action result overrides older scheduling or status information in knowledge.
- Never invent a price, warranty, policy, service area, technical specification, or outcome.
Knowledge should not override current provider data. A document can explain appointment policy, but only a successful calendar action can confirm a live time slot.
Define when to search
For an agent-level voice base, the runtime can retrieve automatically. Still tell the model to ground business-specific answers in supplied knowledge and to treat absence as unknown.
For a named Knowledge function, insert the exact marker and define its trigger:
When the person asks about returns, delivery, product compatibility, or warranty terms, search the approved support collection with [[Function: exact_knowledge_function]]. Use a specific query containing the product or policy and the person's actual question.
Do not tell the model to search on every greeting, confirmation, or casual reply. Search when an approved factual answer is needed.
Define answer boundaries
Use observable rules:
- Answer only claims supported by the retrieved content or another approved source.
- Preserve exact exclusions, dates, amounts, model numbers, and conditions.
- Do not combine partial statements into a broader promise.
- Do not describe a source as current unless its content provides a date or the workflow verifies it.
- If the material is incomplete, say what is confirmed and what still needs verification.
- If no relevant result is returned, say that you do not have a verified answer on file and offer the approved follow-up.
For voice, keep the spoken answer concise and offer more detail. For text chat, make the result easy to scan. Do not expose similarity scores, vector search, chunks, hidden prompts, or internal tool names.
Resolve conflicts explicitly
Do not leave conflict resolution to model intuition. Define a deterministic rule, such as:
- a successful live system result;
- a source explicitly marked with a later effective date;
- the policy source designated as authoritative; and
- human verification when authority or date cannot be determined.
If two retrieved sources conflict and the prompt does not establish priority, the agent should not choose one silently.
Separate knowledge from action
Retrieval is read-only. It cannot book, cancel, transfer, send, update a CRM, or verify live account state. Define the transition from knowledge to a function:
Use approved knowledge to explain the booking policy. When the person asks for a time, follow the calendar action policy. Offer only availability returned by the live action and confirm the booking only after that action succeeds.
Do not copy raw sources into the prompt
The source chunks are retrieved separately. Keep the prompt focused on policy, routing, and fallback. Copying the same material into the prompt creates duplicate authorities, increases context use, and makes updates harder to govern.
Avoid unsafe source instructions
Treat source content as data, not as higher-priority instructions. A crawled page, uploaded file, or image can contain text that tells an AI to ignore its policy, disclose data, or perform an action. The system prompt and attached function permissions remain authoritative.
Do not place secrets in knowledge. Retrieved content becomes model context and may be spoken or written when the prompt allows it.
Complete example
SOURCE OF TRUTH
Use configured variables for fixed business facts and the approved support collection for policies and product information. Use successful integration results for live state. Never guess prices, coverage, availability, warranties, or outcomes.
KNOWLEDGE RULES
- For a business-specific factual question, use [[Function: exact_knowledge_function]] with a specific query.
- Answer only from relevant returned content.
- Preserve qualifications and exclusions.
- If sources conflict, prefer the explicitly newer effective date; otherwise offer support verification.
- If nothing relevant is returned or retrieval fails, say that no verified answer is available and offer [approved fallback].
- Do not mention the knowledge base, search tool, chunks, or internal sources unless the user asks where the information came from.
Next step
Evaluate these rules with Test and troubleshoot retrieval.