Grounded AI applications
RAG Portfolio Assistant
I built the AI assistant on this portfolio so visitors can explore my experience through grounded answers instead of hunting through static pages.
- Role
- Sole engineer
- Team
- Solo, personal project
- Status
- Live on this site
- Stack
- Supabase Edge Functions, pgvector, Cohere embeddings, OpenRouter
Outcome
The assistant gives recruiters and collaborators a direct way to ask about relevant experience, technical depth, and product work while keeping the portfolio itself as the source of truth.
How quality is measured
Retrieval is checked against two fixed question sets: 28 I tuned against and 30 written afterwards and never tuned against. Each question has text that must appear in the retrieved chunks, so it checks that the right evidence reaches the model, not that the answer is good. Both sets are written by me.
- 97%right chunk in the top 8 on the 30 fresh questions, after fixing two content gaps (90% on the first run)
- 70%right chunk in the top 3 on the fresh questions, against 93% on the set I tuned against
- 0%retrieved chunks that look like code, down from 74% before re-indexing
- 12 of 16unrelated questions refused with a fixed reply and no model call
- The index used to hold raw source files in 500-character slices. It now holds prose chunks that each start with their own context.
- The match setting is a maximum cosine distance, not a minimum similarity. 0.70 with 8 chunks matches the old 0.75 with 10 and sends 27% fewer.
- The fresh set exposed missing content (a career timeline and the places I have visited), which I added. Top-3 ranking slipped to 63% as a result.
- The live chat shows a trace of what it retrieved, with scores and timings, under each answer.
What I owned
Designed the retrieval, prompt, and frontend interaction flow for a conversational way to explore the portfolio.
Connected portfolio content to vector search so answers can use relevant site context rather than rely only on a model's general knowledge.
Delivered the system with a lightweight full-stack architecture appropriate for a public website.
System at a glance
Portfolio content is prepared for retrieval and stored as searchable vector context.
Key decisions
- Prioritized grounded retrieval so the assistant can point visitors toward information actually represented on the site.
- Used an architecture that keeps the public interface simple while separating retrieval and model work from the browser.
- Designed with token cost and public-web safety in mind instead of treating every prompt as an unrestricted chat session.
How I approached reliability
- Retrieval context gives answers a clear factual boundary tied to the portfolio.
- The interface sanitizes rendered content before it reaches the page.
- The system handles unavailable services without breaking the rest of the site experience.
Technology focus
- Supabase Edge Functions
- pgvector
- Cohere embeddings
- OpenRouter
- TypeScript
- React
- DOMPurify
- GitHub Pages
- CI/CD