August 9, 2026
Retrieval-Augmented Chat: Ask This Site a Question
A floating chat widget that answers visitor questions using only what's actually published on this site — grounded, cited, no hallucinated claims — and can now take a few bounded actions instead of just answering.
3
tools available to the chat agent
6
passages retrieved per question
Problem
A portfolio site is read passively. Visitors skim, but rarely dig through every post and build log entry to find the specific thing they're curious about — and a generic chatbot bolted onto a site tends to make things up about the person it represents.
Approach
Built a retrieval-augmented generation pipeline: published posts, papers, and build log entries are chunked and embedded with Voyage AI, stored in Postgres via pgvector. A visitor's question gets embedded the same way, matched against that index by cosine similarity, and the retrieved passages are handed to Claude as the only source of truth — with an explicit instruction to say "I don't know" rather than invent an answer. Every response cites the specific post or build log entry it drew from. Later extended it past pure retrieval-and-answer: the widget now runs a tool-calling loop alongside its RAG context, with three narrow tools — checking current availability, pulling a specific build log entry's impact stats, and notifying me directly when a visitor wants to get in touch. That last one needed the widget to actually remember the conversation (it was originally stateless per message), since "confirm before sending, then send once I say yes" doesn't work if the follow-up message has no memory of what it's confirming.
Outcome
Visitors can ask plain-language questions and get answers sourced directly from this site's real content, with links back to the original writing — and now, when they want to be contacted, the widget can actually do that instead of just pointing them at the contact page. The index rebuilds on demand from the admin panel, so it never drifts far from what's actually published.