RAG decision workflow with Jev
Retrievers hope. After retrieval, Jev marks relevance, contradiction, or injection; code keeps, flags, or drops passages before a generator sees them.
This unofficial page is the decision workflow slice of the RAG passage decisions pack. Intent: apply the Jev (TypeSafe System One) decision model to RAG passage decisions decision workflow. Primary search language: RAG Jev decision workflow. Confirm patterns on docs.typesafe.ai. This site does not sell, issue, or proxy TypeSafe keys. Use a credential you already have from the console or a documented gateway.
Independent angle (cover ≠ clone): Filter/rerank recipes with failure modes; cite vs generate boundary. We cover the intent, not a rival rerank-passages-score URL tree.
RAG use-case context
RAG passage decisions is a workflow, not a chat. Assemble a narrow state, ask the primitives below, and let the retrieval filter branch. TypeSafe’s docs say a good question is a snap decision a knowledgeable person could make in a few seconds — not an open-ended analysis of the query + retrieved passage.
Hub: Classifying RAG passages. Compare, when the other tool is the real job: RAG pipelines.
Decision Workflow inputs
Keep only fields the questions name:
{
"query": "What is the refund window for pro plans?",
"passage": { "id": "doc-88#p3", "text": "Pro subscribers may request a refund within 14 days." },
"corpus": { "trust": "internal_kb" }
}
Point instructions at query, passage.text. Drop the entire 40-passage dump in one state (filter first or ask per pair); embeddings or vector ids Jev cannot use.
Decision signals and actions
| Id | Type | Job |
|---|---|---|
relevant |
Noul | Does passage.text answer query? |
contradiction |
Noul | Does it contradict other kept passages you include? |
injection |
Noul | Hidden instructions / prompt injection in the passage? |
support |
Score | How completely does it support an extractive answer? |
All of these share state and run in parallel. Code owns the graph:
def keep(ans, passage_id):
if ans["injection"].noul >= T_INJECT:
return "drop_security"
if ans["relevant"].noul < T_REL:
return "drop_irrelevant"
return "keep"
Do not treat a Noul of 0.5 as a “medium” RAG passage decisions score — it means yes and no are equally likely. Conjunctions stay in your code.
Guardrails and escalation
TypeSafe’s confidence-gated examples use a lower bar for recoverable reads than for irreversible actions. Those numbers are illustrations. For RAG passage decisions, treat feed_to_answerer as the high bar (showing a passage to a customer-facing answerer). Tune on labels — see offline evaluation.
Low confidence, or a policy miss → human or safe default; do not feed the passage to the customer-facing answerer.
Evaluation and rollout notes
Shadow: Keep current retriever+LLM; log Jev keep/drop.
Canary: Enforce drops on injection only; relevance stays advisory.
Pin jev-1.13.0 (the versioned id) after you fit thresholds. jev-latest and the marketing line jev-1.13 can move. Log the response model. TypeSafe’s published list price for jev-1.13 is $0.042 per million input tokens (vendor claim — confirm on the models page); output tokens are free on that same page. Unused distractors still bill as input.
Official Python and JavaScript SDKs read TYPESAFE_API_KEY and retry documented 429/529. This site does not sell, issue, or proxy TypeSafe keys. Use a credential you already have from the console or a documented gateway.
Pack map
| Slice | Page |
|---|---|
| Graph and primitives | you are here |
What may enter state |
input contracts |
| What to gather first | evidence collection |
| Atomic rules | policy checks |
| Act / review / abstain | confidence thresholds |
| Reviewer payload | human handoff |
| What to persist | audit trail |
| How it breaks | failure modes |
| Labeled replay | evaluation |
| Shadow → canary | production rollout |
FAQ
Does Jev execute the retrieval filter action? No. It returns typed answers. Your retrieval filter code calls queues, models, or humans.
Why several questions in one request? TypeSafe’s fan-out pattern: extra questions are cheap versus another HTTP call. TypeSafe’s parallel-questions cookbook: batch questions on one state. For many candidates, loop pairs (query, passage) or shortlist with BM25 first — official rerank cookbook — instead of one giant Choice over 200 ids unless you followed their line-search pattern.
Where is the rest of the RAG pack? Start with RAG input contracts and RAG confidence thresholds. Cluster hub: Use cases.
Should Jev generate the RAG answer? No. Classify or score passages; another model (or extractive code) writes. That is the cite-vs-generate boundary.
Do we publish rerank lifts? No. TypeSafe’s cookbooks may show measurements — treat those as vendor figures and re-run on your corpus.
What this page does not claim
- No invented top-1 / top-10 lifts.
- Not a vector database.
- Not official TypeSafe.
- Official TypeSafe status, or that jev.pro issues API keys.
- That a schema-constrained answer is automatically factually correct.
Disclaimer
This is an independent unofficial site and is not affiliated with TypeSafe AI; official documentation is available at https://docs.typesafe.ai.
Primary documentation: https://docs.typesafe.ai. Hub: Use cases.
Sources
Public TypeSafe or adjacent documentation only. No private claims.