<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kartik N V J K</title>
    <description>The latest articles on DEV Community by Kartik N V J K (@kartik-nvjk).</description>
    <link>https://dev.to/kartik-nvjk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3977738%2F99b8e069-3afe-49cf-a409-0f52b82c22b6.jpg</url>
      <title>DEV Community: Kartik N V J K</title>
      <link>https://dev.to/kartik-nvjk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kartik-nvjk"/>
    <language>en</language>
    <item>
      <title>My agent passed every check I wrote. The product manager said it solved the wrong problem.</title>
      <dc:creator>Kartik N V J K</dc:creator>
      <pubDate>Fri, 27 Nov 2026 18:34:20 +0000</pubDate>
      <link>https://dev.to/kartik-nvjk/my-agent-passed-every-check-i-wrote-the-product-manager-said-it-solved-the-wrong-problem-3hp7</link>
      <guid>https://dev.to/kartik-nvjk/my-agent-passed-every-check-i-wrote-the-product-manager-said-it-solved-the-wrong-problem-3hp7</guid>
      <description>&lt;p&gt;I built a support agent for order questions. It looked up the order number, checked the shipping status, and drafted a notification email for the customer.&lt;/p&gt;

&lt;p&gt;My eval suite was green. The tool calls hit the right APIs with the right arguments. The emails matched the schema. Nothing made up a tracking number.&lt;/p&gt;

&lt;p&gt;Then the product manager on the project read through a batch of conversations with me. On one of them, the agent had done everything my checks asked for. It found the order, reported the status, and drafted a clean email. The customer had written in to change the delivery address.&lt;/p&gt;

&lt;p&gt;Every check I had written asked whether the agent did the job correctly. None of them asked whether it was doing the job the user came for.&lt;/p&gt;

&lt;h2&gt;
  
  
  An agent gets graded on two questions
&lt;/h2&gt;

&lt;p&gt;The question I was asking is the engineering one. Is the agent solving the problem correctly? Is the reasoning sound, are the tool calls correct and secure, and does it stay efficient and stable under load?&lt;/p&gt;

&lt;p&gt;The product manager was asking the other one. Is the agent solving the right problem? Did it understand what the user wanted, did it finish the task, and would the user trust the exchange?&lt;/p&gt;

&lt;p&gt;Both are evaluation. They need different metrics.&lt;/p&gt;

&lt;p&gt;The engineering list is task adherence and planning accuracy, tool-call accuracy (precision, recall and correctness of each call), hallucination and error rate, and latency, tokens and dollars per task.&lt;/p&gt;

&lt;p&gt;The product list is intent resolution, task completion rate, user feedback and satisfaction, and one I had never scored at all: whether an answer that is not exact is still helpful.&lt;/p&gt;

&lt;p&gt;My suite only had the first list.&lt;/p&gt;

&lt;h2&gt;
  
  
  Small step errors compound across a run
&lt;/h2&gt;

&lt;p&gt;An agent makes a chain of decisions, so the eval has to score the whole trajectory.&lt;/p&gt;

&lt;p&gt;If each step fails 5% of the time, a five-step run fails about 23% of the time.&lt;/p&gt;

&lt;p&gt;That is why per-step checks matter. They catch a low-confidence output at the step where it happens, before later steps build on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agree on what done means before anyone writes a check
&lt;/h2&gt;

&lt;p&gt;What fixed this was a conversation before the next round of work. We answered three questions together.&lt;/p&gt;

&lt;p&gt;Which multi-step task is the agent for? How do we measure success: task completion rate, decision accuracy, or cost per resolution? What are the guardrails: which tools can it call, and what data can it touch?&lt;/p&gt;

&lt;p&gt;Once those answers were written down, both lists of metrics had something to point at.&lt;/p&gt;

&lt;h2&gt;
  
  
  Product writes the stories and engineering breaks them
&lt;/h2&gt;

&lt;p&gt;Test scenarios now come from both sides. The product manager brings user stories that outline the ideal paths, drawn from what users actually ask for. I add the edge cases. What happens if the shipping API is down? What happens if the order number is wrong?&lt;/p&gt;

&lt;p&gt;A customer who wants a new delivery address is a user story. It was never going to show up in my edge cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the logs and the strange decisions together
&lt;/h2&gt;

&lt;p&gt;We also read logs side by side. I check whether the execution was right. The product manager checks whether it matched the business goal.&lt;/p&gt;

&lt;p&gt;Agents do things nobody planned. When one of those decisions shows up, it gets reviewed by both of us.&lt;/p&gt;

&lt;p&gt;I ask what data it used, which function it called, and why. The product manager asks whether the decision was actually wrong or just surprising, and whether it followed a business rule or found a creative workaround.&lt;/p&gt;

&lt;p&gt;Reviewing these together sharpened the agent's logic and our eval metrics at the same time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Every eval layer has a product half and an engineering half
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Tracing.&lt;/strong&gt; Engineering logs every step of the reasoning loop: the plan, each tool call's input, and each output. Product decides which user-journey milestones the traces must capture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Testing.&lt;/strong&gt; Engineering owns most of the synthetic and adversarial tests: rare edge cases, contradictory user goals, faulty API responses, prompt injection, data leakage and bad error handling. Product owns most of the real-world side: a golden dataset built from real user interactions, which becomes the regression baseline, plus human review where automation cannot judge tone, helpfulness or brand fit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automated scoring.&lt;/strong&gt; Engineering writes code-based evaluators for JSON formatting, schema adherence and factual consistency against a database. Product configures the LLM-as-judge evaluators: helpfulness, summary quality and intent alignment. The results feed prompt and configuration changes, and the suite runs again. Wire it into CI so a regression fails the build.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would tell myself before building an agent eval suite
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ask both questions:&lt;/strong&gt; solving the problem correctly and solving the right problem need separate metrics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Define done together:&lt;/strong&gt; the task, the success measure and the guardrails come before the first check.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source scenarios from both sides:&lt;/strong&gt; user stories from product, edge cases from engineering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review surprises jointly:&lt;/strong&gt; a surprising decision is not automatically a wrong one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Split every layer by owner:&lt;/strong&gt; tracing, tests and judges each need a product half and an engineering half.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full framework, with the three layers and how each team owns its part, is in &lt;a href="https://futureagi.com/blog/agentic-ai-evaluation-2025/?utm_source=fagiDevto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=blogdistribution" rel="noopener noreferrer"&gt;this piece&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Who writes the success criteria for your agent evals? On my project it was only me, and that was the problem.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>testing</category>
      <category>llm</category>
    </item>
    <item>
      <title>I let my agent call its tools in parallel. One of them needed another one's answer.</title>
      <dc:creator>Kartik N V J K</dc:creator>
      <pubDate>Mon, 23 Nov 2026 16:49:06 +0000</pubDate>
      <link>https://dev.to/kartik-nvjk/i-let-my-agent-call-its-tools-in-parallel-one-of-them-needed-another-ones-answer-phg</link>
      <guid>https://dev.to/kartik-nvjk/i-let-my-agent-call-its-tools-in-parallel-one-of-them-needed-another-ones-answer-phg</guid>
      <description>&lt;p&gt;I wanted my support agent to feel faster, so I stopped making it wait on itself. The job was small. Look up a customer's account, pull their recent orders, and write a short summary for the support team.&lt;/p&gt;

&lt;p&gt;The model could request both tool calls in one turn, and my harness ran them side by side. Latency dropped. Then a summary came back describing orders that belonged to a different customer.&lt;/p&gt;

&lt;p&gt;Nothing had failed. Both tools returned a normal result. The order lookup needed the account ID, and the account ID only existed after the first call finished. The model had asked for both calls in the same turn, so it filled the order lookup with a search on the customer's name. The search matched someone else, and the summary was written on top of that.&lt;/p&gt;

&lt;p&gt;This is what I check now before I let tool calls run in parallel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Parallel tool calls are something you switch off, not on
&lt;/h2&gt;

&lt;p&gt;On Anthropic's API, parallel tool use is on by default. You turn it off with &lt;code&gt;disable_parallel_tool_use: true&lt;/code&gt; inside &lt;code&gt;tool_choice&lt;/code&gt;, which allows at most one tool call per response.&lt;/p&gt;

&lt;p&gt;On OpenAI's API, the model may call several functions in one turn. Setting &lt;code&gt;parallel_tool_calls&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt; limits it to zero or one call.&lt;/p&gt;

&lt;p&gt;Google's Gemini docs describe two modes: parallel function calling for independent calls, and compositional function calling for calls that have to run in order.&lt;/p&gt;

&lt;p&gt;None of these settings know which of your tools depends on another.&lt;/p&gt;

&lt;h2&gt;
  
  
  A parallel call cannot see the result it depends on
&lt;/h2&gt;

&lt;p&gt;When the model asks for two calls in one turn, it writes the arguments for both before either one runs. If the second call needs a value from the first, there is nothing real to put there.&lt;/p&gt;

&lt;p&gt;The model does not always stop. It can fill the gap with something that looks plausible from the conversation.&lt;/p&gt;

&lt;p&gt;That is what makes this hard to spot. The tool gets a well-formed argument and returns a well-formed answer. It is just the answer to the wrong question.&lt;/p&gt;

&lt;h2&gt;
  
  
  A benchmark caught a model doing the same thing
&lt;/h2&gt;

&lt;p&gt;TPS-Bench (ACL 2026) tests agents on tasks that need many tools spread across MCP servers. On its hard set, GLM-4.5 made extensive sequential calls and completed 64.72% of tasks, at an average of 217.8 seconds per task. GPT-4o leaned on parallel calls, averaged 76.84 seconds, and completed 45.08%.&lt;/p&gt;

&lt;p&gt;The authors also describe QwQ-32B, which "often invokes multiple tools simultaneously, even when certain tools rely on the outputs of others". It completed 29.36%.&lt;/p&gt;

&lt;p&gt;These are different models, so the numbers do not prove that sequential calls cause better results. What I take from them is narrower. How a model schedules tool calls is a behavior of that model, it varies, and the model will not always notice a dependency for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  I sort each task's tools into independent and dependent
&lt;/h2&gt;

&lt;p&gt;For every task, I now write down which calls can run together and which need an earlier result. Fetching an account and fetching the product catalog do not depend on each other, so they can run in parallel. Anything that takes an ID, a key or a filter from another tool runs after that tool.&lt;/p&gt;

&lt;p&gt;Where the API cannot express that, I turn parallel calls off for that step.&lt;/p&gt;

&lt;p&gt;I also made the dependent tool harder to fool. The order lookup now accepts only an account ID in the format our system issues. A customer name fails loudly instead of quietly matching the wrong person.&lt;/p&gt;

&lt;p&gt;When a dependent chain gets long, I split it into smaller sub-chains. Every split point is a boundary, and it gets the same checks as a tool output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Every parallel result gets checked before the merge
&lt;/h2&gt;

&lt;p&gt;Parallel branches meet somewhere, usually in the step that writes the answer. That merge is where a bad branch turns into a confident summary.&lt;/p&gt;

&lt;p&gt;So each result is checked on its own before the merge. It has to match the expected schema, every required field has to be present, and the account ID inside the order result has to match the account ID the account lookup returned. In my case that last check alone would have caught the wrong customer.&lt;/p&gt;

&lt;p&gt;The worst version of this bug is when a tool returns an incomplete result and the model fills the holes. Check for nulls and empty fields, and tell the agent to stop and report what is missing instead of guessing.&lt;/p&gt;

&lt;p&gt;A run that stops and says it could not find the account ID is annoying, but it costs far less than a polished summary of someone else's orders.&lt;/p&gt;

&lt;h2&gt;
  
  
  One wrong input travels further than it looks
&lt;/h2&gt;

&lt;p&gt;A September 2025 study of more than 500 failed agent trajectories named error propagation the primary bottleneck in agent reliability. Its most common sources were memory and reflection errors, not tool scheduling. The pattern is still the one I hit: an early mistake that every later step builds on without question.&lt;/p&gt;

&lt;p&gt;A guessed argument in step one is that early mistake. By the last step it reads like a fact.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would tell myself before turning on parallel tool calls
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Know your default:&lt;/strong&gt; check whether your API runs tool calls in parallel before you assume it does not.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Map dependencies per task:&lt;/strong&gt; independent lookups run together, anything that needs another tool's output runs after it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make dependent tools reject guesses:&lt;/strong&gt; validate the format of IDs and keys at the tool boundary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check before the merge:&lt;/strong&gt; schema, required fields, and a matching ID on every branch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stop on missing data:&lt;/strong&gt; a reported gap is cheaper than a filled one.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The longer version, with the other ways a tool chain fails and how to trace each step back to the first bad one, is in &lt;a href="https://futureagi.com/blog/llm-tool-chaining-cascading-failures-production/?utm_source=fagiDevto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=blogdistribution" rel="noopener noreferrer"&gt;this piece&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Which of your tool calls turned out to depend on another one? For me it was the order lookup, because the dependency was a single ID and it looked too small to matter.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>llm</category>
      <category>ai</category>
      <category>performance</category>
    </item>
    <item>
      <title>I summed every span in my agent trace. The token count came out exactly double.</title>
      <dc:creator>Kartik N V J K</dc:creator>
      <pubDate>Tue, 17 Nov 2026 17:27:03 +0000</pubDate>
      <link>https://dev.to/kartik-nvjk/i-summed-every-span-in-my-agent-trace-the-token-count-came-out-exactly-double-3ddh</link>
      <guid>https://dev.to/kartik-nvjk/i-summed-every-span-in-my-agent-trace-the-token-count-came-out-exactly-double-3ddh</guid>
      <description>&lt;p&gt;I built a small incident triage agent to work out where its tokens went. It answers on-call alerts in three steps with two tools, search_logs and fetch_runbook.&lt;/p&gt;

&lt;p&gt;The token counts in this test are synthetic. I estimated them from request size so they grow the way real usage grows. That was enough to show two mistakes that are easy to make with real agents.&lt;/p&gt;

&lt;p&gt;The first one showed up when I added up the tokens for a single run. I got 101,464. The right number was 50,732.&lt;/p&gt;

&lt;h2&gt;
  
  
  The provider bill cannot tell you which step cost money
&lt;/h2&gt;

&lt;p&gt;A usage page splits spend by model and by day. My agent spends tokens per step, per tool call and per run.&lt;/p&gt;

&lt;p&gt;When the spend goes up, I want to know which step pushed it. Was it the log search, a retry, or the long system prompt? A daily total cannot answer that.&lt;/p&gt;

&lt;p&gt;So I record usage on every LLM call as a span attribute, with the OpenTelemetry GenAI names:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;gen_ai.usage.input_tokens&lt;/code&gt; for the prompt side of one call&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;gen_ai.usage.output_tokens&lt;/code&gt; for the reply&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The GenAI conventions are still in Development status. Before you build a dashboard on these names, read one real span from your own instrumentation and check what it actually writes.&lt;/p&gt;

&lt;h2&gt;
  
  
  My trace counted the same tokens twice
&lt;/h2&gt;

&lt;p&gt;My run is an agent span. Under it sit three step spans, and under each step sit the LLM call spans.&lt;/p&gt;

&lt;p&gt;The usage lives on the LLM spans. I had also set the run total on the agent span, the way the GenAI conventions let an agent span carry usage next to its children.&lt;/p&gt;

&lt;p&gt;When I summed every span that had usage, I got 101,464 tokens. The LLM spans alone added up to 50,732. The agent span repeated its children, so my naive sum was exactly 2x.&lt;/p&gt;

&lt;p&gt;The fix is a leaf rule. Count a span only if it carries usage and no span below it does. Then group those leaf spans by the step, the tool call and the run above them.&lt;/p&gt;

&lt;p&gt;There is an open issue in the OpenTelemetry GenAI conventions repo about how to aggregate token usage. Until it settles, I enforce the leaf rule myself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Most of the tokens were input the loop sent again
&lt;/h2&gt;

&lt;p&gt;Once I had per-call numbers, the growth was plain to see. The first call in the run used 1,078 tokens. The call in step 3 used 16,610. No call returned more than 61 output tokens.&lt;/p&gt;

&lt;p&gt;Three things go out again on every call:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The system prompt and tool schemas:&lt;/strong&gt; they never change between calls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool output:&lt;/strong&gt; in step 1, search_logs returned 400 lines of payment gateway timeouts. That text joined the message history and stayed there for every later call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retries:&lt;/strong&gt; in step 2 the model returned truncated JSON for the fetch_runbook arguments, so the loop resent the whole context with a short correction.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A 2026 study of agent token costs (arXiv 2604.22750) found the same shape at a much larger scale. Across eight frontier models on SWE-bench Verified, agentic coding tasks used about 1,000x more tokens than code reasoning and code chat. Input drove the cost, and runs of the same task varied by up to 30x.&lt;/p&gt;

&lt;h2&gt;
  
  
  One step took 77.9% of the run cost
&lt;/h2&gt;

&lt;p&gt;The second mistake is reading spend by day. So I priced every leaf call with a dated price table and ranked the steps by their share of the run cost.&lt;/p&gt;

&lt;p&gt;Step 2 of the first run took 77.9%. Its first call was the first to carry the full log dump, and its retry sent that context a second time.&lt;/p&gt;

&lt;p&gt;The retry itself cost less than I expected: 9.2% of what both test runs cost together. Almost all of its input hit the prompt cache, 16,384 of 16,486 tokens. A model with no cached rate would bill that same retry in full.&lt;/p&gt;

&lt;p&gt;So the first thing I trim now is tool output. One search_logs call pushed 400 lines into context, and nothing in my loop ever took them out.&lt;/p&gt;

&lt;h2&gt;
  
  
  I check the budget inside the loop
&lt;/h2&gt;

&lt;p&gt;A monthly bill tells you about a bad run weeks later. I wanted the agent to stop itself the same day.&lt;/p&gt;

&lt;p&gt;So I check a per-run token budget after every LLM response, before the next tool call. In my test the budget was 40,000 tokens. The first run crossed it at step 3. The second run finished at 34,200 and passed.&lt;/p&gt;

&lt;p&gt;This check has a limit. A check after the response cannot stop the call that crosses the line, and my first run ended 10,732 tokens over budget. If you need a hard cap, check before the call: reserve the next call's input plus its maximum output against what is left.&lt;/p&gt;

&lt;p&gt;Behind the in-loop check sits a threshold alert on daily tokens per model. It catches slow drift that no single run crosses.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would tell myself before tracking agent tokens
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sum leaf spans only:&lt;/strong&gt; an agent span that repeats its children doubles your count.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check the attribute names:&lt;/strong&gt; the GenAI conventions are still in Development, so read a real span first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rank steps before days:&lt;/strong&gt; in my demo, the top step named the tool output to trim.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Count retries as cost:&lt;/strong&gt; each one resends the whole context.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Put the budget in the loop:&lt;/strong&gt; and check before the call if you need a hard cap.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wrote the full version, with the rollup script, the dated price table and where the budget check sits in the loop, in &lt;a href="https://futureagi.com/blog/ai-agent-token-usage-tracking/?utm_source=fagiDevto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=blogdistribution" rel="noopener noreferrer"&gt;my token usage tracking write-up&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Have you found a step in your agent that cost more than the rest of the run combined? For me it was the step right after a log search, which carried 400 lines of logs and paid for them again on every call after it.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>opentelemetry</category>
      <category>observability</category>
    </item>
    <item>
      <title>A front-end release broke my agent evals overnight. The agent had not changed</title>
      <dc:creator>Kartik N V J K</dc:creator>
      <pubDate>Tue, 10 Nov 2026 16:39:24 +0000</pubDate>
      <link>https://dev.to/kartik-nvjk/a-front-end-release-broke-my-agent-evals-overnight-the-agent-had-not-changed-oki</link>
      <guid>https://dev.to/kartik-nvjk/a-front-end-release-broke-my-agent-evals-overnight-the-agent-had-not-changed-oki</guid>
      <description>&lt;p&gt;My computer-use agent runs a nightly suite against a staging copy of an internal web app. It reads the screen from screenshots, clicks, types, and files a form at the end. One morning the suite was a wall of red.&lt;/p&gt;

&lt;p&gt;I spent an hour reading trajectories before I checked the obvious thing. The front-end team had shipped a release the evening before. A button had moved, a field had been renamed, and the flow had grown a confirmation step. My verifier was a stack of hard-coded checks on the final state, and every one of them was now looking for a page that no longer existed.&lt;/p&gt;

&lt;p&gt;The agent was fine. The grader was wrong. And a grader that can be wrong in that direction can be wrong in the other direction too, which is the direction that actually scares me.&lt;/p&gt;

&lt;h2&gt;
  
  
  A computer-use agent's output is a trajectory, not an answer
&lt;/h2&gt;

&lt;p&gt;With a chat model you grade one output. With a computer-use agent you grade a path: a sequence of clicks, keystrokes, and scrolls across a moving interface.&lt;/p&gt;

&lt;p&gt;Outcome-only grading reads the final screenshot and calls it a day. The problem is that two runs can end on the same confirmation page while one of them was clean and the other did something reckless on the way there. A run can reach the right final state through a wrong path, and a final-state check will score both runs identically.&lt;/p&gt;

&lt;p&gt;Once I understood that, my wall of red looked like the cheap failure. The expensive failure is the false pass, where the check finds the record it was told to find and never notices what else happened.&lt;/p&gt;

&lt;h2&gt;
  
  
  Programmatic verifiers fail in both directions
&lt;/h2&gt;

&lt;p&gt;My hard-coded checks were fast, deterministic, and nearly free to run. I am not giving them up. But they have two failure directions and I had only ever planned for one.&lt;/p&gt;

&lt;p&gt;False fails come from UI drift. Buttons move, fields get renamed, flows grow steps. Every drift costs you a morning of triage and another patch to the suite, and the suite slowly becomes a second codebase you maintain.&lt;/p&gt;

&lt;p&gt;False passes come from rigidity. A check that asks "does the order exist in the database" passes when the order exists and is wrong. A check that asks "did we reach the confirmation page" passes when the form was submitted twice on the way there. The check is answering its own narrow question, and the question was never "did the agent do the task well".&lt;/p&gt;

&lt;h2&gt;
  
  
  A model judge is not automatically the fix
&lt;/h2&gt;

&lt;p&gt;The tempting move is to replace the brittle checks with an LLM or VLM judge that reads the screenshots and the trajectory against a rubric. It handles UI drift without a code change, and it can reason about the whole path instead of only the destination. WebVoyager, one of the public computer-use benchmarks, uses a vision model to score runs for exactly this reason.&lt;/p&gt;

&lt;p&gt;But model judges carry documented biases. The research on LLM judges (arXiv 2306.05685) shows they favor longer answers, lean toward their own style, and can be swayed by option order. A vague rubric makes the score wobble between runs on identical behavior. And every judged run adds latency and spend that a programmatic check does not.&lt;/p&gt;

&lt;p&gt;So the judge did not replace my checks. It joined them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Layer the graders, then grade the graders
&lt;/h2&gt;

&lt;p&gt;The structure that survived in my suite has two layers. Hard programmatic gates own the non-negotiables: no charge without a matching order, no success claim without the record. The judge owns the fuzzy middle: was the path reasonable, did the agent do what the task meant rather than what the rubric letter said.&lt;/p&gt;

&lt;p&gt;The part I had never done before was validating the verifier itself. The core question is agreement: when my verifier and a careful human grade the same runs, how often do they land on the same verdict? If they disagree a third of the time, the verifier is not grading. It is guessing.&lt;/p&gt;

&lt;p&gt;Raw agreement flatters you, because two graders agree by chance more often than you would think. Cohen's kappa corrects for that chance agreement, so that is the number I track against a small hand-graded gold set.&lt;/p&gt;

&lt;p&gt;Two more habits came out of this verifier design guide and earned their keep. Mutation testing: feed the verifier trajectories you know are bad and confirm it rejects them, because a grader that passes everything looks exactly like a healthy suite. And canaries: plant a few gameable runs where the agent could reach the success state without doing the task, and see whether the verifier notices. Deterministic checks and judges get gamed differently, which is the real argument for running both.&lt;/p&gt;

&lt;p&gt;The full walkthrough, with the validation checklist and a worked kappa example, is in &lt;a href="https://futureagi.com/blog/verifier-design-computer-use-agents/?utm_source=fagiDevto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=blogdistribution" rel="noopener noreferrer"&gt;this verifier design guide&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The mistakes I would not repeat
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Grading only the final state.&lt;/strong&gt; The trajectory is the output. A clean destination does not certify the path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treating the red wall as the bad day.&lt;/strong&gt; False fails cost mornings. False passes cost incidents. Plan for the second one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swapping brittle checks for an unvalidated judge.&lt;/strong&gt; That trades visible breakage for invisible bias.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never testing the tester.&lt;/strong&gt; Mutation runs and a kappa score against hand-graded runs turned my verifier from an opinion into an instrument.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Letting the suite rot between audits.&lt;/strong&gt; Scores that climb while real task success stays flat are the quiet signature of a grader being gamed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is my question for you: when your agent eval goes green for a month straight, how sure are you that the agent earned it and not the grader? I was sure, right up until I hand-graded twenty runs and my verifier disagreed with me on four of them.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>testing</category>
      <category>llm</category>
    </item>
    <item>
      <title>I set average to micro to fix a scikit-learn error. My F1 score turned into accuracy</title>
      <dc:creator>Kartik N V J K</dc:creator>
      <pubDate>Mon, 02 Nov 2026 13:35:06 +0000</pubDate>
      <link>https://dev.to/kartik-nvjk/i-set-average-to-micro-to-fix-a-scikit-learn-error-my-f1-score-turned-into-accuracy-269e</link>
      <guid>https://dev.to/kartik-nvjk/i-set-average-to-micro-to-fix-a-scikit-learn-error-my-f1-score-turned-into-accuracy-269e</guid>
      <description>&lt;p&gt;An LLM routes our support tickets into three queues: general, billing and refund. I wanted an F1 score on the eval dashboard, so I called &lt;code&gt;f1_score&lt;/code&gt; on 100 labeled tickets.&lt;/p&gt;

&lt;p&gt;It crashed with this error: &lt;code&gt;Target is multiclass but average='binary'&lt;/code&gt;. I added &lt;code&gt;average='micro'&lt;/code&gt;, the error went away, and the dashboard showed 0.85.&lt;/p&gt;

&lt;p&gt;Accuracy on the same 100 tickets was also 0.85. I read that as two metrics agreeing. On single-label data, micro F1 and accuracy are the same calculation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The default only works for two classes
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;f1_score&lt;/code&gt; defaults to &lt;code&gt;average='binary'&lt;/code&gt;. That mode scores one positive class, picked with &lt;code&gt;pos_label&lt;/code&gt;, and it only accepts two-class targets.&lt;/p&gt;

&lt;p&gt;Three queues make a multiclass problem. So scikit-learn raises the error and asks you to pick &lt;code&gt;micro&lt;/code&gt;, &lt;code&gt;macro&lt;/code&gt;, &lt;code&gt;weighted&lt;/code&gt; or &lt;code&gt;None&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The error makes you choose how to combine the per-class scores. Each option measures something different, and I picked one without reading what it computed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Micro F1 on single-label data is accuracy
&lt;/h2&gt;

&lt;p&gt;Micro averaging pools the counts. It adds up true positives, false positives and false negatives across all classes, then computes one F1 from the totals.&lt;/p&gt;

&lt;p&gt;In single-label classification, every wrong prediction counts twice. It is a false positive for the queue the model picked and a false negative for the queue the ticket belonged in. So the pooled false positives always equal the pooled false negatives.&lt;/p&gt;

&lt;p&gt;That makes micro precision equal micro recall, and both equal accuracy. On my 100 tickets, 85 were routed right and 15 were wrong. Micro precision, micro recall, micro F1 and accuracy all came out at 0.85.&lt;/p&gt;

&lt;p&gt;scikit-learn's &lt;code&gt;classification_report&lt;/code&gt; leaves out the micro average row for single-label data (unless you pass only some of the labels), because that row would only repeat accuracy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Macro F1 showed the queue I was failing
&lt;/h2&gt;

&lt;p&gt;The 100 tickets were 80 general, 12 billing and 8 refund. When I printed one score per class with &lt;code&gt;average=None&lt;/code&gt;, the per-class scores looked like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;General:&lt;/strong&gt; 78 of 80 routed right, F1 0.92.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Billing:&lt;/strong&gt; 6 of 12 routed right, F1 0.60.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Refund:&lt;/strong&gt; 1 of 8 routed right, F1 0.20.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The misses: both wrong general tickets went to billing, 5 billing tickets went to general and 1 to refund, and 7 refund tickets went to general.&lt;/p&gt;

&lt;p&gt;Macro F1 gives each class the same weight and averages the three scores. It came out at 0.57.&lt;/p&gt;

&lt;p&gt;Macro F1 showed what micro hid. Seven of the eight refund tickets were sitting in the general queue. Micro F1 could not show it, because general tickets made up 80 percent of the data and drowned out the rest.&lt;/p&gt;

&lt;p&gt;Weighted F1 came out at 0.82. It weights each class by how many tickets it has, so the general queue dominates that one too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Small slices break macro F1 in a different way
&lt;/h2&gt;

&lt;p&gt;After I switched to macro, I started running it on daily slices. One quiet day had 10 tickets: 8 general, 2 billing and no refunds. One billing ticket went to general.&lt;/p&gt;

&lt;p&gt;I passed &lt;code&gt;labels=['general', 'billing', 'refund']&lt;/code&gt; so every daily report showed the same three classes. Macro F1 for that day came out at 0.54.&lt;/p&gt;

&lt;p&gt;Refund had no true tickets and no predictions that day. Its F1 is undefined. With the default &lt;code&gt;zero_division='warn'&lt;/code&gt;, scikit-learn sets that F1 to 0, prints a warning, and averages the 0 in. No refund tickets came in that day, so the router had nothing to miss.&lt;/p&gt;

&lt;p&gt;Setting &lt;code&gt;zero_division=np.nan&lt;/code&gt; drops undefined classes from the average. It has been available since scikit-learn 1.3. The same slice then scores 0.80.&lt;/p&gt;

&lt;p&gt;One detail I had wrong: I expected a warning whenever a class gets no predictions. &lt;code&gt;f1_score&lt;/code&gt; only warns when a class has no true labels and no predictions at all. If refund tickets exist and the router never predicts refund, refund's F1 is 0, with no warning. &lt;code&gt;precision_score&lt;/code&gt; does warn in that case, so I check both.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would tell myself before that error
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Picking &lt;code&gt;average&lt;/code&gt; to make an error go away.&lt;/strong&gt; Read what each option computes before you choose one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reporting micro F1 next to accuracy.&lt;/strong&gt; On single-label data they are the same number.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trusting one averaged score.&lt;/strong&gt; Print &lt;code&gt;average=None&lt;/code&gt; and look at each class first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Passing &lt;code&gt;labels=&lt;/code&gt; on small slices with the default &lt;code&gt;zero_division&lt;/code&gt;.&lt;/strong&gt; A class with no tickets counts as a 0 in the macro average. Use &lt;code&gt;np.nan&lt;/code&gt;, or show the slice size next to the score.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want the full version, &lt;a href="https://futureagi.com/blog/f1-score-evaluating-classifiers-2025/?utm_source=fagiDevto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=blogdistribution" rel="noopener noreferrer"&gt;this piece&lt;/a&gt; covers the F1 formula, F-beta, threshold tuning and F1 for LLM classifiers, with scikit-learn code you can run.&lt;/p&gt;

&lt;p&gt;Which &lt;code&gt;average&lt;/code&gt; setting did you pick the first time, and why? For me it was &lt;code&gt;micro&lt;/code&gt;, and the reason was an error message I wanted gone.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>ai</category>
      <category>python</category>
      <category>datascience</category>
    </item>
    <item>
      <title>A flaky MCP tool broke my agent. I went looking for the retry setting in the protocol</title>
      <dc:creator>Kartik N V J K</dc:creator>
      <pubDate>Mon, 26 Oct 2026 13:48:00 +0000</pubDate>
      <link>https://dev.to/kartik-nvjk/a-flaky-mcp-tool-broke-my-agent-i-went-looking-for-the-retry-setting-in-the-protocol-3hl2</link>
      <guid>https://dev.to/kartik-nvjk/a-flaky-mcp-tool-broke-my-agent-i-went-looking-for-the-retry-setting-in-the-protocol-3hl2</guid>
      <description>&lt;p&gt;A remote tool server my agent depends on started timing out. Most calls went through. Some hung and failed, and the agent carried on as if the tool had answered. I opened the MCP spec to find where retries are configured, because I assumed a protocol for tool calls would have a retry setting.&lt;/p&gt;

&lt;p&gt;It has none, and that is by design. The spec tells me how a failed call is reported. It says clients should set timeouts and should pass tool errors back to the model so it can correct itself. Whether to retry, and how many times, is left to the application. My agent had been dropping those errors on the floor, and the fix belonged in my harness.&lt;/p&gt;

&lt;h2&gt;
  
  
  MCP defines the call and stops there
&lt;/h2&gt;

&lt;p&gt;The protocol is small on purpose. A server offers three things: tools the model can call, resources the application can read and pass to the model, and prompts the server shares as templates. Messages travel as JSON-RPC 2.0 over stdio for local servers or Streamable HTTP for remote ones.&lt;/p&gt;

&lt;p&gt;MCP's architecture docs draw the boundary themselves. They say MCP "focuses solely on the protocol for context exchange" and "does not dictate how AI applications use LLMs or manage the provided context."&lt;/p&gt;

&lt;p&gt;I had read that line before without thinking about what it meant for retries. Deciding when to call a tool again is part of how my application uses the model, so the retry logic was always going to be mine to write.&lt;/p&gt;

&lt;h2&gt;
  
  
  Retries, stopping and memory are harness code
&lt;/h2&gt;

&lt;p&gt;Once I stopped looking in the protocol, the list of what my harness owns got clear.&lt;/p&gt;

&lt;p&gt;It runs the loop. On each turn it decides whether the model wants a tool, which tool, and whether the task is done.&lt;/p&gt;

&lt;p&gt;It makes the retry call. When a tool fails, it decides whether to try again, try something else, or stop and say so.&lt;/p&gt;

&lt;p&gt;It manages memory, trimming the context so a long session still fits the window. And it checks guardrails before a risky action runs.&lt;/p&gt;

&lt;p&gt;In the tool-call part of that cycle, MCP touches two steps. It defines &lt;code&gt;tools/list&lt;/code&gt; so my harness can discover what a server offers, and it defines &lt;code&gt;tools/call&lt;/code&gt;, which the server runs when my harness decides to call a tool. My harness decides when to call a tool, and MCP carries the request to the server.&lt;/p&gt;

&lt;p&gt;My timeout fix ended up as a few lines in the harness. It retries once on a timeout. If the second try fails too, it hands the error to the model as a failed result, so the agent can no longer act as if the call worked.&lt;/p&gt;

&lt;h2&gt;
  
  
  Approval steps live in my harness too
&lt;/h2&gt;

&lt;p&gt;The same split applies to security. The spec says MCP "cannot enforce these security principles at the protocol level," meaning user consent, privacy and tool safety. It asks clients to prompt the user for confirmation on sensitive operations.&lt;/p&gt;

&lt;p&gt;So if I want a human to approve a write before it happens, my harness has to pause and ask. The server can refuse a call it is not allowed to serve, but it will not ask a human for me.&lt;/p&gt;

&lt;h2&gt;
  
  
  In MCP's own terms, my harness is the Host
&lt;/h2&gt;

&lt;p&gt;MCP's architecture docs name three roles: a Host, one or more Clients, and the Servers they connect to. The Host is "the AI application that coordinates and manages one or multiple MCP clients." It creates one client per server.&lt;/p&gt;

&lt;p&gt;Reading that again, I realized I had been running a Host the whole time. My harness creates one client per server. It merges every server's tool list with my native tools into one catalog for the model. Then it routes each tool call to the right client. MCP gives my harness a standard way to hold those connections, and the harness still does everything else.&lt;/p&gt;

&lt;h2&gt;
  
  
  The July spec update gave my harness more decisions
&lt;/h2&gt;

&lt;p&gt;The MCP spec version dated 2026-07-28 moved even more onto the Host side. Three changes affected my harness directly.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;initialize&lt;/code&gt; handshake is gone, and MCP is now stateless. Each request carries its own protocol version and client capabilities. A new &lt;code&gt;server/discover&lt;/code&gt; call lets a client check a server's versions and capabilities up front.&lt;/p&gt;

&lt;p&gt;Protocol-level sessions are gone too. A server that needs state across calls now hands out an explicit handle, and the client passes it back as an ordinary tool argument.&lt;/p&gt;

&lt;p&gt;Results from &lt;code&gt;tools/list&lt;/code&gt; now carry two new fields. &lt;code&gt;ttlMs&lt;/code&gt; is a freshness hint for caching. &lt;code&gt;cacheScope&lt;/code&gt; says whether a shared cache may store the result. My old harness fetched the tool list once at startup and kept it forever. Now it reads the hint and refreshes the list when the cached copy goes stale.&lt;/p&gt;

&lt;p&gt;The same release marked the Roots, Sampling and Logging features for removal. For Roots, the suggested replacement is to pass directories through tool parameters, resource URIs or server configuration. For Sampling, it is to call the model provider's API directly.&lt;/p&gt;

&lt;h2&gt;
  
  
  When I do not need a harness at all
&lt;/h2&gt;

&lt;p&gt;Not every setup needs one. A script that asks the model one question, makes one call to a filesystem server, and prints the answer is complete on its own. It has no loop, no memory, and no need for a permission gate.&lt;/p&gt;

&lt;p&gt;The harness shows up the moment the work becomes a loop. Say my script has to read a repo, edit files, run tests, and retry on failure. Now it needs something to pick the next step, keep the context, and gate the writes. The server is the same in both cases, but the runtime now carries all of that work.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would tell myself before that timeout
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Looking for retry logic in the protocol.&lt;/strong&gt; The spec defines how a failed call is reported. Whether to retry, give up, or hand the error to the model is your harness's decision.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expecting the server to ask the user.&lt;/strong&gt; The spec puts user confirmation on the client side. Put the approval step in the Host.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fetching the tool list once and keeping it forever.&lt;/strong&gt; Under the July spec, &lt;code&gt;tools/list&lt;/code&gt; results come with a freshness hint. Read it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keeping state in the connection.&lt;/strong&gt; Sessions are gone from the protocol. Pass the server's handle as a tool argument, or keep the state in your harness.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want the deeper version, &lt;a href="https://futureagi.com/blog/agent-harness-vs-mcp/?utm_source=fagiDevto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=blogdistribution" rel="noopener noreferrer"&gt;this piece&lt;/a&gt; walks through the full split of work between a harness and MCP. It also covers the Host and Client roles and the call sequence a harness runs against an MCP server.&lt;/p&gt;

&lt;p&gt;Which part of your agent did you expect MCP to handle before you found out it was yours? For me it was retries, and the fix was a few lines in the harness once I stopped searching the spec for them.&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>agents</category>
      <category>llm</category>
      <category>architecture</category>
    </item>
    <item>
      <title>My nightly eval gate went red on prompts nobody touched. The judge had changed its mind</title>
      <dc:creator>Kartik N V J K</dc:creator>
      <pubDate>Fri, 16 Oct 2026 16:24:40 +0000</pubDate>
      <link>https://dev.to/kartik-nvjk/my-nightly-eval-gate-went-red-on-prompts-nobody-touched-the-judge-had-changed-its-mind-1cd6</link>
      <guid>https://dev.to/kartik-nvjk/my-nightly-eval-gate-went-red-on-prompts-nobody-touched-the-judge-had-changed-its-mind-1cd6</guid>
      <description>&lt;p&gt;A support agent I work on gets graded every night against ten thousand past tickets. One morning the run came back red. Nobody had merged a prompt change, the model version was pinned, and the retrieval index had not been rebuilt. I spent most of that morning diffing configs. The answer was in the judge logs: the same reply to the same ticket had scored 0.7 the night before and 0.6 that night, and my pass mark was 0.7. The agent was identical on both nights. The judge had scored the same input two different ways.&lt;/p&gt;

&lt;p&gt;I keep relearning this one. An LLM judge gives you a slightly different score each time you run it, so on a gate that grades thousands of cases, some of the red is the judge disagreeing with itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  A regression gate needs the same verdict twice
&lt;/h2&gt;

&lt;p&gt;I like LLM-as-a-judge for what it does well. You hand a strong model a rubric, it returns a score and a sentence explaining the score, and that sentence is the most useful thing I have when I am debugging one bad answer. I can read it, argue with it, and log it.&lt;/p&gt;

&lt;p&gt;A gate asks for something else. It has to return the same verdict on the same input every time, so that a failing case means the agent regressed. Code checks and semantic verifiers return the same result on the same input every time, so they can hold a gate on their own. For the LLM judge I needed a workaround, and mine was to average several judge runs on the cases that mattered. That multiplied the cost of the slowest and most expensive check in the suite.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a typed judge gives up to get there
&lt;/h2&gt;

&lt;p&gt;JEV is TypeSafe AI's typed evaluator, released in September 2026. Its makers frame it as a "System One" model built for fast, instinctive scoring. The difference you notice first is the output. JEV returns a typed verdict (a yes or no, a multiple-choice pick, or a point on an ordered scale) with a calibrated probability attached. It writes no rationale at all.&lt;/p&gt;

&lt;p&gt;The numbers come from the paper "JEV-as-a-Judge: Accept When Confident, Escalate When Unsure". In its September 29 revision, JEV recorded a 0.15-second median latency and cost 0.36% of the strongest comparator's fee on the tested workloads. It came within three percentage points of GPT-6 when the verdict could be read directly from the supplied text. The gap widened on math, code, logic and other tasks where the verdict has to be derived. I treat those figures as the paper's benchmark setup. My own traffic will land somewhere else, and I would only trust a number I measured on it.&lt;/p&gt;

&lt;p&gt;So JEV gives up the written reasoning to get repeatability. For a regression suite that runs every night, I will take that trade.&lt;/p&gt;

&lt;h2&gt;
  
  
  The probability is the part I use most
&lt;/h2&gt;

&lt;p&gt;The calibrated probability changes how I wire the judge in. I accept the verdict when confidence is high and route the low-confidence cases to a stronger reasoning judge or to a person. That makes the typed judge a triage step in front of the expensive checks.&lt;/p&gt;

&lt;p&gt;The threshold is mine to set. I validate it against my own labeled cases before it is allowed to block anything, because a cutoff copied from someone else's benchmark describes their data.&lt;/p&gt;

&lt;h2&gt;
  
  
  One agent, four checks, four methods
&lt;/h2&gt;

&lt;p&gt;I pick each method by what the check is grading. On the support agent, that splits four ways.&lt;/p&gt;

&lt;p&gt;Whether the reply is valid JSON with the required fields is a format question. A code check owns it: deterministic, instant, free.&lt;/p&gt;

&lt;p&gt;Whether the reply matches the known resolution for that ticket is agreement with a reference. A semantic verifier handles it cheaply. You embed the reply and the reference answer, take the cosine similarity, and pass it above a threshold. A small model like &lt;code&gt;all-MiniLM-L6-v2&lt;/code&gt; runs locally. I started at 0.75 and tuned from there against known-good and known-bad pairs, since too low lets paraphrases of a wrong answer through and too high fails correct answers worded differently.&lt;/p&gt;

&lt;p&gt;Whether the tone stayed polite and on-brand is a judgment call, and that is where an LLM judge earns its cost. I keep it pointwise, one answer scored against a threshold. When I need a ranking I switch to pairwise and run both orders, because the model tends to favor whichever answer it reads first.&lt;/p&gt;

&lt;p&gt;The nightly run over ten thousand past tickets is the high-volume gate, and that is where the typed verdict fits.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where I still want a paragraph of reasoning
&lt;/h2&gt;

&lt;p&gt;Two places keep a reasoning judge or a human in my loop.&lt;/p&gt;

&lt;p&gt;The first is derivation. If the verdict depends on checking math, code, or a multi-step argument, the typed judge falls further behind, so those cases escalate by default.&lt;/p&gt;

&lt;p&gt;The second is adversarial input. Typed and generative judges both read the content they grade, and that content can carry instructions aimed at the judge. A written rationale does not reliably expose prompt injection, and a typed verdict gives me even less to investigate after the fact. When a judge feeds a security or moderation decision, I treat its input as untrusted, keep the evaluation instructions isolated, test adversarial examples, use a deterministic rule wherever the policy can be written down exactly, and send uncertain cases to human review.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would tell myself before that red morning
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gating on a judge with variance.&lt;/strong&gt; A red build that does not reproduce may be judge variance. Put a low-variance check on the gate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reading similarity as truth.&lt;/strong&gt; "Paris is the capital of France" and "Paris is not the capital of France" score as very similar. Anywhere one flipped word changes the verdict, pair the verifier with a rule or a judge.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Borrowing a confidence threshold.&lt;/strong&gt; Calibrate it on your own labels first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Asking one judge to grade everything.&lt;/strong&gt; Formats, references, tone and volume each have a method that fits. Most production agents need three or four of them running together.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full comparison, with the decision table and Python examples for the semantic verifier and the LLM-judge pattern, is in &lt;a href="https://futureagi.com/blog/jev-as-a-judge-for-agent-evals/?utm_source=fagiDevto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=blogdistribution" rel="noopener noreferrer"&gt;this piece&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Which check in your suite has gone red with nothing changed underneath it? For me it was the nightly regression gate, and the fix was handing that job to a check that gives close to the same answer every time.&lt;/p&gt;

</description>
      <category>llm</category>
      <category>agents</category>
      <category>testing</category>
      <category>ai</category>
    </item>
    <item>
      <title>Evaluating DeepSeek models broke three assumptions my rubric was built on</title>
      <dc:creator>Kartik N V J K</dc:creator>
      <pubDate>Thu, 15 Oct 2026 16:09:37 +0000</pubDate>
      <link>https://dev.to/kartik-nvjk/evaluating-deepseek-models-broke-three-assumptions-my-rubric-was-built-on-333a</link>
      <guid>https://dev.to/kartik-nvjk/evaluating-deepseek-models-broke-three-assumptions-my-rubric-was-built-on-333a</guid>
      <description>&lt;p&gt;I started evaluating DeepSeek models the lazy way. The API speaks the same &lt;code&gt;/v1/chat/completions&lt;/code&gt; shape as OpenAI, so I swapped the &lt;code&gt;base_url&lt;/code&gt;, pointed my existing eval suite at R1, and waited for a score. I got one, and it told me almost nothing. That suite was written for a closed model. It scored the final answer only, in one language, against one build of the weights.&lt;/p&gt;

&lt;p&gt;DeepSeek is cheap and the reasoning is strong. Neither fact tells you whether it can replace the model you run today, and three gaps in my rubric showed up before anything else did.&lt;/p&gt;

&lt;h2&gt;
  
  
  Evaluating DeepSeek R1 means scoring the trace too
&lt;/h2&gt;

&lt;p&gt;R1 returns a &lt;code&gt;reasoning_content&lt;/code&gt; field next to the final &lt;code&gt;content&lt;/code&gt;. You can read it, store it, and score it. My rubric ignored it.&lt;/p&gt;

&lt;p&gt;The failure I care about lives between those two fields: the trace is correct and the answer is wrong. On hard reasoning sets that happens on eight to fifteen percent of R1 traces. An answer-only check sees a wrong answer and has no idea the reasoning was fine. So I added a separate judge that gets the trace and the answer together and scores one thing, whether the answer follows from the trace.&lt;/p&gt;

&lt;h2&gt;
  
  
  The quantized build is the model you ship
&lt;/h2&gt;

&lt;p&gt;Open weights mean most teams self-host, and self-hosting usually means Q4, Q5, or Q8 on vLLM, SGLang, or TGI. My benchmark numbers came from the FP16 reference. Production was going to run Q4.&lt;/p&gt;

&lt;p&gt;The two builds agree on ninety-plus percent of cases. The ten percent where they disagree are the cases that matter. I now run the same prompt set through both and score the delta as its own axis.&lt;/p&gt;

&lt;h2&gt;
  
  
  One language average hides two different models
&lt;/h2&gt;

&lt;p&gt;DeepSeek is trained bilingually, and its English and Chinese quality split unevenly on long-tail tasks. An English-only golden set misses Chinese regressions that bilingual users notice on day one. A safety-block rate measured only in English hides the false positives Western-trained classifiers throw on Chinese text.&lt;/p&gt;

&lt;p&gt;I stratify every rubric by language now. For Chinese output I pair LlamaGuard with a Qwen3Guard model in a majority vote, since Qwen3Guard throws fewer false positives on Chinese content.&lt;/p&gt;

&lt;h2&gt;
  
  
  Safety drifts in both directions
&lt;/h2&gt;

&lt;p&gt;Jailbreaks succeed more often on R1 and V3 than on Claude or GPT-5. The same models over-refuse medical-adjacent, legal-adjacent, and security-research questions the incumbent answers cleanly, and no accuracy benchmark will show you that. I run prompt injection, jailbreaks, refusal calibration, and system-prompt leakage against both models on identical payloads. Any regression on refusal or injection blocks the swap.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I check before the swap goes live
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Paired comparison on my own English traffic,&lt;/strong&gt; 200 to 500 real inputs, position randomized per pair, judged by a model from a different family. At 200 pairs and a 50 percent winrate the 95 percent interval is about ±6.9 points, which decides nothing. At 500 it narrows to ±4.4.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Residency before any regulated data touches it.&lt;/strong&gt; The hosted API egresses to servers in China, so regulated workloads run on self-hosted weights inside our VPC, and CI asserts on the model-attribution header so a config change cannot quietly route them back.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A license read on file.&lt;/strong&gt; V3, R1, and V4 ship under the DeepSeek License, which allows commercial use and adds restrictions legal should read end to end.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Effective cost over sticker cost.&lt;/strong&gt; A unit price ninety-five percent lower still loses if the candidate fails the quality gate a quarter of the time and falls back to the incumbent.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wrote up the full four-gate method, with the winrate floors and the canary rollout, in &lt;a href="https://futureagi.com/blog/evaluating-deepseek-models-2026/?utm_source=dailydev&amp;amp;utm_medium=organic&amp;amp;utm_campaign=blogdistribution" rel="noopener noreferrer"&gt;my DeepSeek evaluation playbook&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Which of these would have caught you first on an open-weight swap? For me it was the trace: a correct chain of reasoning sitting on top of a wrong answer, and a rubric that never looked at it.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>deepseek</category>
      <category>evaluate</category>
      <category>analytics</category>
    </item>
    <item>
      <title>My agent's trace was green end to end. It had done nothing</title>
      <dc:creator>Kartik N V J K</dc:creator>
      <pubDate>Mon, 12 Oct 2026 18:43:30 +0000</pubDate>
      <link>https://dev.to/kartik-nvjk/my-agents-trace-was-green-end-to-end-it-had-done-nothing-528g</link>
      <guid>https://dev.to/kartik-nvjk/my-agents-trace-was-green-end-to-end-it-had-done-nothing-528g</guid>
      <description>&lt;p&gt;A data-sync agent I maintain reported one morning that it had reconciled 1,400 records. The trace was green from the first span to the last. No exceptions, duration in the normal band, every span closed clean. It had reconciled nothing. One of its tools had failed three times in a row, the retry wrapper around that tool handed back the third failed attempt as if it were an ordinary result, and the agent wrote a confident one-paragraph summary over an empty payload.&lt;/p&gt;

&lt;p&gt;Nothing in that chain raised an error. That is the point I keep relearning: the worst agent bugs do not throw. The harness catches the failure for me, which is its job, and catching it is exactly what buries it.&lt;/p&gt;

&lt;h2&gt;
  
  
  A caught error is not a recorded error
&lt;/h2&gt;

&lt;p&gt;The mechanism is almost dull once you see it. No code, just the shape. Tracing marks a span as failed when an exception escapes that span's block. That part is automatic, and it is the behavior everyone leans on. The moment you wrap a risky call in a try and handle the error inside the block, nothing escapes, so nothing gets marked. The span keeps its default status, the one that means neither success nor failure, and every trace UI I have used paints that default green.&lt;/p&gt;

&lt;p&gt;So the retry wrapper that swallowed my tool failure did not lie, exactly. It just never recorded that anything went wrong. An error-rate dashboard built on span status drew a flat, clean line straight through the incident. The failure was real. The signal was gone before it ever reached me.&lt;/p&gt;

&lt;h2&gt;
  
  
  The harness hides failures in five predictable places
&lt;/h2&gt;

&lt;p&gt;Once I started hunting the pattern instead of the symptom, the same handful of recovery habits showed up every time. Each one is reasonable on its own. Each one deletes the exact signal you would have used to find the problem.&lt;/p&gt;

&lt;p&gt;Retry wrappers that return the last attempt. A call that failed three times becomes a normal return value, and the attempt count usually lives nowhere the trace can see.&lt;/p&gt;

&lt;p&gt;Step caps that report partial work as finished. A run that burned through its step budget returns the same shape as a run that actually completed, so "it stopped early" and "it succeeded" look identical downstream.&lt;/p&gt;

&lt;p&gt;Exceptions stringified into the model's context. The error turns into a line of text the model reads and reasons over as if it were data, and the run keeps going in a state your monitoring reads as healthy.&lt;/p&gt;

&lt;p&gt;Output parsers that coerce instead of failing. A malformed response gets its missing fields filled with defaults, and downstream code cannot tell a field the model produced from a field the parser invented.&lt;/p&gt;

&lt;p&gt;Fallbacks that quietly downgrade the model. When the primary trips and a weaker model silently takes over, the quality drop looks exactly like a prompt problem, and you lose a day editing prompts that were never the issue.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix is to record before you recover
&lt;/h2&gt;

&lt;p&gt;I am not arguing the harness should stop catching errors. Keeping the run alive is the whole reason it exists. The problem is that recovery and reporting are two separate jobs, and almost every default above collapses them into one, then drops the reporting half.&lt;/p&gt;

&lt;p&gt;So I changed the defaults, not the behavior. The wrapper still retries, but it records the attempt count and marks the span on the final failure before it returns anything. A step cap hands back a distinct finish reason instead of a success-shaped object. The broad catch around a tool call becomes a narrow one that records the exception and then recovers. Parsers run in strict mode, so an unknown or missing field fails loudly instead of getting patched. A fallback records which model actually answered. None of that stops the agent. It stops the agent from lying about what it did.&lt;/p&gt;

&lt;h2&gt;
  
  
  You catch these in evaluation, not on a dashboard
&lt;/h2&gt;

&lt;p&gt;What finally worked was giving up on the idea that a dashboard would ever surface this. If the output is the only thing you check, a swallowed failure walks right through every time the model writes a plausible summary over a bad result. Checking the output is necessary and it is nowhere near sufficient.&lt;/p&gt;

&lt;p&gt;What catches them is asserting on the shape of the run itself, which you can only do where you already know what the run was supposed to look like. That means evaluation, not production. Three checks do most of the work. Compare the actual step count against an expected range, and a run that hit its cap separates cleanly from one that finished in four steps. Check the tool calls, and a tool that was invoked but returned nothing usable, or one that should have fired and never did, stops hiding. Check the trajectory, the sequence of actions, and you catch reruns, skipped steps, and loops that a final-answer check cannot see.&lt;/p&gt;

&lt;p&gt;There is a real ceiling here, and I want to be honest about it. If the harness already erased the signal, no downstream check recovers the original error. What these assertions give you is the symptom, loud and early, which is enough to send you to the trace where the swallowed exception gets diagnosed. Every silent failure I have chased got caught the same way: a person finally noticed a weird answer, never a test and never an alert, and a couple of them had been running for weeks by the time anyone did. Run-shape checks are how you stop depending on that person.&lt;/p&gt;

&lt;h2&gt;
  
  
  The defaults that keep lying to you
&lt;/h2&gt;

&lt;p&gt;If you change only five things, change these.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Make retry wrappers record the attempt count&lt;/strong&gt; and mark the span when the final try fails.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Give a step cap its own finish reason&lt;/strong&gt; so cap exhaustion never wears the shape of success.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Catch narrowly around tool calls,&lt;/strong&gt; record the exception, then recover.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Run parsers in strict mode&lt;/strong&gt; so a missing field fails loudly instead of getting invented.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Record which model actually answered&lt;/strong&gt; when a fallback quietly takes over.&lt;/p&gt;

&lt;p&gt;If you want the deeper version, &lt;a href="https://futureagi.com/blog/agent-harness-silent-failures/?utm_source=fagiDevto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=blogdistribution" rel="noopener noreferrer"&gt;this piece&lt;/a&gt; walks through all five patterns and the exact span-status behavior that keeps them invisible.&lt;/p&gt;

&lt;p&gt;I would like to know which of these has bitten you. For me it is almost always the first one, a retry wrapper handing back the last thing that failed as though it were an answer.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>opentelemetry</category>
      <category>observability</category>
      <category>llm</category>
    </item>
    <item>
      <title>My agent had great traces and still never got better. Here is the loop I built.</title>
      <dc:creator>Kartik N V J K</dc:creator>
      <pubDate>Wed, 07 Oct 2026 18:18:40 +0000</pubDate>
      <link>https://dev.to/kartik-nvjk/my-agent-had-great-traces-and-still-never-got-better-here-is-the-loop-i-built-15o9</link>
      <guid>https://dev.to/kartik-nvjk/my-agent-had-great-traces-and-still-never-got-better-here-is-the-loop-i-built-15o9</guid>
      <description>&lt;p&gt;For about a year I thought observability was the finish line. I had traced everything. Every model call, every tool call, every retrieval showed up as a span, and I could open any request and see exactly what my agent did, in order. It felt like control.&lt;/p&gt;

&lt;p&gt;Then I looked at what all that tracing had actually changed, and the answer was close to nothing. I was capturing roughly a hundred failing conversations a week and turning maybe three of them into something that stopped the bug from coming back. The other ninety-seven sat in storage with a nicer interface. My agent was fully observable and getting no better.&lt;/p&gt;

&lt;h2&gt;
  
  
  A trace records what happened, not whether it was any good
&lt;/h2&gt;

&lt;p&gt;This was the part I had backwards. A trace is a faithful recording of behavior. It tells me the model was called, the tool looped three times, the retriever returned these documents, the whole turn took 800 milliseconds and came back a 200. What it does not tell me is whether the answer was right. A wrong answer returns a 200 too. It gets filed next to a thousand correct runs with no label on it, and nothing about having recorded it makes the next version of my agent avoid it.&lt;/p&gt;

&lt;p&gt;Monitoring told me the agent responded in 800 milliseconds with a 200. Observability told me it responded by retrieving a stale document and summarizing it wrong, with total confidence. Both were true. Neither one scored the answer, and that missing score was the whole problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  The missing piece was a score, and then a loop
&lt;/h2&gt;

&lt;p&gt;The thing that turns an inert trace into a signal is a score. The moment I attach a quality label to a trace, from a rule, a judge, or a human review, I can do something with it. So I stopped treating observability as the end and started treating it as step one of a loop.&lt;/p&gt;

&lt;p&gt;The loop has six steps, and it is a circle, not a line. Observe: capture every request as a trace. Evaluate: score each trace against a rubric, a deterministic rule, or an LLM judge, so every run gets a quality label. Identify: filter the ones that scored below my threshold. Curate: turn those failing traces into labeled eval cases, each with the input, the output, and why it failed. Improve: sharpen the prompt, repair the context, fix the harness, or change the model. Deploy behind a regression gate: re-run that dataset on every change and block the deploy if the pass rate drops. Then step six feeds back into step one, and the failure I caught once is what stops it recurring.&lt;/p&gt;

&lt;h2&gt;
  
  
  The step everyone skips is the gate
&lt;/h2&gt;

&lt;p&gt;For a long time I did the first five steps and skipped the sixth. I would find a failure, fix it, feel productive, and move on. A few weeks later the same class of bug was back, because nothing in my pipeline remembered that I had already fixed it.&lt;/p&gt;

&lt;p&gt;The regression gate is what remembers. I keep the failing cases I have already fixed in a dataset, re-run the whole set on every change, and fail the build if the pass rate drops below a bar. The bar is rarely 100 percent, which is too brittle to live with. I set it around 95, which still means a change that breaks five cases I already fixed cannot merge without me seeing it. It is the cheapest insurance I have, and it is the piece I ignored the longest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real failures beat the ones you invent
&lt;/h2&gt;

&lt;p&gt;The best eval cases I have are not hand-written. They are production traces that already failed. A synthetic test set is my guess about what might go wrong. A failing trace is a thing that actually went wrong, on a real request, with the exact input that broke it. Converting those into eval cases is the highest-value move in the whole loop.&lt;/p&gt;

&lt;p&gt;The trap is volume. If I promote every single failure, my dataset turns into copy after copy of the same bug and I drown in it. So I group near-identical failures and keep a representative few of each kind. The dataset should cover distinct failure modes, not count incidents. One good example of a failure beats a pile of duplicates of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  I track two numbers, and only together
&lt;/h2&gt;

&lt;p&gt;A loop you cannot measure is a loop you will quietly abandon, so I watch two numbers. The first is loop yield: of all the failing traces I captured, how many actually became eval cases. If I am logging a hundred failures a week and converting three, the loop is decorative, which was exactly where I started. The second is regression-gate pass rate: of the cases in my dataset, how many the current agent passes.&lt;/p&gt;

&lt;p&gt;Read either one alone and it will lie to you. High yield with a falling pass rate means I am taking on debt faster than I am fixing it. A high pass rate with near-zero yield means I am passing a tiny stale dataset and calling it confidence. Read together, they tell me whether the agent is actually learning from what it got wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  The mistakes that kept my agent from improving
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;I treated capture as the goal.&lt;/strong&gt; Tracing everything felt like progress. It was storage until I scored it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I skipped the regression gate.&lt;/strong&gt; Fixing a bug without a gate just means fixing it again next month.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I promoted every failure.&lt;/strong&gt; The dataset bloated with duplicates and I stopped trusting it. Dedupe to distinct modes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I set the gate at 100 percent.&lt;/strong&gt; Too brittle, so it blocked everything, so I turned it off, which was worse. 95 held.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I measured nothing.&lt;/strong&gt; Without loop yield I had no idea that ninety-seven of every hundred failures were evaporating.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The lesson I keep coming back to is that observability is necessary and nowhere near sufficient. Capturing what the agent did is step one. The value is in the five steps after it, the ones that turn a recorded failure into a test the next deploy has to pass. If you want the full version, with the span-capture code and the exact curation step I skipped for too long, I wrote it all up in &lt;a href="https://futureagi.com/blog/agent-observability-feedback-loop-learning/?utm_source=fagiDevto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=blogdistribution" rel="noopener noreferrer"&gt;this piece&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you run an agent in production, I am curious which step you skip. For me it was the regression gate, and I paid for it by fixing the same bug more than once before it stuck.&lt;/p&gt;

</description>
      <category>observability</category>
      <category>llm</category>
      <category>agents</category>
      <category>cicd</category>
    </item>
    <item>
      <title>LlamaIndex makes RAG easy to build and hard to debug. Here is how I evaluate it.</title>
      <dc:creator>Kartik N V J K</dc:creator>
      <pubDate>Wed, 02 Sep 2026 10:34:35 +0000</pubDate>
      <link>https://dev.to/kartik-nvjk/llamaindex-makes-rag-easy-to-build-and-hard-to-debug-here-is-how-i-evaluate-it-188b</link>
      <guid>https://dev.to/kartik-nvjk/llamaindex-makes-rag-easy-to-build-and-hard-to-debug-here-is-how-i-evaluate-it-188b</guid>
      <description>&lt;p&gt;I built a RAG app on LlamaIndex in about four lines. Wire an index to a query engine, point it at my documents, ask a question, get an answer. The first hundred queries were great. I was impressed with how little code it took.&lt;/p&gt;

&lt;p&gt;Then a user asked something my little setup had never been tested on. The answer came back confident and wrong. I checked my eval, which reported a single faithfulness score, and all it told me was that faithfulness had dropped. Not which part of the pipeline broke. Not why. Just a number going down.&lt;/p&gt;

&lt;p&gt;That was the moment I understood the trap. LlamaIndex makes RAG incredibly easy to assemble, and that ease hides how many separate moving parts you just wired together. One quality score cannot debug a thing made of five different pieces. Here is how I evaluate it now, layer by layer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why one RAG score is not enough here
&lt;/h2&gt;

&lt;p&gt;Plain RAG is basically two steps: retrieve some chunks, write an answer from them. Two steps means two things to check, and one score almost covers it.&lt;/p&gt;

&lt;p&gt;LlamaIndex is rarely that flat. The interesting apps compose. You add a router that picks between several engines. You add a step that breaks a big question into smaller ones. You pick a synthesizer mode that decides how the final answer gets assembled. You maybe turn the whole thing into an agent that calls tools. Every one of those pieces is its own little component with its own way of failing.&lt;/p&gt;

&lt;p&gt;So when a composed pipeline gives a wrong answer, the single faithfulness score is measuring the very end of a long chain and telling you nothing about where the chain broke. The fix is to stop scoring the program as one blob and start scoring each piece against its own job. I think of it as four layers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Layer one: score the retrieval on its own
&lt;/h2&gt;

&lt;p&gt;The first layer is the retrieval, scored completely independently of the answer that comes after it. This is the upstream signal. If retrieval is broken, every later score will look bad too, so this is where the debugging should start.&lt;/p&gt;

&lt;p&gt;Three things I check on the retrieved chunks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Are the chunks actually relevant to the question?&lt;/strong&gt; This catches the classic case where the search grabbed a passage that shares words with the query but means something different. You asked about Section 12, it handed you Section 9.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Do the chunks actually support the claims in the answer?&lt;/strong&gt; This catches invented citations, where the answer points at a chunk that does not say what the answer claims.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Did the answer even use the chunks it fetched?&lt;/strong&gt; This one surprised me. If you fetch ten chunks and the answer uses two, you are over-fetching, and that is both wasteful and a sign your retrieval settings are loose. The fix is usually a reranker before the answer step, or just pulling fewer chunks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The rule that made this useful: score retrieval per retriever, not per app. Different retrieval methods fail in different shapes, and tagging the score by which retriever ran means a regression points straight at the one that moved.&lt;/p&gt;

&lt;h2&gt;
  
  
  Layer two: score the routing and the decomposition
&lt;/h2&gt;

&lt;p&gt;This is the layer generic RAG eval completely misses, and it is where two of my nastiest bugs lived.&lt;/p&gt;

&lt;p&gt;If you use a router that picks between engines, you have to score the routing decision on its own. Here is why it is sneaky: if the router sends a question to the wrong engine, the chunks that engine retrieves are still relevant to whatever it retrieved, and the answer is still grounded in them. Both your normal scores look fine. The answer is wrong purely because the wrong engine ran. So I score routing as its own question: given the query and the choices, did it pick the right engine? A right answer from the wrong engine is luck, and the next harder question will expose it.&lt;/p&gt;

&lt;p&gt;If you use a step that breaks a big question into smaller ones, score the decomposition too. The failure I hit here was a dropped condition. A user asked for X under a specific condition Y. The decomposer split it into "tell me about X" and "tell me about Y" as two separate questions, and the final answer lost the "under condition Y" part entirely. Each sub-question was answered perfectly. The combined answer was still wrong, because the join between them got lost.&lt;/p&gt;

&lt;p&gt;So for a decomposing engine I score each sub-question on its own, then score the final merged answer on completeness against all of them together. If the sub-questions score well but the final answer does not, the merge step is dropping something. If a single sub-question scores badly, that branch is your problem. Same data, two clearly different bugs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Layer three: watch which synthesizer mode you are using
&lt;/h2&gt;

&lt;p&gt;LlamaIndex gives you a few ways to assemble the final answer from the retrieved chunks, and they genuinely behave differently. One mode stuffs everything into a single call. Another refines the answer chunk by chunk. Another summarizes in a tree.&lt;/p&gt;

&lt;p&gt;The one that bit me: the tree-style summarizer drops citations on long contexts that the simpler mode handled fine. If you switch modes in a deploy and only score the final answer, all you see is that quality dropped after Tuesday, with no hint that the synthesizer mode was the cause. So I treat the synthesizer mode as a thing worth scoring on its own, especially citation validity, and I re-check it whenever the mode or the context length changes. Long-context behavior is exactly where these modes diverge.&lt;/p&gt;

&lt;h2&gt;
  
  
  Layer four: run the same checks in production, not just in CI
&lt;/h2&gt;

&lt;p&gt;Your offline eval catches the failures you thought to test. Production catches the ones you did not. So the same four layers of checks that run before release should also run against real traffic after release.&lt;/p&gt;

&lt;p&gt;You do not have to score everything. The cheap checks, like whether a citation actually exists, can run on every request. The expensive judge-based ones can run on a small sample of live traffic. Then you watch for a sustained drop in any one of them per route.&lt;/p&gt;

&lt;p&gt;The most useful signal turned out to be the gap between my offline scores and my live scores. When they agree, my test set still looks like reality. When they drift apart, my test set has gone stale and is no longer testing what users are actually asking. That gap is worth watching on its own.&lt;/p&gt;

&lt;h2&gt;
  
  
  A note on sensitive data
&lt;/h2&gt;

&lt;p&gt;If your app retrieves over anything sensitive, like medical, legal, or financial documents, the same checks that score offline should also gate at request time. Run them before the answer goes out, and if the answer is not grounded in what was retrieved, fall back to a safe response instead of shipping the confident wrong one. It is the same rubric, just used as a gate instead of a report. For high-stakes paths I make it strict, every check has to pass. For casual ones, a majority is enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  The mistakes that ship LlamaIndex regressions quietly
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One faithfulness score for the whole app.&lt;/strong&gt; It tells you something broke, never which piece.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not scoring the router.&lt;/strong&gt; A wrong-engine answer looks perfectly grounded, so it hides in plain sight.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not scoring the decomposition.&lt;/strong&gt; The dropped-condition bug passes every per-sub-question check.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ignoring the synthesizer mode.&lt;/strong&gt; Switching modes can drop citations with no other visible cause.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Over-fetching and never checking.&lt;/strong&gt; If the answer ignores most of what you retrieved, you are paying for chunks that do nothing and loosening your relevance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI-only eval.&lt;/strong&gt; Production drifts past a frozen test set within a quarter. Score live traffic too.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The lesson I keep coming back to is that LlamaIndex's biggest strength, how easily it composes primitives, is also what makes it hard to debug. Every primitive you add is another place a failure can hide, and a single score averages all of them into one useless number. Once I scored each layer on its own, the bug that had been invisible for a week was obvious in an afternoon.&lt;/p&gt;

&lt;p&gt;If you want the deeper version, with the exact rubric for each layer and how to wire routing and decomposition checks specifically, &lt;a href="https://futureagi.com/blog/evaluating-llamaindex-rag-2026/?utm_source=fagiDevto&amp;amp;utm_medium=organic&amp;amp;utm_campaign=blogdistribution" rel="noopener noreferrer"&gt;this piece&lt;/a&gt; walks through all four layers in detail.&lt;/p&gt;

&lt;p&gt;If you run LlamaIndex in production, I am curious which primitive broke on you first. For me it was the router, an answer that was perfectly grounded in evidence the wrong engine went and fetched.&lt;/p&gt;

</description>
      <category>llamaindex</category>
      <category>rag</category>
      <category>llm</category>
      <category>testing</category>
    </item>
    <item>
      <title>My DSPy pipeline compiled beautifully and got worse in production</title>
      <dc:creator>Kartik N V J K</dc:creator>
      <pubDate>Mon, 31 Aug 2026 11:16:15 +0000</pubDate>
      <link>https://dev.to/kartik-nvjk/my-dspy-pipeline-compiled-beautifully-and-got-worse-in-production-1hk7</link>
      <guid>https://dev.to/kartik-nvjk/my-dspy-pipeline-compiled-beautifully-and-got-worse-in-production-1hk7</guid>
      <description>&lt;p&gt;I love the DSPy idea. You stop hand-editing prompts and let the compiler optimize them for you against a metric and a training set. I built a RAG pipeline that way, the compile score came out high, the hold-out looked fine, and I shipped it.&lt;/p&gt;

&lt;p&gt;Live traffic quality was worse than what I had before. Nothing errored. The numbers I had been watching just did not match what users were getting.&lt;/p&gt;

&lt;p&gt;The problem was not DSPy. It was what I was optimizing against and what I was measuring. Here is the short version of what I learned.&lt;/p&gt;

&lt;p&gt;The metric you compile against is not your production rubric&lt;/p&gt;

&lt;p&gt;DSPy optimizes your prompts against a metric you give the compiler. That metric has to be cheap, because the compiler scores thousands of trial prompts in a single pass. So in practice it is something thin: does the final answer contain the expected string, a single yes-or-no judge call, that kind of thing.&lt;/p&gt;

&lt;p&gt;But your product is not judged on a thin metric. A real RAG answer needs to be grounded in what was retrieved, complete on multi-part questions, and willing to refuse when the answer is not there. None of that fits into the cheap check the compiler runs five thousand times.&lt;/p&gt;

&lt;p&gt;So when the cheap compile metric and the real rubric disagree, the compiler happily overfits the cheap one. It gets very good at the thing you told it to measure, which was never quite the thing you actually cared about. That is exactly how a pipeline scores high at compile time and ships worse.&lt;/p&gt;

&lt;p&gt;The fix is not a cleverer cheap metric. It is to keep the cheap metric where it belongs, inside the compile loop, and run the real, rich rubric separately, on your hold-out set and on live traffic.&lt;/p&gt;

&lt;p&gt;Score the Signature, not the whole program&lt;/p&gt;

&lt;p&gt;The second thing I got wrong: I scored the pipeline end to end, one number for the whole thing.&lt;/p&gt;

&lt;p&gt;A DSPy program is a few modules chained together, each with its own little job. Mine had a retrieval step and an answer step. When the single end-to-end score dropped, it told me the program got worse and absolutely nothing about which step caused it. I was left guessing, and I guessed wrong for a while.&lt;/p&gt;

&lt;p&gt;What actually works is scoring each module against its own job:&lt;/p&gt;

&lt;p&gt;The retrieval step gets judged on whether it fetched the right material.&lt;br&gt;
The answer step gets judged on whether it stayed grounded in that material and answered the whole question.&lt;/p&gt;

&lt;p&gt;Now when the program regresses, the module scores point straight at the culprit. If retrieval tanks while the answer step holds, I know the compiler produced a bad retrieval prompt and I fix that one. The end-to-end number could never tell me that.&lt;/p&gt;

&lt;p&gt;Every module can pass and the program still fail&lt;/p&gt;

&lt;p&gt;Here is the sneaky one. Sometimes each module scores fine on its own and the program is still wrong, because the composition lost something between the steps. Retrieval fetched the right passages. The answer step reasoned fine over what it got. The final answer was still off.&lt;/p&gt;

&lt;p&gt;So I also keep one check that looks at the whole run and asks, when the final answer is wrong, which step was the proximate cause. Run that across a handful of failing cases and you get an actual distribution instead of a hunch. If most of the failures trace back to retrieval, you fix retrieval first. If they trace back to the answer step despite it scoring well in isolation, that is your real weak link.&lt;/p&gt;

&lt;p&gt;What I do now, in one line&lt;/p&gt;

&lt;p&gt;Compile with the cheap metric, but never trust it as the verdict. Judge each module on its own job with the real rubric, keep one check for where the cascade breaks, and run all of it on a fresh hold-out and a slice of live traffic, not just on the set the compiler already saw. The moment I split the score up that way, the regression that had been invisible was obvious.&lt;/p&gt;

&lt;p&gt;If you want the deeper version, with the exact per-module rubrics and how to wire the compile-versus-production comparison into CI, this piece goes through it step by step.&lt;/p&gt;

&lt;p&gt;If you run DSPy in production, I am curious whether your compile scores and your live scores ever drifted apart. Mine did, quietly, and the gap was the whole lesson.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>machinelearning</category>
      <category>rag</category>
    </item>
  </channel>
</rss>
