← Back to work
Case Study 02 · Conversational AI · deterministic rebuild

AI Intake Agent Development — When Not to Use AI

Claude API · Tool_use API · Supabase · Next.js

The Problem

The platform's flagship product required collecting sensitive biographical data through a conversational AI agent. The first working version produced a report. A close read found fabricated details, invented astrological placements, incorrectly attributed events, and in one case a fabricated reference to a real person in a sensitive context. These weren't edge cases. They were systemic, and they would have reached paying users.

The Build

We scrapped heuristic parsing entirely and rebuilt the intake agent on Claude's tool_use API — making all state transitions deterministic rather than inferred from prose. Every biographical data point routes through validated structured fields. We added a mandatory extraction pass after every message, implemented 11-layer cross-user contamination defense, and documented a hard behavioral contract for the agent: acknowledge without mirroring, channel all data through validated tool calls, never assign meaning to what the user shares.

The Outcomes
Eliminated an entire class of fabrication bugs by removing prose-based state parsing
7 distinct accuracy failures cataloged, diagnosed, and resolved in a single sprint before any paying user saw the report
Intake sessions are fully resumable — state persists across browser closes and session timeouts with no data loss
Tool_use overhead added ~$0.003/call but removed an uncountable number of downstream debugging hours
Behavioral contract now serves as the reusable foundation for every AI agent built on this stack
The Stack
Claude API (Sonnet) Tool_use API Supabase Next.js Custom system prompt architecture
Have a similar problem?
We start every engagement by understanding what's actually broken before we touch a tool.
Tell us about it →