Knowing whether it is reliable
Knowing what changed when quality drops
Improving it systematically
Straightforward
Hard
Harder
The actual job
The feedback loop we build today is what lets an AI feature survive production.
Speaker notes: Welcome everyone. Over the next ~110 minutes we are going to build
a support triage agent from scratch, then instrument it with tracing, evals,
managed prompts, and an edge-case remediation loop. By the end you will
have a working reference app and a repeatable mental model for shipping AI
features with assurance.
Speaker notes: This is the running order. We will alternate between slides
and live coding. Each part builds on the previous one. The total is around
110 minutes with natural break points between parts.
Speaker notes: Quick self-orientation. Most people in the room will
fall into one of these categories. The techniques apply whether you
are building agents, RAG systems, or any LLM-powered workflow.
Speaker notes: Before we get hands-on, let's look at the landscape.
Why do so many AI projects stall between prototype and production,
and what does that mean for how we build?
Speaker notes: These are not small-sample anecdotes. MIT surveyed 350+
employees and analysed 300 public deployments. The Digital Applied survey
of 650 enterprise tech leaders found that the teams who successfully scale
invest more in evaluation infrastructure and monitoring than in model
selection. This workshop teaches that operational skill set.
Speaker notes: This is deliberately opinionated. These are patterns
we see repeatedly across teams. The workshop is designed to address
each of these directly.
Speaker notes: Frame the workshop. Most teams stop at the prototype.
A working demo is not evidence of reliability. This workshop covers
everything after that first demo moment - tracing, evaluation,
managed deployment, and edge-case remediation.
Speaker notes: This table is the conceptual backbone of the workshop.
Every row maps to a specific section we will build together.
Speaker notes: These are the concrete skills. The tools matter, but the
mental model is what you take with you: observe, measure, improve, test.
Speaker notes: Make the Braintrust value prop explicit. This is not
a generic observability tool - it is a complete quality platform
that covers the full lifecycle from tracing to evaluation to managed
deployment.
Speaker notes: This is the core mental model. Every production failure
becomes a dataset row. Every prompt change gets evaluated. The flywheel
compounds -- the more you use it, the more coverage you have.
Speaker notes: Before we start building, let's make sure everyone is set up
and walk through the agent we will be building and its architecture.
Speaker notes: Let's get set up first. Scan the QR code or clone the repo now.
The README has full instructions. mise trust && mise install && make setup gets
you from zero to running. If you prefer not to use mise, Node 22 and pnpm
are the only hard requirements. Get this running while we cover the intro.
Speaker notes: Helpr is purely educational -- it exists to give us a
realistic enough domain to demonstrate production AI patterns without
requiring specialised knowledge. Support triage is relatable: everyone
has filed a ticket. The structured output covers classification,
escalation logic, customer-facing text, and a confidence score -- just
enough complexity to exercise tracing, evals, managed prompts, and
remediation. Emphasise that nobody should ship this as-is; the value
is the workflow, not the app.
Speaker notes: We start with a deterministic entry point. The ticket
comes in and collect-context gathers evidence -- help centre articles,
recent account events. No LLM involved yet, just data assembly.
Speaker notes: Now the LLM stages. Triage-specialist classifies and
routes. Policy-reviewer catches over-reaction and under-reaction.
Reply-writer drafts the customer response. Three separate prompts,
each with a single responsibility -- much easier to debug than a monolith.
Speaker notes: The deterministic exit. Finalize-result assembles the
structured output. The escalation decision is a code check, not an LLM
guess. If escalation is needed, it is a deterministic side effect.
Deterministic bookends keep the business contract stable.
Speaker notes: Finally, Braintrust wraps the whole thing. Traces give
full execution visibility. Prompts and Tools are managed centrally so
you can update without redeploying. Evals and online scorers measure
quality continuously. This is the complete production-ready architecture.
Speaker notes: Each checkpoint is a git branch under workshop/. If you fall behind
at any point, checkout the next branch and catch up immediately. Phase 09 has two
sub-checkpoints: 09a replays the failure, 09b applies the fix and runs regression
evals. The terminal commands will be on screen when we reach each phase.
Speaker notes: Let's start by building the agent itself. We will go
from an empty scaffold to a full 5-stage agent workflow.
Speaker notes: We start with a system prompt and structured output.
The result will look reasonable. That is exactly the trap -- it looks
good on one example, but we have no idea if it is reliable across
the range of real tickets.
Speaker notes: This is the entire agent at checkpoint 01. Notice
the Zod schema -- we get typed structured output immediately.
Simple, but we have no visibility into why it made its decisions.
Speaker notes: Let the room try this now. make demo runs four
pre-built tickets end-to-end. make ticket is interactive - type a
ticket, press Enter to accept the inferred defaults for customer
tier, product area, and account. The output is a fully structured
TriageResult with category, severity, escalation, confidence,
reasoning, recommended actions, and a draft reply.
Speaker notes: Tools are deterministic and use local sample data so
the workshop stays stable. But even with deterministic tools, the model
can ignore them, misinterpret the results, or fail to act on critical
signals like a billing_admin_role_removed event.
Speaker notes: We gather context before the model call and pass it
in. Escalation is a deterministic side effect. Still a monolith --
one big prompt making all decisions at once.
Speaker notes: This is the architectural shift. Instead of one prompt
making every decision, we have five stages with clear responsibilities.
The policy-reviewer is the safety net. Separating decision from reply
lets you improve wording and policy independently.
Speaker notes: This is the shape that stays for the rest of the
workshop. The workflow is explicit. Each stage can be traced,
tested, and improved independently.
Speaker notes: Everyone should be coding now. Walk through the key
changes live. If anyone falls behind, checkout 03-specialist-stages
to catch up before we add tracing.
Speaker notes: The agent works. Now we need to see inside it.
Without observability, debugging is guesswork.
Speaker notes: We wrap each stage in a traced span. The root span
carries ticket metadata. Stage spans carry prompt mode and reviewer
action. After this checkpoint, run a ticket and open Braintrust to
see the trace.
Speaker notes: The structure of the code mirrors the structure of
the trace tree in Braintrust. tracedWorkflow creates the root span.
withChildSpan creates nested spans for each stage.
Speaker notes: This is the diagnostic framework. When something goes
wrong, the trace tells you which stage to fix. Bookmark this slide --
you will use it during the failure replay later.
Speaker notes: After running make demo, open Braintrust and find
the trace. Expand each stage. Notice the model call details, the
tool calls, and the metadata. This is what observability looks like
for an AI system.
Speaker notes: We can see inside the agent now. Next we need to
measure its quality systematically.
Speaker notes: Define success before introducing measurement. This
slide makes the eval section feel inevitable rather than optional.
Speaker notes: The seed dataset has representative test cases. Deterministic
scorers are cheap and fast - run them on everything. LLM-as-a-judge scorers
catch nuance but cost more - use them strategically. After running the eval,
open Braintrust Experiments to see the score breakdown per case.
Speaker notes: The agent works, we can see it, we can measure it.
Now we move runtime control into Braintrust so prompts, tools, and
quality signals can be managed without redeploying code.
Speaker notes: This is the transition from "I can build and test locally"
to "my team can operate this in production." Managed mode is the mechanism.
Speaker notes: The app structure stays the same. What changes is where
the prompts and tools come from. In managed mode, Braintrust becomes
the platform. Non-engineers can edit prompts in the UI. The
parameter object controls the runtime model.
Speaker notes: Online scoring bridges offline evals and production
monitoring. Not every offline scorer belongs online, but the ones
that do make your logs operationally legible. Run make demo in managed
mode and check the trace -- scores now appear next to spans. Important
callout: we score every trace here for learning purposes. In production
you would sample 5-10% for LLM-based scorers to keep costs manageable.
Deterministic scorers are cheap and can run on every trace.
Speaker notes: This is the part that matters most. Everything we
built so far enables what comes next: turning a production failure
into a systematic fix.
Speaker notes: Read the ticket carefully. "Not urgent" -- the user is
being polite. But the CFO cannot do their job before a board meeting.
The model has to infer business impact from context, not surface wording.
Use the trace reading guide to identify which stage underreacted.
Speaker notes: Replay, baseline, fix, confirm, regress. The failure
becomes a future regression test. The eval set grows from production
experience, not just imagination. This is the operational muscle.
Speaker notes: This is the most important hands-on section. Take time
to inspect the trace. Identify whether the specialist underweighted
the impact or the reviewer failed to catch it. Then tighten the prompt
and rerun the eval.
Speaker notes: We have now approached the end of our session and would like to wrap up.
Speaker notes: These five points are the workshop in summary. The
tools are important, but the mental model is what you take with you.
If you remember one thing: edge cases are not bugs to fix
and forget -- they are the seed data for building lasting assurance.
Speaker notes: This is the adoption recipe. It is deliberately
simple - one workflow, one eval set, one feedback loop. The goal
is to get the first cycle running, not to build the perfect system.
Speaker notes: Encourage attendees to take what they learned back to
their teams. The workshop repo is a working reference - they can clone
it and adapt the patterns to their own use cases. The account team can
help with enterprise setup, SSO, and advanced features like online
scoring at scale.
Speaker notes: Open the floor for questions. The repo is their
reference implementation. The README has everything needed to run
any checkpoint independently.