<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Benjin Zhu on Medium]]></title>
        <description><![CDATA[Stories by Benjin Zhu on Medium]]></description>
        <link>https://medium.com/@benjinzhu?source=rss-54f38328d248------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*fbinGlOZivaFGc9a.jpg</url>
            <title>Stories by Benjin Zhu on Medium</title>
            <link>https://medium.com/@benjinzhu?source=rss-54f38328d248------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 20:04:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@benjinzhu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a Human-in-the-Loop Scoring View in Braintrust]]></title>
            <link>https://medium.com/sage-ai/building-a-human-in-the-loop-scoring-view-in-braintrust-6f1d2e303aed?source=rss-54f38328d248------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f1d2e303aed</guid>
            <category><![CDATA[llm-evaluation]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[braintrust]]></category>
            <category><![CDATA[human-in-the-loop]]></category>
            <dc:creator><![CDATA[Benjin Zhu]]></dc:creator>
            <pubDate>Fri, 07 Aug 2026 02:17:29 GMT</pubDate>
            <atom:updated>2026-08-07T02:17:29.310Z</atom:updated>
            <content:encoded><![CDATA[<p>Automated evaluations are helpful, but they rarely tell the whole story.</p><p>A bit of context first. We use Braintrust to run and inspect evaluations for our LLM application. It gives us a place to look at traces, compare runs, and collect feedback when we want a human reviewer to take a closer look.</p><p>The workflow we were reviewing was a data-query assistant. A user asks a business question, the assistant turns that question into a structured query, sends it to an MCP-connected data source, and then uses the returned records to write an answer back to the user.</p><p>We also had a gold dataset: a curated set of test questions, expected queries, and expected data outputs. It gave us a steady reference point as we changed prompts, tools, and retrieval logic.</p><p>Braintrust made it easy to run those evals. The harder part was reviewing one run and quickly understanding what happened.</p><p>Before we built this custom view, reviewing a trace meant a lot of clicking around. You had to open the trace, dig through nested spans, find the generated query, locate the data response, compare it with the expected output, and then decide whether the final answer was actually useful.</p><p>The information was all there. It just was not organized around the way people actually review these runs.</p><p>That is why we built a custom Braintrust React view for human-in-the-loop scoring.</p><h3>The Review Problem We Needed to Solve</h3><p>The need was straightforward: reviewers needed one place to inspect both gold dataset evaluations and real production questions.</p><p>For each run, reviewers needed to answer questions like:</p><ul><li>Did the generated query match the user’s intent?</li><li>Did it query the right object, fields, and filters?</li><li>Did the returned data make sense?</li><li>Did the final response clearly answer the user?</li><li>Would we be comfortable showing this answer to a customer?</li></ul><p>Automated metrics help with some of this, but only up to a point. Exact-match checks can be too rigid. Similarity scores can be too fuzzy. And neither one consistently captures whether an answer feels clear, useful, complete, and trustworthy.</p><p>That is where human review still matters, especially in LLM-powered workflows that generate both queries and user-facing responses.</p><h3>What We Wanted the View to Do</h3><p>The goal was to make review faster, easier, and more consistent inside Braintrust.</p><p>We had two related workflows to support.</p><p>The first was gold dataset evaluation review. Here, reviewers compare the expected query and expected data output with what the agent actually generated.</p><p>The second was production trace review. In production, there usually is no gold expected output. Instead, the reviewer needs to look at a real user question, see what query was executed, inspect the returned data, and judge whether the final response was good.</p><p>For both workflows, the view needed to pull the most important context into one place:</p><ul><li>The original user question</li><li>The generated query payload</li><li>The returned data output</li><li>The chat response</li><li>Automated scorer results, when available</li><li>Human review scores</li></ul><h3>Why a Custom React View</h3><p>Braintrust supports custom views, and Braintrust’s Loop agent can help generate custom trace visualizations from natural language. That is a great way to get started quickly or explore trace data without writing everything by hand.</p><p>For this project, though, we needed something more opinionated.</p><p>Gold dataset traces and production log traces did not have the same shape. The view needed to recognize which kind of trace it was looking at, extract the right fields, and present the result in a way that matched how reviewers think through the run.</p><p>So we wrote the custom Braintrust React view ourselves.</p><p>That gave us control over:</p><ul><li>How experiment traces and production traces are detected</li><li>Where query payloads and data outputs are extracted from</li><li>How expected and actual values are compared in experiments</li><li>How structured query payloads, data outputs, and rendered chat responses are displayed</li><li>How human review scores are saved back to Braintrust</li></ul><h3>Turning Trace Data Into Something Reviewable</h3><p>The main challenge was not just building a cleaner UI. It was figuring out where the review data actually lived.</p><p>Gold dataset evaluation traces are fairly direct. The generated values are available on the root eval output:</p><pre>output.actual_query_input<br><br>output.actual_output_summary<br><br>output.result.output</pre><p>That makes the experiment view relatively straightforward. We can read the actual query payload and actual data output from the root span, then compare them with the expected query and expected output from the gold dataset.</p><p>Production log traces are different. They look more like conversation trees. A single trace can include user questions, tool calls, and response-generation spans. In that case, the useful review data usually lives under child spans:</p><pre>question span<br><br>   executeQuery span<br>      input = actual query payload<br>      output.structured_content_preview = actual data output<br><br>   response spans<br>      output = generated response text</pre><p>Because of that, the custom view uses two extraction paths:</p><ul><li>A root-based path for gold dataset experiment traces</li><li>A child-span-based path for production log traces</li></ul><p>Keeping those paths separate made the implementation easier to reason about. Gold evals are comparison records. Production logs are execution trees. Once we treated them as different review workflows, the view became simpler and more useful.</p><h3>Designing the Review Layout</h3><p>The final view has two modes.</p><p>For gold dataset evaluations, the view shows:</p><ul><li>The original user question</li><li>The expected query payload</li><li>The actual generated query payload</li><li>The expected data output</li><li>The actual data output</li><li>The generated chat response</li><li>Automated scorer results</li><li>Human review scores</li></ul><p>Because the expected and actual values are shown side by side, reviewers can quickly spot where the generated query or returned data diverges from the gold dataset.</p><p>An example is shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pVE9wXE5yRtY8UeE4sTxuw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sz9XDXcqcPYiFlMRtqrZqQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H44xmgC8q4oNxr4TQ_CePg.png" /><figcaption>Example of Experiment View</figcaption></figure><p>In the experiment view, we added a few lightweight visual cues to make review feel less tedious. The expected and actual rows are shown directly in the table, with differences highlighted inline. That way, reviewers do not have to scan through two large JSON blocks line by line just to find what changed. Missing expected content and extra generated content are also called out separately, so it is easier to see exactly where the generated query or data output drifted from the gold record.</p><p>We applied the same principle to the scorer section. Instead of listing every score as plain text, the view uses color to make the results easier to read at a glance: green for strong results, yellow for borderline ones, and red for low scores. The goal is not to let colors make the decision for the reviewer. It is simply to give them a quick signal about where to focus first, especially when they are looking through many runs.</p><p>For production logs, the view focuses on what happened for a real user question:</p><ul><li>The user question</li><li>The actual query payload sent to the MCP server</li><li>The actual data response</li><li>The generated chat response</li><li>Human review scores</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xUWgJzlkZNi-wSGsdQbmEA.png" /><figcaption>Example of Log View</figcaption></figure><p>This keeps production review more direct. Since production questions usually do not come with an expected gold output, the workflow is less about comparison and more about reconstructing what happened.</p><h3>Making the Details Easy to Inspect</h3><p>The query payload and data output are displayed as formatted structured data. That makes it much easier to inspect the object being queried, the selected fields, the filters, the ordering, and the returned records.</p><p>The chat response needs slightly different handling. Some responses are plain text, while others include HTML-like formatting from the response layer. The custom React view normalizes the response and renders it with consistent typography, so reviewers can focus on the answer instead of the formatting.</p><h3>Adding Human Review Scores</h3><p>The final piece was adding a simple scoring section for human reviewers.</p><p>Reviewers can assign 1–5 scores for dimensions such as:</p><ul><li>Data Accuracy</li><li>Response Utility</li><li>Clarity and Readability</li><li>Tone and Professionalism</li><li>Conciseness</li><li>Overall Quality</li></ul><p>Those values are saved back to Braintrust through the update function:</p><pre>update(key, String(n))<br><br>update(&quot;hr_saved_at&quot;, new Date().toISOString())</pre><p>That turns the view from a passive trace viewer into a practical review tool. A reviewer can inspect the run, make a judgment, and save structured feedback without breaking their flow.</p><h3>What This Changed for Reviewers</h3><p>The biggest change was that review started to feel like a workflow instead of a scavenger hunt.</p><p>For gold dataset experiments, reviewers need comparison: did the generated query and returned data match the curated expected answer?</p><p>For production logs, reviewers need reconstruction: what did the user ask, what query ran, what data came back, and was the final response good enough?</p><p>Those workflows are related, but they are not the same. Bringing both into one custom Braintrust React view made review faster because the UI could adapt to the trace type instead of forcing reviewers through the same path every time.</p><p>It also made the review process feel more practical. Instead of asking reviewers to dig through spans manually, the view brings the important pieces forward and lets them focus on the real judgment: is this correct, useful, and trustworthy?</p><h3>Final Takeaway</h3><p>Automated evals are still important. They catch regressions, compare runs, and give teams a scalable signal.</p><p>But for LLM-powered data workflows, especially ones that generate queries and customer-facing answers, human review is still essential. The hard questions are not always binary. A response can be technically correct but hard to read. A query can return data but miss the user’s real intent. An answer can be concise but still not very useful.</p><p>The custom Braintrust React view gave us a way to bring those human judgments back into the evaluation loop.</p><p>And more importantly, it made review feel closer to the actual user experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f1d2e303aed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sage-ai/building-a-human-in-the-loop-scoring-view-in-braintrust-6f1d2e303aed">Building a Human-in-the-Loop Scoring View in Braintrust</a> was originally published in <a href="https://medium.com/sage-ai">Sage Ai</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>