Did we fetch documents that match the question?
Docs →Open source · MIT · Python
A quiet check for every answer your AI gives.
LayaEval sits around your agent or RAG app. It reads what goes in and what comes out, and tells you in milliseconds whether the answer is true, safe and complete.
Free and open source. No account, no server: it runs on your machine.
How it works
Three steps from pip install to a verdict.
- Step 1
Plug in
Install with pip. Works next to any agent or RAG app: LangChain, LlamaIndex, CrewAI or your own code.
- Step 2
Pick checks
Choose from 42 ready checks. Each one asks a single plain question, like “did it make anything up?”
- Step 3
Get a verdict
Every check returns pass or fail, a score and a confidence. Fast enough to run on every request.
Quickstart
Two checks, ten lines.
No account, no server. Everything runs on your own machine. Swap in any of the 42 checks below; they all work the same way.
from layaeval import Groundedness, ToolSelectionCorrectness
# 1. Did the answer stick to the sources?g = Groundedness(threshold=0.7)print(g(context="Paris is the capital of France.", response="Paris is the capital of France.").passed)
# 2. Did the agent pick the right tool?t = ToolSelectionCorrectness(threshold=0.7)print(t(task="Find a hotel in Paris", available_tools=["search_hotels", "send_email"], selected_tool="search_hotels").passed)The checks
42 checks, one plain question each.
Flip any example between pass and fail to see what the check catches. Open one for its code and parameters.
RAG Evaluation
Finding
Did search bring back the right pages?
RAG Evaluation
Enough to answer
Is there enough in the pages to answer at all?
RAG Evaluation
Staying truthful
Does every line come from the pages, with nothing made up?
Is each sentence in the answer backed by the sources?
Docs →A yes or no: is every claim proven? One gap fails it.
Docs →Did the answer invent facts that aren't in the sources?
Docs →Did the answer use the useful facts it was given?
Docs →Is this single claim backed by the evidence?
Docs →Does the answer say the opposite of the sources?
Docs →Do two fetched sources disagree with each other?
Docs →RAG Evaluation
Answer quality
Is the reply on topic, complete and correct?
RAG Evaluation
Citations
Do the little [1] tags point to the right place?
AI Agent Evaluation
Understanding the job
Did the agent get what you wanted, and finish it?
AI Agent Evaluation
Using tools
Right tool, right inputs, results actually used.
Which tool is the best one for this step?
Docs →Was the tool the agent picked the right one?
Docs →Was the tool called the right way?
Docs →Are the values sent to the tool correct?
Docs →Did the agent use what the tool gave back?
Docs →Was calling a tool really needed here?
Docs →AI Agent Evaluation
Taking the path
Sensible order, no repeats, no going in circles.
AI Agent Evaluation
Final result
Is the last message true, complete and correct?
Is the final answer backed by what the tools returned?
Docs →Did the agent claim results that never happened?
Docs →Does the final message answer the user's request?
Docs →Did the final reply cover every part of the task?
Docs →Is the final result the correct one?
Docs →AI Agent Evaluation
Staying safe
Follows the rules and can't be tricked.
Did the agent refuse actions it shouldn't or can't do?
Docs →Did the agent follow the house rules and safety limits?
Docs →Is the user trying to trick the assistant into ignoring its rules?
Docs →Is a hidden command tucked inside a web page or tool result?
Docs →Catch the wrong answer before your users do.
One install, 42 checks, no account. Read the recipes when you want to go deeper.