Ruby is an AI sales assistant for B2B revenue teams. It runs 48 agents, and each can run as thousands of parallel instances, one per rep, account or deal. A rep points Ruby at an account, a deal or a calendar. Ruby does the research and writing a sales engineer would do before a meeting, then writes the results into the rep’s CRM, such as Salesforce or HubSpot.
Because that output ends up in a customer’s CRM, Ruby holds itself to one rule: any agent output a customer sees must be traceable to the exact prompt, evidence and cost that produced it. This post covers how the team built that on Langfuse.
Why it was hard
Agents fan out and nest. A parent agent spawns sub-agents, model calls run in thread executors, and research tools run in parallel. Ambient tracing context doesn’t follow all of that. When a model call loses its parent, it shows up as a flat row with no agent attached, and nobody can tell where it came from.
Any step, from account research to campaign personalisation, can put a mistake into a real CRM contact. When something goes wrong, the team needs to know which of dozens of steps failed, what the model was shown at that step, and what it cost.
Traces also carry customer data, including details about prospects and reps. Everything that leaves the process is masked before it’s sent, with one deliberate exception kept for attribution.
One run, one trace
Ruby’s agents work across four areas: account research, deal preparation, an analyst chat and campaign personalisation. Nothing is written to the CRM until the rep confirms it on a card.
Each agent run becomes one Langfuse trace, and the trace id is derived from Ruby’s own execution id. Deterministic quality scores run on every run, two LLM judges run on a sample, and rep feedback is attached to the exact run it’s about. Three alert rules post to Slack within an hour of a problem. Prompts for all but two agents live in Langfuse, so shipping or rolling back a prompt change means moving a label instead of deploying code.

One agent run as one trace, in Ruby's demo environment.
Because the trace id is derived from our own run id, anything that knows the run can find or score the trace later with no mapping table. Our database row and the Langfuse trace are the same object seen from two sides.
Ali Zaman, Lead Engineer, Ruby
Rolled out one layer at a time
Tracing went live on Langfuse Cloud in April 2026 and recorded every model call, with no sampling. The quality, prompt and alerting layers came over the next six months. Each was added only after it had proved itself on production traffic. The team went in this order:
- Tracing only, with every model call recorded.
- Trace ids derived from run ids, before anything else was added.
- Prompts moved into Langfuse one agent at a time, each keeping an in-code fallback.
- Judges added only after calibration on known-answer cases.
- Each alert fired on purpose with seeded data before the team relied on it.
How Ruby uses Langfuse
Ruby runs on Langfuse Cloud through the Python SDK over OpenTelemetry. A single project holds every environment: production, staging, demo, UAT and local. It also holds two more, one for experiments and one for the judges’ own model calls, which keeps test runs and judge calls out of the live scores. A handful of engineers run the whole fleet. Engineers debug from the traces, product reads cost per agent from them, and reps score answers into them from inside Ruby.
Tracing
Each run is one trace, with typed observations for agents, tools and generations. The typing is what lets Langfuse draw the agent graph. Nesting is set explicitly through a Python context variable, so a sub-agent’s calls land under that sub-agent even when they run on another thread pool. The session is the deal and the user is the rep.
The model provider returns token counts, but Langfuse can’t price them natively. So each generation carries its own usage and cost, including cache-read and cache-creation tokens. The costs come from the same price table Ruby uses in its own database. Tracing is best-effort: a tracing failure can never fail an agent run. See Langfuse's docs on tracing and token and cost tracking.

The trace header: latency, session, user, environment, cost and tokens on one line. Demo environment.
Prompts
~80 prompts live in Langfuse: about 50 agent and helper prompts and 26 quality rubrics, each named after its agent. Versions carry dev, staging and production labels. Moving a label puts a change live in about two minutes, the time it takes two 60-second caches to expire.
Every generation links to the prompt version it used, and that version is also stored on the run’s database row. To find out whether version 7 made the analyst better or worse, you filter by version. If Langfuse is unreachable, each agent falls back to a copy of its prompt kept in code. See Langfuse's docs on prompt management.
Scores and judges
Cheap checks run in code on every run. They score confidence and output length and structure, and they flag any raw tool markup that leaks into an answer a customer will see.
Two managed evaluators run on production traffic using Ruby’s own model key. A grounding judge scores 20% of runs against an anchored rubric in steps of 0.2. Before it scores, it has to list every claim as supported or unsupported. A wrong-entity judge checks 10% of runs to make sure the output is about the prospect and not the seller.
Before trusting either judge, the team ran both against known-answer cases with planted mistakes and counted false alarms and misses separately. When a rep gives an answer a thumbs up or down, it’s recorded as a score on that exact run, with an idempotent id. See Langfuse's docs on LLM-as-a-Judge.

Code and judge scores side by side on one run, with the judge's claim-by-claim comment. Demo environment.
Datasets and experiments
The golden datasets come from reviewed production runs plus hard cases added on purpose, such as failed research and thin context. Each case has a note saying why it’s there. To test a new model, the team runs it on the golden set next to the current model and judges both outputs. They review the comparison before changing any configuration.
That’s how Ruby decided to move to Sonnet 5.5 and to switch the grounding judge to Haiku 5.5. The wrong-entity judge stayed on Sonnet 4.6, because the cheaper model raised a false alarm. See Langfuse's docs on datasets and experiments.
Dashboards and alerts
Each environment has one dashboard. It shows cost by agent, cost by model, grounding and wrong-entity scores over time, and observation volume by level, where the ERROR line should stay at zero. Three alert rules post to Slack for each environment. They fire on more than five ERROR steps in an hour, a grounding average below 0.4, or a wrong-entity average below 0.8.
Two settings mattered more than the team expected. Alert windows are one hour, because day-long windows were evaluated too slowly to page anyone in time. And when an hour has no scored runs, the score monitors show no data, so a quiet hour doesn’t look like a quality collapse. See Langfuse's docs on dashboards and alerts.
What it changed
Observability did not make our agents good. It made it possible to know when they were not, within an hour, with the exact prompt and evidence in front of us. That is what let us put agents in front of a customer's CRM: for any single run we can show what it saw, what it decided and what it cost. For a product like ours, that is the difference between a feature and a liability.
Raja Meer Baz, Head of Product, Ruby
Every run of all 48 agents is traced and priced to the cent, across production, staging and experiments. Breaking cost down by agent, model or rep takes one filter.
Quality now has numbers behind it. Grounding averages 0.84 across about 1,500 judged runs, and wrong-entity averages 0.97 across about 280. In 340 scored customer-facing responses, tool markup leaked zero times.
Tracing also caught problems nothing else would have. Within a day of going live, typed observations showed a tool that was erroring. In another case, a judge kept flagging research that was actually sound, because the evidence the agent had used was missing from what the judge saw. Once the trace carried that evidence, the same run went from 0.2 to 0.95. After both, the team adopted a standing rule: if a model call isn’t in the trace, it doesn’t exist.
Changes also ship faster and with less risk. A prompt change goes live in about two minutes without a deploy. When account research moved from a sequential chain to parallel levels, a full run dropped from roughly 35 minutes to about 11, measured with Langfuse latency data. Every token is attributed before Ruby prices a feature.
Bonneville built Ruby's Langfuse layer and still runs it. Read the Ruby case study, or see how we set up Langfuse for teams running agents in production.
