Decision models in agentic RAG: nine checkpoints.
A useful business assistant needs to know when to search again, which evidence to keep and when a person must decide. This guide maps nine places to test those judgments, with Jev as one possible decision model.
Sources checked 24 October 2026
Conceptual architecture, not a connected demonstration. Our current AI Lab runs local OCR and MiniLM passage retrieval; it does not run Jev, hybrid RAG, generated answers or business-system actions. This article makes no model calls or document uploads.
Read the diagram as text
1 · 2 · Screen and route
Code policy. Model signals inform approved routes; access stays in code.
Retrieve permitted sources
Source evidence. Keyword and vector search return a bounded shortlist.
4 · Judge candidate passages
Model estimate. Ask independent questions about each passage.
Build the retained set
Code policy. Apply tested thresholds; keep source IDs and conflicts.
3 · Check retained evidence
Model estimate. A later check asks whether this set covers the question.
Draft from the evidence
LLM draft. Use the query and retained passages; preserve citations.
5 · 6 · Verify and authorize
Code policy. Check support; enforce permissions and required approval.
7 · Finish or stop for review
Model estimate. Check acceptance criteria. Hard limits always apply.
8 · Retry within the budget
Code policy. Keep policy and sources. Budget spent? Stop for review.
Return or report unresolved work
Human review. Return supported results; abstain or seek review at the limit.
9 · Evaluate authorized traces
Trace evaluation. Version checks and audit the judge against human labels.
Connections and alternatives
- Screen and route → Retrieve permitted sources
- Retrieve permitted sources → Judge candidate passages
- Judge candidate passages → Build the retained set
- Build the retained set → Check retained evidence
- Check retained evidence → Draft from the evidence (Yes)
- Draft from the evidence → Verify and authorize
- Verify and authorize → Finish or stop for review
- Check retained evidence → Retry within the budget (Retry)
- Finish or stop for review → Retry within the budget (Retry)
- Retry within the budget → Retrieve permitted sources (Retry)
- Verify and authorize → Evaluate authorized traces (Trace)
- Finish or stop for review → Return or report unresolved work (Done)
- Retry within the budget → Return or report unresolved work (Stop)
- RAG
- Retrieval-augmented generation: give a writing model selected source material alongside a question.
- Agentic workflow
- A workflow that can choose among permitted next steps, such as another search or a review request.
- Decision model
- A model that returns typed judgments about supplied information rather than writing a free-form answer.
- Threshold
- An application rule that converts a model estimate into a route, such as retain, review or stop.
What does the decision layer add?
Separate writing from judgment. An assistant answering an expense-policy question may find documents, compare versions, draft a reply and propose a ticket. Each transition needs a rule. A fluent final answer cannot establish that those earlier choices were sound.
Jev is one implementation. TypeSafe’s decision API accepts supplied state and named questions, returning typed results. A yes/no question can return an estimated probability of yes. This is neither proof of truth nor a written explanation; preserve the evidence that a reviewer needs. [1][3]
Calibration still needs evaluation. Calibration describes how probabilities match observed outcomes across groups of predictions. It does not guarantee one answer. Test reliability on the documents, languages and risk categories you actually use. [5]
Batch independent questions. Checks sharing the same supplied state can travel together. They do not consume one another’s answers within that request. In the architecture below, code first filters passages; a later check receives the actual retained set. [2]
1–2. Choose the route and screen the boundaries.
Match the task to an approved handler. A lookup, ambiguous request and specialist review need different paths. Evaluate routing by the task and its consequences; an expensive or larger model is not automatically correct. [4]
Screen at both ends. Separate checks can flag sensitive input or unsupported output. A prompt-injection estimate can be useful, but it cannot grant access or replace isolation, limited privileges and approval. [10][11]
Read the diagram as text
A business request
Source evidence. Question, permitted context and a known user scope.
1 · 2 · Independent semantic checks
Model estimate. Which task? Which hazards? Is clarification needed?
Apply the approved policy
Code policy. Enforce scope, approved handlers and cost limits.
Proceed or seek review
Code policy. Choose an allowed handler, clarify or decline the task.
Connections and alternatives
- A business request → Independent semantic checks
- Independent semantic checks → Apply the approved policy
- Apply the approved policy → Proceed or seek review
Model routing
Which approved handler fits this request?
Code restricts the available handlers, data scope and budget; uncertain cases can go to a reviewer.
Guardrails
Does this input or draft raise a defined hazard?
Keep separate hazard checks and explicit review or stop routes. A score does not override access policy.
4 → 3. Filter the evidence, then ask whether it is enough.
Retrieve a broad, bounded shortlist. Hybrid search combines keyword and vector results; rank fusion can merge their lists. Exact identifiers and paraphrases may both matter. Retrieval still sets the ceiling: no reranker can recover a missing candidate. [6][8]
Ask precise candidate questions. Is a passage useful evidence, a contradiction, or merely related? Keep source identifiers and conflicts visible. Application code applies the evaluated filtering and ranking policy; similarity and yes probabilities are different quantities. [7]
Check what survived. Once code has retained the passages, ask whether that set supports every required part of the answer. A check on the original shortlist cannot establish sufficiency of a different subset. Missing evidence leads to a bounded retry, clarification or an honest no-answer response. [2]
Read the diagram as text
Hybrid retrieval shortlist
Source evidence. Merge keyword and vector ranks; preserve source access.
4 · Judge each candidate
Model estimate. Estimate relevance, evidence and conflicting statements.
Filter in application code
Code policy. Use versioned thresholds to form the actual kept set.
3 · Check this set afterwards
Model estimate. Does the retained evidence cover all required parts?
Draft with kept passages
LLM draft. Evidence sufficient? Produce a source-linked draft.
Retrieve, clarify or abstain
Code policy. No evidence? Use bounded retries or return for review.
Connections and alternatives
- Hybrid retrieval shortlist → Judge each candidate
- Judge each candidate → Filter in application code
- Filter in application code → Check this set afterwards
- Check this set afterwards → Draft with kept passages (Yes)
- Check this set afterwards → Retrieve, clarify or abstain (No)
- Retrieve, clarify or abstain → Hybrid retrieval shortlist
Illustrative P(usable evidence). C1: 0.92; C2: 0.74; C3: 0.18. Example estimates, not measured. At threshold 0.80, retain C1; exclude C2/C3. Evaluate your own policy.
Passage filtering and reranking
Which candidates provide usable evidence or a relevant conflict?
Code retains, excludes and orders candidates using reviewed policy; keep provenance attached.
Retrieval sufficiency
Does the retained set cover this question?
Check after filtering. If evidence is insufficient, retry within limits, clarify or abstain.
5–6. Verify support before a draft becomes an action.
A citation needs to support its claim. Finding a source link is not enough. Check exact quotations mechanically, then assess whether the cited passage supports, contradicts or fails to address the draft proposition. Disputes and missing context need review. [9]
Permission is a separate decision. A proposed action can be semantically plausible yet unauthorized. The application validates identity, access, arguments and required approval before execution. A positive model score never authorizes a payment, email or record change. [11]
Read the diagram as text
A draft claim or action
LLM draft. Keep the claim, source ID and proposed tool arguments.
5 · Does the source support it?
Model estimate. Support, contradiction and absence need different routes.
6 · Enforce action authority
Code policy. Check source IDs, permissions, arguments and limits.
Approve, ask or deny
Human review. Required approval precedes action; verify its result.
Connections and alternatives
- A draft claim or action → Does the source support it?
- Does the source support it? → Enforce action authority
- Enforce action authority → Approve, ask or deny
Citation checking
Does this source support this particular claim?
Preserve claim-to-source links and document versions; disputed conclusions go to review.
Tool-call gating
Is this proposed action consistent with the request?
Code enforces allow, ask or deny; validate permissions and arguments before any approved execution.
7–8. Keep the loop finite and the context accountable.
“Done” needs acceptance criteria. An assistant may believe it has finished while a required part is missing. Compare results with explicit criteria. Hard iteration, elapsed-time and cost ceilings stop work regardless of a model’s desire to continue. [13]
Select context without erasing obligations. Removing irrelevant or stale material can reduce clutter. Preserve required policy, source provenance, unresolved conflicts and necessary task state. Context selection is not permission to delete audit records or silently alter retention policy. [12]
Read the diagram as text
7 · Compare with acceptance criteria
Model estimate. Does the result satisfy the specific requested task?
Enforce the hard budget
Code policy. Attempts, elapsed time and cost cannot be extended by a score.
8 · Keep the necessary context
Code policy. Preserve policy and source IDs; remove stale duplicates.
Try the next bounded step
Source evidence. Retrieve or revise only when policy still permits it.
Finish or report unresolved work
Human review. Complete tasks return; exhausted budgets go to review.
Connections and alternatives
- Compare with acceptance criteria → Enforce the hard budget
- Enforce the hard budget → Keep the necessary context (Retry)
- Keep the necessary context → Try the next bounded step
- Try the next bounded step → Compare with acceptance criteria
- Enforce the hard budget → Finish or report unresolved work (Stop)
Loop termination
Does the result satisfy the stated acceptance criteria?
Code enforces hard limits; unresolved work ends in a visible incomplete result or human handoff.
Context selection
Which material remains useful for the next step?
Retain required instructions and provenance. Selecting context is distinct from summarizing or deleting records.
9. Observe more traces, and keep testing the judge.
Coverage and accuracy answer different questions. Running a check on every recorded trace can broaden monitoring coverage. It does not prove that every verdict is correct or every failure is covered. Keep human-labelled examples, inspect disagreements and report unavailable or failed evaluations. [14]
Make changes comparable. Version the model, question wording, source set and threshold policy. Measure false approvals, missed evidence, abstentions, reviewer effort and end-to-end cost and latency against the current workflow. Test on held-out cases before changing production policy.
Tracing is evidence of execution. Opik can record TypeSafe calls and evaluation results. The external patchy631/jev-as-judge repository demonstrates a tutorial approach; it is its author’s work, not a GTC deployment. A recorded experiment is not a quality certificate. [15][19]
Read the diagram as text
A permitted, minimized trace
Source evidence. Retain only evidence the evaluation is authorized to use.
9 · Apply the versioned rubric
Model estimate. Estimate support, request coverage and action honesty.
Compare with human labels
Human review. Review errors, difficult cases and distribution changes.
Track quality and overhead
Trace evaluation. Measure quality, cost and latency before expanding coverage.
Connections and alternatives
- A permitted, minimized trace → Apply the versioned rubric
- Apply the versioned rubric → Compare with human labels
- Compare with human labels → Track quality and overhead
Trace evaluation
Does this trace meet a named, testable criterion?
Audit the judge against human labels, preserve raw results and versions, and expose missing evaluation coverage.
Three business workflows worth testing.
Start with an accountable decision. These are illustrative pilot ideas, not completed client projects or measured savings. Each needs authorized sources, a process owner and a clear point where the system must stop.
Administration: an internal policy inbox
- Business question
- An employee asks which documents an equipment request needs.
- Proposed workflow
- Retrieve the current procedure, filter relevant passages and check whether it covers the employee’s circumstances. Missing contractor rules trigger clarification.
- Human responsibility
- The administrator resolves policy gaps and approves any ticket-creation action.
- Possible deliverable
- A source-linked draft reply or a clearly explained handoff.
- Pilot measures
- Supported answers, missed policy conditions, abstentions and handling time.
Law firms: matter-scoped research support
- Business question
- A lawyer needs the termination provisions for one authorized matter.
- Proposed workflow
- Restrict retrieval by matter before scoring; keep amendments, conflicting clauses and document versions visible. Check each draft proposition against its source.
- Human responsibility
- The lawyer assesses applicability and approves advice. A probability cannot establish a legal conclusion.
- Possible deliverable
- A review packet of clauses, source links and unresolved questions.
- Pilot measures
- Retrieval recall, citation support, missed amendments and cross-matter access failures.
Finance: expense-policy exception triage
- Business question
- A team receives a receipt and a reimbursement exception request.
- Proposed workflow
- OCR and field checks precede policy retrieval. Code calculates amounts and dates; decision checks flag possible exceptions and evidence gaps.
- Human responsibility
- A finance reviewer decides the exception; payment approval and execution remain separate.
- Possible deliverable
- A draft recommendation with the policy, source receipt and missing information.
- Pilot measures
- False approvals, missed exceptions, review volume and trace completeness.
Turn the architecture into a bounded pilot.
Agree the decision before selecting the model. Choose one recurring task and the mistakes that matter. A pilot should reveal whether a decision layer improves that workflow enough to justify operating it, including the cost of review and failures.
Scope the data boundary. A hosted Jev integration sends selected state to a provider. Agree permitted data, hosting, access, retention and contractual terms before connecting records. Nothing in this article activates that integration. [16]
- One task, a named owner and approved English/Arabic requirements.
- A representative labelled set, including missing, conflicting and hostile evidence.
- A baseline and held-out tests with acceptance criteria for consequential errors.
- Versioned questions, models and policy, with explicit review and no-answer routes.
- An access design, operating limits, monitoring owner and rollback plan.
Sources, inspiration and scope
Technical claims were checked against the primary documentation below on 24 October 2026. Original GTC prose and diagrams were inspired by the nine-checkpoint illustration credited to Aurimas Griciūnas / SwirlAI, and by Akshay Pachaar and Daily Dose of Data Science. Their artwork is not reproduced. Vendor documentation and external tutorials do not establish GTC results; features can change.
- TypeSafe · Typed decision questions
- TypeSafe · Independent questions in one request
- TypeSafe · Reading a yes probability
- TypeSafe · Confidence and decision policies
- TypeSafe · Calibration across groups of predictions
- Microsoft · Hybrid search and rank fusion
- TypeSafe · Classifying retrieved passages
- TypeSafe · Reranking a retrieved shortlist
- TypeSafe · Checking citations
- TypeSafe · Input and output guardrail examples
- OWASP · Prompt injection and layered controls
- LangGraph · Graph nodes, edges and transitions
- LangGraph · Hard step limits
- Comet Opik · Decision-model evaluation rules
- Comet Opik · TypeSafe tracing integration
- TypeSafe · Submitted data and retention
- Inspiration · Akshay Pachaar’s Jev/RAG explanation
- Inspiration · Daily Dose of Data Science
- External tutorial · patchy631/jev-as-judge