Building with AI

Adding a Critic Step to a RAG Pipeline: I Tested Jev and Claude Sonnet

By Roupen Odabashian
Published  |  Updated  |  10 min read

Bottom line: Claude Sonnet was the better critic. Jev was fast and cheap, but it saved money, not time. And its maker, TypeSafe AI, doesn't currently sign BAAs, so I wouldn't send it a clinician's question.

Key takeaways

Recent research suggests that adding a critic step makes a RAG pipeline more accurate. I wanted to know if that holds in healthcare, and if a small, fast model could fill the seat. I ran the test on November 23, 2026.

What is a RAG pipeline?

RAG is short for retrieval-augmented generation. The model doesn't answer from memory. It first retrieves documents, then writes its answer from what it retrieved. A RAG pipeline is the chain of steps between the question and the answer.

That matters in medicine for two reasons. The answer can cite its sources, so a clinician can check it. And the answer can only be as good as the documents that reach the model. If the right guideline never gets there, the model can't use it.

What does a RAG pipeline look like?

A basic RAG pipeline has three steps:

  1. Retrieve. Search a collection for documents that may hold the answer.
  2. Rank. Put them in order and keep the best few. A model can only read so much.
  3. Generate. A model reads those few and writes the answer.

Real pipelines add more steps around these. I'm leaving those out. These three are the ones that matter here.

A flow from top to bottom. A question goes to retrieve (search a collection for documents that may hold the answer), then rank (put the documents in order and keep the best few), then generate (a model reads those few and writes the answer with citations), ending in an answer with citations.
Figure 1. A basic RAG pipeline: retrieve, rank, generate.

What is a critic step in a RAG pipeline?

A critic step is a model that reads each retrieved document and judges it before anything is ranked. It sits between retrieve and rank. It decides which documents move on.

The idea comes from Archon (Saad-Falcon and colleagues, 2024), a Stanford paper about getting better answers by combining several model calls. Each call has one job. Four of them:

I came across it in a Stanford CS329A lecture on test-time compute. The Archon part starts near minute 57. Archon works on candidate answers. I borrowed the shape for candidate documents: retrieve is the generator, rank is the ranker, and the model that writes the answer is the fuser. What was missing was the critic.

The same flow with a new step. A question goes to retrieve, then the critic (a new step: a model reads each retrieved document and says if it moves on to ranking), then rank, then generate, ending in an answer with citations.
Figure 2. The same pipeline with a critic step between retrieve and rank.

My hypothesis: what if the critic was Jev?

Based on that research, my hypothesis was that a critic between retrieve and rank, one that decides which documents go to the ranker, increases accuracy.

A critic is also an expensive step, because it reads every document for every question. So I added a second hypothesis. What if the critic was a decision model, a small fast model that only says yes or no to each document? If it could do the job, I would get the gain for a fraction of the time and money. My guess going in was that Jev would save me both.

What is Jev, and what are the types of AI?

Most people mean a language model when they say AI, a model like Claude Sonnet from Anthropic. It writes text and can reason through a problem. That makes it flexible, and slower and more expensive.

Jev is a different kind. It is a model from TypeSafe AI that returns answers a program can use directly, not text. You give it some content and a typed question. For a yes/no question it returns one number: the probability that the answer is yes.

TypeSafe calls this a System One model, after Daniel Kahneman's System 1, the fast and intuitive kind of thinking. Many people call them decision models. TypeSafe has asked people not to, so I'll use their name.

Two things made it interesting. It is fast. And it is cheap: $0.042 per million input tokens, with output free. A token is a small chunk of text, roughly three quarters of a word. Claude Sonnet 5.5 lists at $2 per million input tokens and $10 per million output tokens. That is almost 50 times more for every token read. The Jev version I used was jev-1.14.0.

What did I test?

I tried three models as the critic: Jev, Claude Sonnet 5.5 and the smaller Claude Haiku 5.5, both Claude models through Amazon Bedrock. Jev answered yes or no. The Claude models graded each document. Every critic worked on the same saved set of candidates, so when two setups differ, the critic is what differs.

I used two rulers, because each has a weakness:

How did Jev do as a RAG critic against Claude Sonnet and Haiku?

Jev kept the right papers in the list about as well as Sonnet did. It was clearly worse at getting the best ones to the top.

CriticAnswer-key papers in the final listIn the top 10Judge: AJudge: CTime addedCost per search
No critic38.322.7407960 s$0
Jev, yes/no47.026.3441160.7 sabout $0.006
Jev, probability sets the order45.026.352330.7 sabout $0.006
Claude Haiku 5.547.727.3not judgednot judged8.0 sabout $0.02
Claude Sonnet 5.546.332.055224.5 sabout $0.30

Answer key: out of 85, mean of 3 runs. Judge: out of 680 top-10 papers, one run. Time is the median the step adds to one search. Cost is at list prices.

Two bar charts with the same five rows. Answer-key papers in the top 10, out of 85: no critic 22.7, Jev yes/no 26.3, Jev probability 26.3, Haiku 5.5 27.3, Sonnet 5.5 32.0. Top-10 papers the judge marked A, out of 680: no critic 407, Jev yes/no 441, Jev probability 523, Haiku 5.5 not judged, Sonnet 5.5 552.
Figure 3. Critic accuracy on both rulers. The answer key is 12 questions, averaged over 3 runs. The judge is 68 questions, one run.

LLM reranker vs Cohere Rerank: which works best after Jev?

The LLM reranker, Sonnet. Jev filters well and orders poorly, so the obvious fix is a second model that only orders what Jev kept. That second model is a reranker. I tried three. In every row Jev passes on the same documents. Only the order changes.

Reranker after JevAnswer-key papers in the top 10Judge: AJudge: CReranker timeCost per search, with Jev
None26.3441160 sabout $0.006
Cohere Rerank 3.5, blended in at a light weight23.7402210.5 sabout $0.008 (my estimate)
Cohere Rerank 3.5 alone sets the order6.0179530.5 sabout $0.008 (my estimate)
Claude Haiku 5.528.051357.8 s (max 14.8)about $0.013
Claude Sonnet 5.531.756024.6 s (max 6.8)about $0.11

Jev adds 0.7 s in every row. In the Haiku run, the reranker left some documents ungraded in 2 of the 12 answer-key questions, so read that row as approximate.

Cohere made the list worse. Cohere Rerank is a relevance reranker: it scores how closely a document's text matches the question. I ran version 3.5 through Bedrock. The more weight I gave it, the worse the list got. It pushes down guidelines and landmark trials in favour of papers that repeat the question's words. In oncology, the paper you should cite is often not the one that sounds most like the question. I didn't test newer rerank models.

Sonnet brought the numbers back up: 31.7 answer-key papers in the top 10 and 560 A's from the judge. That is level with Sonnet doing the whole job alone.

Scatter plot of rerankers after Jev. Horizontal axis: median seconds the reranker adds. Vertical axis: top-10 papers the judge marked A, out of 680. No reranker: 0 seconds, 441. Cohere Rerank 3.5 at a light weight: 0.5 seconds, 402. Cohere Rerank 3.5 alone: 0.5 seconds, 179. Sonnet 5.5: 4.6 seconds, 560. Haiku 5.5: 7.8 seconds, 513.
Figure 4. Rerankers after Jev. Up is more accurate, left is faster. Jev's own 0.7 seconds is not included.

Is Jev plus Claude Sonnet better than Sonnet alone?

On accuracy it is a tie. On cost, Jev plus Sonnet wins. On time, it loses by a little.

Sonnet aloneJev, then Sonnet
Answer-key papers in the final list46.347.0
Answer-key papers in the top 1032.031.7
Judge: A, out of 680552560
Time added per search4.5 s5.3 s (0.7 + 4.6)
Cost per searchabout $0.30about $0.11

Question by question on the 68, Jev plus Sonnet was better on 24, the same on 29, and worse on 15. A sign test asks how often chance alone would give a split this uneven if the two designs were truly equal. The answer is about one time in five (p = 0.20). That is a tie.

So why didn't Jev save time? Sonnet reads documents side by side. Fewer documents means fewer tokens, which is the cost. It doesn't shorten the wait, because you still wait for the slowest read. And Jev adds its own 0.7 seconds first.

Two designs side by side. Sonnet alone: 32.0 answer-key papers in the top 10, out of 85, 4.5 seconds added per search, about $0.30 per search. Jev then Sonnet: 31.7 answer-key papers in the top 10, 5.3 seconds added per search, about $0.11 per search. Accuracy is a tie.
Figure 5. The two designs I compared. Same accuracy. Jev then Sonnet costs about a third as much and takes slightly longer.

How do Jev, Haiku and Sonnet compare as a critic?

Is Jev HIPAA compliant, and does TypeSafe AI sign a BAA?

By TypeSafe's own FAQ, not currently. So a clinician's question can't go to Jev if it might contain patient details. For me this was the deciding point.

A clinician may type patient details into a question, and in the US that can make it protected health information under HIPAA. The critic receives the question with every document it reads. A vendor that handles that data for you has to sign a business associate agreement (BAA), the contract that makes it responsible for protecting it.

Here is what I found on November 23, 2026:

I read that as a young product that has done real security work and hasn't taken on healthcare yet. "Currently" is their word, and it may change. It wasn't a problem in the test itself, because my questions are general one-liners with no patient information. It is a problem in a clinical product.

What are the limits of this test?

It is one day of testing on a small set of questions.

Bottom line

A critic step helped every time I tried it. Jev is a good fit for a high-volume yes/no filter with no patient data in it. For a clinical product, I'd use Sonnet alone: same accuracy as Jev plus Sonnet, the question stays inside a cloud where a BAA is available, and it costs about 19 cents a search more. If TypeSafe starts signing BAAs, I'll rerun this test.

Sources

  1. Saad-Falcon J, et al. Archon: An Architecture Search Framework for Inference-Time Techniques. arXiv:2409.15254, 2024. arxiv.org/abs/2409.15254.
  2. Stanford Online. Stanford CS329A Self-Improving AI Agents, Part 2: Test-Time Compute Scaling. The Archon part starts near minute 57.
  3. TypeSafe AI. Models (Jev versions and price), System One, Noul, the yes/no question type, and Don't Call It a Decision Model.
  4. TypeSafe AI. Enterprise page and FAQ (BAA, data handling) and Trust Center. Checked November 23, 2026.
  5. Anthropic. Claude pricing. Checked November 23, 2026.
  6. Amazon Web Services. HIPAA Eligible Services Reference and Amazon Bedrock. Checked November 23, 2026.
  7. Cohere. Rerank.
Roupen Odabashian

About the author

Roupen Odabashian is a medical oncologist in British Columbia and the founder of MeDucation AI and Alma. He taught himself to code during fellowship and now builds software with AI every day.

More about Dr. Odabashian  ·  All writing  ·  YouTube