JEV USE CASE
RAG Passage Filtering.
Score retrieved passages for relevance, answer support, contradiction and prompt-injection risk before generation.
THE DECISION CONTRACT
STATE
Question, candidate passage, source metadata and retrieval score.
QUESTION
How useful is this passage for answering the question?
CHOICES
reject supporting direct_evidence contradictory
TYPESCRIPT EXAMPLE
Ask for one bounded answer
This Vercel AI SDK-shaped example is illustrative. Check the current provider documentation before shipping.
import { experimental_evaluate as evaluate } from 'ai';
const result = await evaluate({
model: 'typesafe-ai/jev',
state: "Question, candidate passage, source metadata and retrieval score.",
questions: {
decision: {
type: 'choice',
instructions: "How useful is this passage for answering the question?",
options: ["reject","supporting","direct_evidence","contradictory"]
}
}
});
// Validate permissions and thresholds before acting.
console.log(result.answers.decision);SAFE IMPLEMENTATION
Keep the boundary clear
Guardrail
Keep source provenance and exact citations. Jev can rank evidence; it does not make an unsupported passage true.
- Log the input, answer distribution, chosen threshold and resulting route.
- Test on labelled examples from your own production distribution.
- Send low-confidence, high-impact or out-of-distribution cases to a safer fallback.
- Re-evaluate thresholds when the model or workflow changes.
PRIMARY SOURCES