Classifying RAG passages

Score each retrieved passage before it reaches the answering model.

Classification
Result
Passage routing decided in code from Jev probabilities

Lexical retrieval ranks wording, not truth. This Jev classification use case sits between retrieval and generation.

Each query-passage pair gets several questions in one call. The answers decide whether the passage is evidence, a conflict, or junk.

The cookbook plants a prompt-injection passage among lookalike auth docs so the routing rules have something to catch.

Pipeline

  1. Retrieve candidate passages
  2. Ask Jev relevance, contradiction, and injection questions
  3. Keep evidence, flag conflicts, drop injections
  4. Hand only the routed blocks to the answering model

Builder: TypeSafe cookbook. Stack: jev.