How I know when my AI agent is wrong
Reading a live chatbot through its transcripts, finding each miss within the half hour, fixing it the same day, and knowing when to stop adding rules.
A week after the site went public, close to a hundred people had come to interview my AI, and the logs could tell me how many and how long, but not whether a single answer was any good. The quick answer is that I read the chats, and then a scheduled check read every new one for me and raised each miss as an issue within the hour.
The harder question is what to do when the fixes keep working and the misses keep coming.
Key points
A scheduled check reads each new conversation and raises an issue the same hour, with a run id as the repro and none of the visitor's words.
Each one is verified on production with the question that exposed it.
When the third rule change covered the third miss, the problem was a class, not a case.
The tooling found a fix that worked and kept proposing more of it. Seeing past the first pattern to the larger one was my job, and it's what a fully autonomous agent can't do.
Did anyone use it?
Yes. A week after the Door opened, the logs said a few people had wandered in. Then my LinkedIn post went out, and close to a hundred people came to interview me in three days.
| Day | Visitors | Conversations | Visitor turns |
|---|---|---|---|
| 16 Nov | 11 | 21 | 78 |
| 17 Nov | 59 | 66 | 288 |
| 18 Nov | 25 | 44 | 198 |
I had asked my lead session to read the CloudFront edge logs and the chat function's logs with Logs Insights, by field only: visits by day and country, which pages, how many chat turns, how each search ended. The counts answered the first question. They couldn't answer the next one.
What do you do when the misses keep coming?
The counts say a visitor asked and got a reply. They don't say whether the reply was any good. For that I read the chats, and on 16 Nov the first one I read was a miss. A visitor had asked the agent to tell them about my resume. The search found the resume. The writer still said it didn't know, because the quotes it had picked didn't match the passage word for word, and the design throws away a quote it can't find. The fix was a rule: keep a dropped quote's word-for-word runs as facts. It shipped that evening, and I checked it on production with the visitor's own question.
From then on a scheduled check ran every half hour in my lead session. It read each new conversation and reported how many visitors and turns, what they asked, how the agent did, and anything that looked like a product gap. Each miss became an issue within the hour, holding the run id as its repro and no visitor words. The lead handed each issue to a developer session, and the fix came back as a pull request with its own live environment and a reply check: the same question, nine runs before and nine after. That first day produced nine fixes, all on production by the next morning. The agent learned that the search it runs on is itself a retrieval-augmented generation pipeline; a short follow-up about my own project went to search instead of a design; a design request about something absurd got a dry sentence instead of latency questions; a failed router call got one retry; a detail stayed with the thing its quote named; a follow-up kept its subject; a work-history question got the key stops and a link to the resume.
Three rules is a pattern
The second miss got a different rule. So did the third. By the time three rules covered three failures, I was no longer preventing an issue. I was reacting to each one and not reading the pattern, and the pattern was simpler than the fixes: the writer kept giving up on something it could have answered, for reasons that looked different only on the surface. What the quote check did with paraphrase, what the router thought a short question meant, where the planner had jumped and couldn't get back out, were one class.
I asked the lead to stop handing me individual tickets and name the themes the way a visitor had lived them. Four came back, and the dozen tickets folded into them: it gives up on me; it's putting words in my mouth; this reads like an AI; I came to reach Dan and couldn't quite. Each theme got a conversation before any code, so we were solving the right problem, and then a spec. The first two shipped within the day. The agent now gives an off-topic question an acknowledgement and a beat before turning back, and on a turn without a fresh search it says only what I've written, a stated assumption, or that it doesn't know.
A developer also built a review tool that re-judges stored chats by machine: it re-runs each turn's search, scores each reply, and writes a scorecard of failure categories that holds ids, routes, counts and categories and no text, and stays on my laptop. Its first run read 16 Nov's 38 turns across 20 conversations and scored every one: four declines with a fact available, two unsupported claims, two over the word limit, one unanswered, no misroutes.
Where I stepped in
The tooling was good at the wrong thing. Each miss looked like a new rule opportunity, and once a rule had worked it wanted another. That is a locally optimized answer, and this is where a human has to step in and improve the process. Knowing when to intervene is what makes a fully autonomous agent sub-par in so many ways. AI is happy to be productive and will over-optimize the first pattern it finds; it doesn't look up to find the larger pattern. Drawing a new parallel, using critical thinking the model doesn't have, is the part that was mine. An agent has no memory that says doing the same thing over and over is the definition of insanity. I do.
So I asked a different question. The ambiguity in a conversation isn't a fixed set, because the visitor is unpredictable and the branching grows with every turn. A fixed set you can cover with rules and predict the rules you need. This had grown past that, which makes it a model's problem, not a rule engine's. Instead of more rules, the agent should reason about the direction of the conversation and be able to change it.
Two things started in parallel. One is state: every turn, the planner writes a short statement of where the conversation stands, and the next turn reads it before deciding anything, starting with whether the visitor changed the subject. The other is the models: I had been about to move the router and planner to a stronger model so they'd follow instructions better, and the better question was whether to use the stronger model earlier and differently. Both are being measured on their own environments as I write this, against the same nine-run probes, so the before and after are the same test. The misses may continue for a minute while the design catches up. That's the trade: a human can interrupt a loop that is locally fine and move it toward a higher global answer, at the cost of not patching today.
Three jobs from one watch
The half-hourly watch started as a self-healing chat, and that is the innovative-sounding part: it listens, finds a miss, proposes a fix. Healing wasn't enough, because every fix landed after a visitor had felt the miss. The watch now does three things. It patches single instances. It reviews instances together to extract the systemic issue. And it reads what people ask as a product lens: the questions the agent had nothing of mine to quote for are the pages I write next. Most of what's on this site from the second week came from that list.
Design decisions and trade-offs
| Decision | Chosen over | Why | Trade-off |
|---|---|---|---|
| Read transcripts by hand, then by machine | Logs by field only | The miss is in the words, not the counts | Only I read them |
| An issue per miss, same hour, run id as repro | A weekly review | The fix ships while the context is fresh | Thirteen issues in three days, some later folded |
| Verify on production with the visitor's question | The PR environment alone | Production has the real Knowledge and traffic | A fix is confirmed after it ships, not before |
| Themes before tickets | Squashing each miss | Three rules for three misses was a pattern | The first themed fixes took a day, not an hour |
| Step in at the local maximum | More rules | Rules can't cover an unbounded set | Misses continue while the design is measured |
Want the details?
Ask the window anything this page skips.