Building a RAG Chatbot for My Portfolio
I wanted visitors to my portfolio to be able to ask questions about my background without reading through everything. So I built a simple RAG (Retrieval-Augmented Generation) chatbot.
How It Works
- Knowledge Base — My resume, skills, and project descriptions are chunked into a JSON file
- Search — When a user asks a question, I find the most relevant chunks using keyword matching
- Generation — The matched context + question are sent to LLaMA 3.1 via Groq's API
- Response — The model answers using only the provided context
Tech Stack
- Backend: Node.js + Express
- LLM: LLaMA 3.1 8B via Groq (free tier, ~200ms responses)
- Search: Simple keyword scoring over text chunks
- Frontend: Vanilla JS chat interface
Lessons Learned
- You don't need vector databases for small knowledge bases — keyword matching works fine for <50 chunks
- Groq's free tier is more than enough for portfolio-level traffic
- A strong system prompt prevents the model from answering off-topic questions
What I'd Improve
- Add vector embeddings for better semantic search
- Cache frequent questions
- Add conversation history for follow-up questions