Who it is forA developer whose agent answers questions from search or database tools and sometimes states things the tools did not return.
The problemRelevance-style metrics can pass an answer that is on-topic but partly invented, so the made-up claim goes unnoticed.
The outcomeA per-claim support score and a list of unsupported claims for each trace, plus a check on whether the answer used the tool output at all.
What you need first
- Python 3.10 or newer
- An API key for one backend: AI_GATEWAY_API_KEY (Jev through Vercel AI Gateway), TYPESAFE_API_KEY, or OPENROUTER_API_KEY
- A trace to evaluate: a messages list in the OpenAI chat format plus the tools you gave the model
Steps
pip install jevalsexport AI_GATEWAY_API_KEY=...(TYPESAFE_API_KEY or OPENROUTER_API_KEY also work)- Save a script that calls
evaluate({"messages": messages, "tools": tools}, [UsedToolResult(), Grounded()])withfrom jevals.agent import UsedToolResult, Grounded(inferred, check the README) - Run the script on one saved trace and read
r.grounded.scoreandr.grounded.evidenceto see which claims failed
Prompt for your agent
Use the jevals repo to evaluate the agent trace in <trace_file>. Call evaluate() with UsedToolResult() and Grounded() on its messages and tools. Report the grounded score and every claim with a low support probability. Verify the report lists the claims in the order they appear in the final answer.
Caveat. The emulated chat LLM backend returns 0.00 or 1.00 instead of calibrated probabilities, so use a decision model backend for real scores.
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Disclaimer
Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page