HTTP 200 OK, Yet Completely Wrong: How We Built an Observability Engine for AI Agents A team built an asynchronous observability pipeline for a production AI assistant after its 200-question offline test set scored 92% while the live agent gave clients wrong policy answers behind 200 OK responses. The pipeline samples real chats from S3 on a daily APScheduler schedule, validates them against a YAML schema, queues them in Amazon SQS for a sequential worker, and grades them through an Evaluation Orchestrator combining Precision@k/Recall@k computational metrics, embedding similarity, and DeepEval GEval LLM judges with isolated rubrics. The team found a single vague LLM-judge prompt returned 0.78, 0.69 and 0.84 on the same conversation across three runs and caused metric bleed, and later saw a Faithfulness score of 0.98 while users clicked thumbs-down. Arnav had just shipped his company’s first production AI assistant. Before launch, he tested it on a carefully curated set of 200 questions. It scored 92%. Everything looked green, response times were fast, and there were zero error logs. Two weeks later, a major client sent an urgent message: “Your AI has been giving us wrong policy answers since last week.” Arnav stared at his monitoring dashboard. Every single API call showed 200 OK. His system was alive, fast, and completely confident—while quietly hallucinating. That afternoon, Arnav realized that traditional server monitoring only tells you if your AI is running, never if it is right. At first, Arnav relied on his 200-question test dataset whenever he changed a prompt. That failed almost immediately. Real users didn’t talk like his neat test file — they asked messy follow-up questions, combined two requests into one, and triggered edge cases his static dataset never imagined. Static 200-Question File ──► Manual Eval Script ──► Score: 92% Blind to real users So Arnav abandoned offline-only testing and decided to pull real production conversations directly from cloud storage S3 on a daily schedule. To avoid adding latency to live user chats, he moved evaluation completely out of the request path into an asynchronous overnight pipeline. A daily scheduler APScheduler woke up once a day and sampled a manageable slice of yesterday’s chats from S3. Live User ──► AI Agent ──► Fast Reply No eval delay │ ▼ Raw Chat Logs S3 │ Daily Scheduler + Sampler │ ▼ Background Grader The very first night the scheduled job ran, it crashed halfway through. One of the teams had updated their agent and accidentally changed a field name in their chat logs, breaking Arnav’s script. To stop a single malformed log file from taking down an entire night’s batch, Arnav added a strict YAML schema validator right after ingestion. Only conversations matching the standardized format — containing a conversation id, tenant id, user turns, assistant replies, and any retrieved RAG documents or tool calls—were copied into a validated evaluation bucket. Rather than throwing all those chats at the grader simultaneously causing memory spikes and API rate limits , he dropped lightweight job tickets into an Amazon SQS queue so a sequential background worker could pull and grade them safely one by one. Raw Chat Logs S3 │ ▼ YAML Schema Validator ──► Rejects broken logs safely │ ▼ Validated Eval Bucket S3 ──► Amazon SQS Queue ──► Sequential Worker Once the pipeline stopped crashing, Arnav ran into a much subtler problem: he couldn’t trust the scores. Initially, he sent each conversation to an LLM judge with a simple prompt: “Rate this response from 0 to 1.” Running the exact same conversation three times produced 0.78, 0.69, and 0.84. Worse, metric bleed crept in—if the agent used a slightly blunt tone, the judge quietly docked points from its Relevance score, blending unrelated flaws into a single blurry number. Meanwhile, paying an expensive frontier LLM just to verify basic math—like whether the search engine fetched the right document—was burning budget unnecessarily. Arnav replaced his single vague prompt with a three-tier Evaluation Orchestrator : Amazon SQS Queue │ ▼ Sequential Worker │ ▼ Evaluation Orchestrator ├──► Computational Metrics Precision@k, Recall@k — Fast & Free ├──► Embedding Metrics Semantic similarity └──► LLM Judge via DeepEval GEval Isolated rubrics + written reasons │ ▼ Results Bucket S3 Yet even with isolated metrics, Arnav noticed something bizarre a few weeks later: an agent’s Faithfulness score climbed to 0.98, while users were furiously clicking thumbs-down. When Arnav inspected the turn logs, the realization hit him: a higher Faithfulness score does not mean a better agent. Faithfulness only measures whether the AI stuck to the retrieved documents without inventing facts. When the search engine retrieved an outdated or irrelevant policy document — and the agent faithfully summarized that wrong document — the judge awarded a near-perfect 0.98 for Faithfulness while the user got a useless answer. That taught Arnav never to trust a single metric in isolation — Faithfulness had to be paired with Contextual Precision and Goal Accuracy to tell the true story. As daily traffic grew into the tens of thousands of chats, a stakeholder asked: “Shouldn’t we evaluate every single conversation so nothing slips through?” Arnav ran the math and realized exhaustive evaluation wasn’t just expensive — it was actively counterproductive. Grading 100% of traffic with multi-metric LLM judges would burn through their monthly inference budget in four days, forcing the team to downgrade to a weaker, cheaper judge model that missed subtle multi-turn reasoning errors. Furthermore, because 70% of production traffic consisted of repetitive greetings and routine FAQ lookups, grading every chat drowned out rare, complex edge cases in a sea of trivial 1.0 scores. To control both quality and scale, Arnav made the entire pipeline config-driven . Teams registered their agents in a central configuration store configGroup: schedular-agents specifying their agent’s name, S3 log location, sample percentage, judge model, and which of the 27 available metrics to track—without touching a single line of pipeline code. Evaluating a curated, representative daily sample using a strong frontier judge model under consistent rubrics gave far sharper signal than running a weak judge over every chat. After running this orchestrator at scale, Arnav had a new headache: 10,000 raw JSON result files sitting in S3. Looking at thousands of text files — or a single company-wide average score — hid critical failures. When an agent’s overall weekly Goal Accuracy dipped slightly from 0.85 to 0.82, it looked like harmless noise. So Arnav built a background sync service backed by PostgreSQL that read the daily S3 results and manifest files and organized them cleanly inside MLflow : Two months later, when Arnav opened the PROD workspace in MLflow and sliced a minor 0.82 Goal Accuracy dip by client, the company-wide average turned out to be hiding a localized outage: nine enterprise clients were sitting comfortably at 0.88, while Client B had plunged to 0.54. Arnav clicked into Client B’s monthly heatmap. Faithfulness was bright green 0.95 , proving the LLM wasn’t hallucinating. Retrieval Precision , however, was solid red. He opened the lowest-scoring conversation run and read the judge’s exact note: “The retrieved context did not contain the client’s updated policy table.” In under five minutes — without grepping raw logs or blaming the LLM — Arnav knew Client B’s search index simply needed a refresh. With the pipeline now running quietly on autopilot every night, Arnav is adding one final piece to the story: automated A/B testing , so whenever his team wants to test a new prompt or switch to a new model, they can run both versions side by side on the exact same real conversations and let the numbers decide which one ships. HTTP 200 OK, Yet Completely Wrong: How We Built an Observability Engine for AI Agents https://pub.towardsai.net/http-200-ok-yet-completely-wrong-how-we-built-an-observability-engine-for-ai-agents-f628b49e9f19 was originally published in Towards AI https://pub.towardsai.net on Medium, where people are continuing the conversation by highlighting and responding to this story.