
Engineering case study
Building a RAG Portfolio Assistant with FastAPI, Gemini and Pinecone
Full-stack developer
Answers recruiter questions about my work 24/7 using RAG, auto-generated response(s) from data in Supabase
A retrieval-augmented generation (RAG) backend designed for a software engineer portfolio website. It features an automated sync mechanism that pushes updates from Supabase content tables straight to a Pinecone vector index using Gemini embeddings, while leveraging Groq for fast, scalable answer generation.
The problem
Visitors need a clear way to explore the portfolio owner's background, projects, and experience. Keeping a separate chatbot knowledge base up to date creates another place where information can become stale.
How it works
The Next.js website and admin area use Supabase as their content source. After a successful project save, the frontend schedules a backend sync. FastAPI reads the public content tables, Gemini embeds the entries, and Pinecone stores the vectors.
For a visitor question, the backend embeds the query, retrieves relevant entries, applies a similarity threshold, and passes the context to Groq. The widget streams the answer and provides links to supporting portfolio content. Visitors can also leave feedback.
Engineering decisions
Supabase supplies both the website and the chatbot, reducing duplicated content maintenance. Embedding and generation are separate services, allowing their providers and configuration to evolve independently.
Short content entries are embedded individually. Case study sections are indexed separately so an entire technical write-up does not need to fit into one vector. Cached answers are cleared after a successful sync to reduce stale responses.
Evidence and evaluation
A fixed set of 107 hand-written questions is run against the live knowledge index before retrieval or prompt changes: 81 the portfolio can answer and 26 it should decline (missing facts, off-topic requests and misuse attempts).
In the run measured on 12 Nov 2026, the expected entry ranked first for 77 of 81 answerable questions and was in the top three for all 81 (mean reciprocal rank 0.975). Generated answers contained the recorded facts in 28 of 29 checked cases, and all 17 checked out-of-scope questions were declined. The first run, on 27 Oct 2026, had 20 questions and measured retrieval only.
Answers are checked with string rules, not read by a person or a model judge, so a passing answer can still contain a sentence the rules do not look for. The AI evaluation lab page on this site shows the full dated results, a real ranking miss and what the test does not prove.
Limitations and next steps
Grounding depends on the retrieved content and the model instructions; these safeguards do not guarantee that every generated statement is supported. The similarity cutoff alone is a weak filter: it blocked 12 of the 26 questions the portfolio cannot answer, so declining the rest depends on the prompt.
The test questions were written by the same person who built the system, so they share its blind spots. Next steps are a held-out question set written by someone else, a human review of answer quality, and measuring response time and provider failures under realistic usage.