How to build an agent with grounding on LiteLLM
BUILD AN AGENT WITHGROUNDING
Grounding checks whether an answer is supported
by the documents you give it.
Employees receive a one-time home office equipment allowance of $500. Submit receipts within 30 days of purchase.
home-officeYou receive a one-time home office allowance of $500. Submit your receipts within 30 days of purchase.
The policy supports the allowance and receipt deadline.
source_ids: ["home-office"]trueBuild an agent that answers questions from your documents, then checks each answer against the evidence before showing it in chat.
We will connect to a LiteLLM gateway, load a policy, generate and check an answer, then display the grounding result. The Python snippets form one async request handler. Start with one document; connect your retriever once you can inspect the complete flow.
This guide uses the unreleased SDK helper #49469, native endpoint response #49460, and Bedrock assessment setting #49470, for issue #49217. Use that implementation for both your SDK and gateway until release. The template at the end pins the complete revision.
