ai product feature
Portfolio assistant
A scoped chat assistant that answers questions about the portfolio owner, skills, projects, writing, and how the site is built.
Scope
Portfolio
Storage
Supabase
Response
Streaming
problem
A portfolio chatbot can easily become a generic assistant. This one needed guardrails, source-grounded context, persistence for admin review, and a clean UI that belongs to the site.
outcome
The assistant now streams answers from configured providers, stays scoped to portfolio context, persists sessions for admin review, and gives visitors a fast way to explore the developer profile.
What it proves
Context gate refuses unrelated prompts instead of hallucinating.
Provider switcher supports Gemini plus optional local/provider fallbacks.
Chat sessions and messages persist to Supabase for admin inspection.
Client storage keeps accepted terms and session continuity tidy.
build notes
Guardrails
The API builds a system prompt from vector matches or CMS fallback content, then decides whether a question should be answered. Out-of-scope prompts get a clear refusal rather than a vague general response.
Persistence
The route validates or replaces stale session IDs, saves both user and assistant messages, and returns the active session ID so the client can keep continuity across reloads.
Interface
The chat page is framed as a portfolio exploration tool, with concise context, starter prompts, terms consent, streaming messages, and a compact provider control.
next case study