Retrieval Relevance
Did we fetch documents that match the question?
LayaEval sits around your agent. It watches what goes in and what comes out, and tells you — in milliseconds — if the answer is true, safe and complete.
How it works
Install with pip. Works next to any agent or RAG app — LangChain, LlamaIndex, CrewAI or your own code.
Choose from 42 ready checks. Each one asks a single plain question, like “did it make anything up?”.
Every check returns pass or fail, a score and a confidence. Fast enough to run on every request.
Quickstart
No account, no server. Everything runs on your own machine. Swap in any of the 42 checks below — they all work the same way.
1from layaeval import Groundedness, ToolSelectionCorrectness23# 1. Did the answer stick to the sources?4g = Groundedness(threshold=0.7)5print(g(context="Paris is the capital of France.",6 response="Paris is the capital of France.").passed)78# 2. Did the agent pick the right tool?9t = ToolSelectionCorrectness(threshold=0.7)10print(t(task="Find a hotel in Paris",11 available_tools=["search_hotels", "send_email"],12 selected_tool="search_hotels").passed)
RAG
Did search bring back the right pages?
Did we fetch documents that match the question?
Is this one document useful for the question?
Did search find all the big pieces of evidence?
RAG
Is there enough in the pages to answer at all?
Do the sources hold enough to answer without guessing?
How much of the needed info is in the sources?
Can this question be answered from these sources at all?
When sources are empty, did it honestly say “I don't know”?
RAG
Does every line come from the pages, with nothing made up?
Is each sentence in the answer backed by the sources?
A yes or no: is every claim proven? One gap fails it.
Did the answer invent facts that aren't in the sources?
Did the answer use the useful facts it was given?
Is this single claim backed by the evidence?
Does the answer say the opposite of the sources?
Do two fetched sources disagree with each other?
RAG
Is the reply on topic, complete and correct?
Does the answer actually address what was asked?
Did the answer cover every part of the question?
Does the answer match the known correct answer?
RAG
Do the little [1] tags point to the right place?
Does each citation point to a source that says that thing?
Does every important claim have a citation?
Is the cited source really about this claim?
Agent
Did the agent get what you wanted, and finish it?
What does the user want — info, an action, or a fix?
Did the agent finish the job all the way?
Did the agent follow the instructions and limits?
Did the agent reach what the user truly wanted?
Agent
Right tool, right inputs, results actually used.
Which tool is the best one for this step?
Was the tool the agent picked the right one?
Was the tool called the right way?
Are the values sent to the tool correct?
Did the agent use what the tool gave back?
Was calling a tool really needed here?
Agent
Sensible order, no repeats, no going in circles.
Did the agent ask for the same thing twice?
Were the tool steps done in a sensible order?
Did the agent take the short way, without loops?
Agent
Is the last message true, complete and correct?
Is the final answer backed by what the tools returned?
Did the agent claim results that never happened?
Does the final message answer the user's request?
Did the final reply cover every part of the task?
Is the final result the correct one?
Agent
Follows the rules and can't be tricked.
Did the agent refuse actions it shouldn't or can't do?
Did the agent follow the house rules and safety limits?
Is the user trying to trick the assistant into ignoring its rules?
Is a hidden command tucked inside a web page or tool result?