Case study
Resolve — AI Support Ticket Agent
An AI support agent that reads a customer ticket, searches a knowledge base, and either drafts a grounded reply or escalates to a human when the docs don't cover it. Combines RAG with agentic decision-making so it never invents answers.
What I built
Resolve is a customer-support agent that combines retrieval-augmented generation with agentic decision-making. When a ticket comes in, it embeds the question, retrieves the most relevant passages from a knowledge base stored in Postgres (pgvector), and then makes a judgment call: if the retrieved context answers the ticket, it drafts a reply grounded strictly in those passages for a human to approve; if not, it escalates to a human with a reason instead of inventing an answer.
The core design principle is that the system knows when it doesn't know. A deterministic guard sits on top of the model's judgment — if retrieval quality falls below a distance threshold, the ticket is force-escalated regardless of what the model claims, so a weak retrieval can never produce a hallucinated answer to a customer. Every result surfaces the knowledge-base passages it considered and their relevance scores, making the reasoning transparent.
Role
Solo full-stack developer — architecture, RAG pipeline, agent logic, and UI
Key features delivered
- Semantic retrieval over a knowledge base using pgvector cosine search
- Answer-vs-escalate decision via structured LLM output (generateObject + Zod)
- Deterministic escalation guard that overrides the model on weak retrieval
- Human-in-the-loop approval before any reply is sent
- Transparent source passages with per-result relevance scoring
Impact
- Correctly escalates out-of-scope tickets (e.g. compliance requests) instead of hallucinating answers
- Grounds 100% of generated replies in retrieved source passages
Stack
- Next.js
- TypeScript
- OpenAI
- pgvector
Challenges
- Preventing confident wrong answers — solved with a distance-threshold guard that escalates when retrieval is too weak, layered on top of the model's own judgment
- Getting reliable structured decisions from the model rather than free text — solved using generateObject with a Zod schema
- Choosing structured generation over an autonomous tool loop so a human could review and approve every proposed action
Screenshots
Product highlights
A few focused screens that show the core flow and UI polish.

