AI Chatbot (RAG) for Portfolio

Case study Β· Side project

The chatbot in the corner of this site. Ask it about my work and it answers from my resume, portfolio and YouTube, with links to the pages it drew from.

  • Role Product, design and build
  • Timeline November 2025 to now
  • Built with Claude Code

The problem

Portfolios answer the wrong questions

A portfolio answers the questions I guessed a recruiter would ask. The questions they actually have are more specific: what did Kel do at Social Native, has he shipped anything with Claude, where did he go to school. I wanted someone to type that question and get a straight answer in a few seconds, pulled from my real work and not from a model’s general knowledge.

Version one

It worked, then it drifted

I built the first version in November 2025 with n8n, OpenAI embeddings and Supabase pgvector. One workflow ingested my resume, LinkedIn and portfolio and backfilled embeddings every hour. A second one answered questions.

Over the next year the chatbot moved into my WordPress theme and the knowledge base grew to more than 350 passages, and the setup drifted. The sync skipped any page it had seen before, so edits never reached the bot. New content was stored without embeddings, so every question loaded the entire knowledge base into the prompt, about 95,000 characters each time. The prompt also told the bot never to admit it lacked information, which led to confident answers that mixed up projects.

Version two Β· How it’s built

kelwu.com chatbot: hybrid RAG on WordPress and Supabase

Rebuilt in October 2026. Content syncs itself in the background, and each question pulls only the most relevant excerpts, so answers stay grounded and cheap.

  • Input
  • AI step
  • Code

Keeping the knowledge base current

  1. Sync sources
    Code

    A weekly job pulls published pages and posts, YouTube videos and my resume. Changed pages are replaced and unpublished ones removed.

    • WordPress
    • YouTube API
    • Google Docs
    • WP-cron
  2. Chunk
    Code

    Text is split into short passages. The resume is split by section and role so each job stays together.

    • PHP
  3. Embed
    AI step

    Each passage is turned into a 384-dimension vector by a model that runs inside Supabase, so no extra API key is needed.

    • gte-small
    • Supabase Edge Function
    • pgvector

Answering a question

  1. Visitor asks
    Input

    The widget sends the question and the page the visitor is on.

    • Chat widget
  2. Hybrid search
    Code

    Vector search and keyword search run together and their rankings are merged, so names like "Social Native" always surface.

    • pgvector
    • Postgres full-text
    • Rank fusion
  3. Grounded answer
    AI step

    Claude answers from the top 12 excerpts only, keeps projects separate and says so when it doesn't know.

    • Claude Haiku 4.5
  4. Reply with sources
    Code

    The answer comes back with up to two links to the pages it drew from.

    • WordPress REST API
Site
WordPress, PHP REST endpoint, WPCode widget
Data
Supabase Postgres, pgvector, full-text search
Embeddings
gte-small in a Supabase Edge Function
LLM
Claude Haiku 4.5

Product decisions

The calls I made in the rebuild

Embeddings inside the database

gte-small runs in a Supabase Edge Function, so there is no separate embedding API key or bill, and the vectors live next to the data they describe.

Hybrid search

Vector search alone missed exact names like company names. Keyword search now runs alongside it and the two rankings are merged.

Grounded over confident

The bot answers only from what it retrieves, keeps projects separate and says when it doesn’t know instead of guessing.

A resume that syncs itself

Every sync reads my public resume from Google Docs, split by section and role, so updating the resume updates the bot.

What broke

Rebuilding it in production

CPU limits

Embedding 50 passages per request hit the edge function’s CPU cap after 14. Batches of 8, with WordPress scheduling follow-up runs, cleared the backlog.

Empty rows

51 old rows had no text and stalled the backfill on every run until the query learned to skip them.

Pages that never updated

The original sync skipped any page title it had already seen. It now compares content, replaces changed pages and removes unpublished ones.

A bloated prompt

Each question used to carry the whole knowledge base. Retrieval now sends the 12 most relevant passages, which is cheaper and gives the model less to confuse.

Stack

  • WordPress
  • PHP
  • Supabase
  • pgvector
  • Postgres full-text search
  • gte-small
  • Supabase Edge Functions
  • Claude Haiku 4.5
  • WP-cron
Ask me anything! ↓