Skip to content

ShernanJ/personal-rag-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Personal RAG Chatbot 🤖

Overview

The Personal RAG Chatbot is a Retrieval-Augmented Generation (RAG) AI chatbot integrated into my portfolio site. It is designed to answer questions about my professional experience, projects, skills, and hobbies, offering an interactive way for visitors (including recruiters) to learn more about me.

By leveraging Cohere's language model and a retrieval-based system, this chatbot dynamically retrieves relevant information from my personal knowledge base to provide accurate, real-time answers.

Features

Dynamic Question-Answering: Responds to queries about my work experience, projects, and hobbies using retrieval-augmented generation.

Context-Aware Responses: Retrieves relevant data from a vector database to generate precise, context-specific answers.

Up-to-Date Knowledge: The retrieval system allows for easy updates, ensuring the chatbot reflects the latest information about my skills and projects.

Architecture

The system consists of the following components:

Frontend:

A React-based portfolio site that provides the user interface.

Backend:

  • FastAPI: Serves as the API backend for the chatbot.

  • Cohere: Used for generating responses based on retrieved data.

  • Vector Database (e.g., Pinecone/Supabase/FAISS): Stores embeddings of my personal data for efficient retrieval.

Data Pipeline:

  • Embeddings are created using Cohere's embedding model.

  • User queries are processed to retrieve the most relevant information from the vector database.

  • The retrieved context is combined with the user query and passed to Cohere's language model for response generation.

System Design Diagram

Tech Stack

Frontend: React, TypeScript

Backend: FastAPI (Python)

NLP & Embeddings: Cohere API

Database: Supabase (PostgreSQL) / Pinecone / FAISS (for vector search)

Deployment: Vercel (Frontend), Docker (Backend)

Installation & Setup

Clone the repository:

git clone https://github.com/yourusername/personal-rag-chatbot.git

cd personal-rag-chatbot

Set up environment variables:

Create a .env file and add your Cohere API key and database credentials. (Refer to .env.example file)

COHERE_API_KEY=<API Key Here>

Change directory to backend

cd backend/

Install dependencies:

pip install -r requirements.txt

Run the FastAPI backend:

fastapi dev main.py

Optional Frontend to test the Chatbot

Change directory to frontend

cd chatbot-ui/

Start the frontend:

npm install

npm run dev

Open browser

Go to http://localhost:5173 to see frontend

Example Questions

  • "Tell me about your experience at TD"

  • "What projects have you worked on related to full-stack development?"

  • "What are your hobbies outside of software engineering?"

Future Enhancements

  • Improved Contextual Understanding: Enhance retrieval with more granular context to improve the quality of answers.

  • User Feedback Loop: Incorporate a feedback mechanism to learn from user interactions and improve responses.

  • Enhanced Knowledge Base: Expand the dataset with more detailed information about recent projects and skills.

About

Learning how to build my own chatbot for my portfolio site

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published