Back to projects

Aarogya — Medical Customer Support

AI chatbot for a health insurance company with a custom knowledge-base, end-to-end ticket handling with real-time email notifications, and web-search grounded to admin-curated domains.

Custom KB + pgvector two-stage retrievalFull ticket lifecycle with Resend emailsDomain-grounded web search via TavilySelf-improving KB from resolved tickets

Problem

Health insurance support teams drown in repetitive queries — agents waste time on FAQs while complex issues get delayed and customers never hear back reliably.

Approach

Built an AI agent (Claude Haiku 4.5) with a single `smart_search` tool that first hits a pgvector knowledge-base (with an LLM judge to verify ≥60% relevance), falls back to Tavily web search scoped to admin-approved domains, and escalates to a ticket flow that sends confirmation + resolution emails via Resend. Resolved tickets feed back into the KB.

Value

Customers get instant, accurate answers for known topics; complex issues are escalated with a full audit trail; every resolved ticket makes the system smarter over time.

Snapshot

Chat interface powered by Claude Haiku with two-stage retrieval: pgvector semantic match → LLM confidence judge → guardrailed web fallback → ticket escalation with email lifecycle. Admin dashboard to manage KB, domains, and tickets.

Stack

  • Bun + Express + TypeScript (backend)
  • Next.js 16 App Router (frontend)
  • Claude Haiku 4.5
  • OpenAI text-embedding-3-small
  • PostgreSQL + pgvector
  • Prisma ORM
  • Resend (email)
  • Tavily (web search)
  • shadcn/ui

Role

  • Agentic system design
  • Two-stage RAG pipeline
  • Ticket + email workflow
  • Admin dashboard
  • Full-stack build

Outcomes

  • Instant answers for KB-covered queries
  • End-to-end ticket lifecycle with email confirmation + resolution
  • Domain-grounded web fallback with source transparency
  • Self-improving knowledge-base from resolved tickets
  • Audit trail on every search and escalation

Build notes

  • One-tool design (`smart_search` only) keeps agent behavior predictable and testable.
  • pgvector semantic search → LLM judge (≥60% confidence threshold) before returning KB answers.
  • Admin-curated domain list auto-binds to Tavily at request time — no redeployment needed.
  • Resend handles ticket confirmation email immediately on creation, resolution email on close.
  • Resolved ticket summaries are admin-reviewed before being added to the KB to prevent drift.

Roadmap

  • Multi-language support for regional insurance markets.
  • SLA tracking and escalation alerts for overdue tickets.
  • Analytics dashboard for query patterns and KB coverage gaps.

Want something similar built for your product?

I'll scope the path, then ship with reliability in mind.