Run a small eligibility check before evaluating an expensive second stage. Measure how many eligible cases the screen loses at your intended cutoff.
Library search
Ask whether a message concerns the library before retrieving documents and grading passages. A positive screen triggers retrieval and a fresh request for each candidate.
Screen the query
{
"model": "ngila-judge",
"state": "Where can I return a rental bike?",
"questions": {
"eligible": {
"type": "noul",
"instructions": "Does the query concern the library or its services?"
}
}
}Evaluate retrieved passages
When eligibility clears your cutoff, fetch passages and apply the same rubric to each one.
{
"model": "ngila-judge",
"state": {
"query": "Where can I return a rental bike?",
"passage": "Bikes may be returned to any staffed rental station."
},
"questions": {
"relevance": {
"type": "score",
"instructions": "Does the passage answer the query?",
"criteria": [
"Unrelated",
"Partially relevant",
"Direct answer"
]
}
}
}Apply the result
Measure the fraction of relevant messages lost at the first stage, alongside the work saved on irrelevant traffic. In this fragment, a is the answers object.
if a["eligible"]["noul"] >= threshold:
passages = retrieve_library_passages(query)