I shipped a production reception agent that scored 270/270 in evals โ what actually broke
On 25 November 2026 I ran the platform release gate on this receptionist. It scored 270 out of 270...
On 25 November 2026 I ran the platform release gate on this receptionist. It scored 270 out of 270 cases and 670 out of 670 turns, first against a mock responder, then against a real Groq model. Zero safety failures. Zero bookings written without a confirmed yes.
I still was not done.
Those 270 cases were scripted text. The report in the repo is explicit: speech to text, text to speech, and real time to first audio were not measured. A few days later, the first live WebRTC call greeted the caller and then went silent. A second eval suite then found defects the scripted gate had never looked for.
What the agent does
It is a voice and chat receptionist for more than one business at once. You add a hotel or a dental clinic by writing one JSON config. Each caller turn goes through small agents: triage, then FAQ or booking or a human hand-off, then a guard. It answers hours, prices and policy questions, books a room or an appointment only after a confirmed yes, and hands off emergencies and cancellations to the team.
The stack is TypeScript, an Express API, a React console, and a custom orchestrator. I did not use LangGraph. Open questions go to Groq (gpt-oss-20b, with a smaller fallback). Live voice runs on LiveKit Agents: AssemblyAI for streaming speech to text and Inworld for speech, both through LiveKit Inference.
The score was text only, so the first live call was silent
The 270 case suite lives in evals/platform.jsonl. The harness in scripts/platform-eval.mts replays each scripted turn through the real orchestrator and checks the route, the tools, the wording, whether a booking was written, and whether the call was escalated. The gate fails the build if pass rate drops below 95 percent, or if any safety case fails.
That gate is useful, and easy to trust too much. The Groq run on 25 November 2026, from 1:25 to 1:30 AM PKT, used text only. When I wired a live LiveKit call, the worker transcribed the caller and then produced no speech after the greeting.
The cause was a type check, not a model failure. The Agents SDK skips generateReply when session.llm is undefined. My replies already came from a custom llmNode that calls the orchestrator, so I had not attached an LLM instance.
The fix is a placeholder LLM that satisfies the type check and yields no tokens. The orchestrator still writes the reply.
// server/livekit/placeholderLlm.ts
/** Satisfies `this.llm instanceof LLM`. Replies still come from llmNode. */
export class PlatformLlmPlaceholder extends llm.LLM {
chat({ chatCtx, toolCtx, connOptions = DEFAULT_API_CONNECT_OPTIONS }) {
return new EmptyLlmStream(this, { chatCtx, toolCtx: toolCtx as never, connOptions })
}
}
Voice still felt wrong after that. The local Silero voice activity detector ran on the laptop CPU and fell 5 to 15 seconds behind realtime, so calls felt stuck. Short answers such as "yes" and "no" were dropped because interruption required more than one word. Speculative generation ran on an interim transcript and then again on the final one, which could repeat a booking step.
I turned local VAD off and let AssemblyAI end the turn on the server. I set interruption minWords to 1. I disabled preemptive generation, because the booking agent is a state machine and a speculative run can skip or repeat a step. If the caller does not pick a room or a time, the agent now re-asks once with a short choice, then narrows to a yes or no on the first option.
// server/livekit/worker.ts
vad: null,
turnHandling: {
turnDetection: 'stt',
preemptiveGeneration: { enabled: false },
interruption: { minDuration: 500, minWords: 1, resumeFalseInterruption: true },
},
The model invented opening hours
A real Groq run had already shown a quieter failure. For a clinic hours question, gpt-oss-20b said a location closed at 5pm on Tuesday. The config said 7pm. The right passage was in context. The guard blocked the wrong time, so the caller heard a hand-off line instead of the answer.
Hours are structured data. I stopped asking the model to recite them. A get_hours tool now answers from the tenant config, and the LLM is skipped for those questions.
That fix created a second problem. The hours tool was too eager. A question about the gym, the spa, or how late you can stay still matched "hours" or "late", so the tool answered with the front desk hours. A held out case made this obvious: the config had no gym hours, and the reply still claimed the gym opened at 8am.
The tool now refuses questions that name a facility or a stay.
// server/agents/hoursTool.ts
const HOURS_Q = /\b(open|opening|close|closing|closed|hours?|what time|until|till|late|latest|earliest)\b/i
const NOT_HOURS = /\b(price|cost|fee|how much|book|appointment for|parking|address|where|spa|pool|gym|fitness|restaurant|breakfast|bar|kitchen|room service|kids club|beach|stay|last day)\b/i
export function isHoursQuestion(q: string): boolean {
return HOURS_Q.test(q) && !NOT_HOURS.test(q)
}
I want to be honest about the gap. After this routing change, that held out gym question still failed the caller-level eval, because the model invented gym hours when it should have said the team will confirm. Sending a facility question away from the hours tool is not the same as grounding the answer.
"Hmm" became the guest's name
Booking flows ask for a name. On a real call, people do not always answer with a name. They say "hmm", "umm", "haan", "ok", or "sorry?" while they think.
The name parser treated those as the guest. I found it in the dental flow first, then in the hotel flow: parseName("hmm") stored "Hmm". The booking then read that name back.
The fix is a shared filler check used by both verticals. If the utterance is only fillers or backchannels, the agent re-asks and stores nothing.
// src/lib/fillers.ts
export function isFillerUtterance(text: string): boolean {
const words = text.toLowerCase().replace(/[^a-z\s']/g, ' ').split(/\s+/).filter(Boolean)
if (words.length === 0) return true
return words.every((w) => FILLER_WORDS.has(w) || FILLER_SHAPE.test(w))
}
// src/lib/stateMachine.ts
export function parseName(text: string): string | null {
if (isFillerUtterance(text)) return null
// ...
}
This is the kind of bug a scripted happy path eval will miss if every fixture already has a clean name.
The booking prompt named a treatment the clinic does not offer
A later caller-level eval found a booking defect the 270 case gate had not caught. When a dental tenant started an appointment, the prompt offered "scale and polish" even when that treatment was not in the tenant config.
The prompt now lists the first three treatments from that tenant's own file.
// server/platform/agents/booking.ts
if (!s.treatment) {
s.expecting = 'treatment'
const offered = (t.dental?.treatments ?? []).slice(0, 3).map((x) => x.name.toLowerCase())
return reply(
offered.length
? `Sure. What's the appointment for? I can book ${spokenList(offered)}.`
: "Sure. What's the appointment for?",
'ask_treatment',
)
}
The same eval pass cleaned up two related failures. A severe symptom reply had grown to 58 words and included sales copy; it is now the short emergency advice plus a hand-off. Text that posed as a system update or a manager approving a free treatment is now flagged before triage.
How I write evals for agents
I keep two suites, and I no longer treat the first as the whole story.
The release gate is scripted. evals/platform.jsonl holds the cases. Each turn has exact expectations: which agent should answer, which tools should run, phrases that must or must not appear, and whether a booking or a hand-off is allowed. Safety categories must pass at 100 percent: injection, cross-tenant leak, tool error, severe emergency, and hand-off. Bookings may be written only after a confirmed yes. Hours, prices, policies and booking steps are answered by tools and templates, so only 60 of the 670 turns in that run called the model. I also run the same suite against a real model, paced, and I keep the dated report in the repo. A mock only score would not have shown the Tuesday 5pm hours error.
The second suite is caller level, in llm-evals/. It sends 40 caller-style questions, including tricky phrasing, identity questions, prompt injection and Roman Urdu, through the same orchestrator, still at text level. Rules check the last reply: required phrases, a word cap for voice, whether a booking was written, and a no fabrication rule (every price, clock time and phone number must exist in the config or in what the caller said). An LLM judge scores 1 to 5. A case passes when every rule passes and the judge gives at least 3. An 8 case held out set checks that fixes generalise. That suite found the invented treatment, the long emergency reply, the authority claim injection, and the facility hours bug, after the scripted 270 had already gone green.
Practical habits I would keep:
- Put fillers, one word answers, mid booking side questions, and "not yet" confirmations in the fixtures. Clean names and perfect yes answers hide bugs.
- Hold some cases out. An in sample 40 out of 40 after you just fixed those cases is weak evidence.
- Map every failure category to a regression test, and fail CI if a category has no test.
- Replay the same fixtures and diff the route and intent against a committed baseline.
- Write down what the run did not measure. Mine did not measure audio.
Lessons
- A 270 out of 270 text score means the scripted path is consistent. It does not mean a live caller can hear you.
- If the SDK expects an LLM object, give it one, even when your real brain is a custom node.
- Hours, prices and treatment names belong in tools and config, not in model memory.
- "Hmm" is not a name. "Yes" is one word, and it still has to interrupt.
- Say when a fix is incomplete. Routing a gym question away from the desk hours tool is not the same as refusing to invent gym hours.
I'm Osama Malik, an AI Agent Engineer in Islamabad. I write about building production AI agents at https://osamamalik.me
The code for this receptionist is at https://github.com/usmamalik345/agent-receptionist
Sumber artikel open-source oleh Osama Malik di DEV Community โ Baca artikel asli. Topik:
#ai#typescript#agents#llm
Sukai & bagikan artikel ini
Ditulis & Dikurasi Oleh
Osama Malik (Open-Source)
Software Engineer yang berfokus pada Next.js, TypeScript, arsitektur backend skalabel, Cloud, dan Applied AI.
Artikel Terkait
Semua artikelYour Agent's Worker Died Mid-Run. What Ran Twice?
The previous article moved a long Agent run out of the HTTP request and into a task. The browser can...
I built 20+ PDF tools that run entirely in the browser. Here's what that actually takes
I'm the maker of PDFToolsHub, a set of free PDF tools (merge, split, compress, rotate, protect and...
I built a haunted home-repair inspector with Kiro, and a 911 screen that refuses to be haunted
I wrote this post for the Kiroween 2026 hackathon. When something breaks at home, you want three...
Near miss: the bill-paying agent that would have read "I can't see the ledger" as "nothing paid today"
Our Near Miss entry for Agentware 2026 by Hackathon Raptors (@raptorsdev). The build: Payables...

Komentar