A Retrieval-Augmented Generation (RAG) chatbot that answers questions about my professional background and portfolio using Claude 3.5 Haiku.
- AI-Powered Responses: Uses Anthropic's Claude 3.5 Haiku to generate natural, informative responses
- Context-Aware: Retrieves relevant information from my portfolio content
- Rate Limiting: Prevents abuse with client and server-side rate limiting
- Responsive Design: Works on desktop and mobile devices
- References: Provides links to relevant sections of my portfolio
- Analytics: Tracks usage patterns with Vercel Analytics
- Frontend: HTML, CSS, JavaScript
- Backend: Python with FastAPI
- AI: Anthropic Claude 3.5 Haiku for text generation
- Embeddings: OpenAI's text-embedding-ada-002 for semantic search
- Deployment: Vercel Serverless Functions
- Analytics: Vercel Analytics
- Embedding Generation: Content from my portfolio is converted into vector embeddings
- Query Processing: User questions are converted to embeddings and matched with relevant content
- Context Building: Matched content is used to create context for the AI
- Response Generation: Claude generates a response based on the context and question
- Reference Linking: Links to relevant portfolio sections are provided
- Python 3.9+
- Node.js (for frontend development)
- OpenAI API key
- Anthropic API key
-
Clone the repository:
git clone https://github.com/sohae-kim/rag-chat-resume.git cd rag-chat
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.env
file with your API keys:OPENAI_API_KEY=your_openai_key ANTHROPIC_API_KEY=your_anthropic_key
-
Generate embeddings:
python scripts/build.py
-
Run the development server:
python run.py
-
Open http://localhost:8000 in your browser
This project is configured for deployment on Vercel as a serverless function:
- Connect your GitHub repository to Vercel
- Set environment variables in the Vercel dashboard:
OPENAI_API_KEY
ANTHROPIC_API_KEY
- Deploy!
rag-chat-resume/
├── api/ # Vercel serverless functions
│ ├── index.py # Main API endpoint
│ ├── chat.py # Chat handler for AWS Lambda/Vercel
│ └── __init__.py # Package initialization
├── app/ # Backend application
│ ├── main.py # FastAPI application
│ ├── utils.py # Utility functions
│ ├── logging.py # Logging configuration
│ └── __init__.py # Package initialization
├── data/
│ ├── content.json # Portfolio content
│ └── embeddings.json # Generated embeddings (gitignored)
├── public/ # Static files
│ ├── static/
│ │ ├── js/ # JavaScript files
│ │ ├── css/ # CSS files
│ │ └── images/ # Images
│ └── index.html # Main HTML file
├── scripts/
│ ├── build.py # Script to generate embeddings
│ └── generate_embeddings.py # Alternative embeddings generator
├── .env # Environment variables (gitignored)
├── .gitignore # Git ignore file
├── next.config.js # Next.js configuration for Vercel
├── package.json # Node.js package configuration
├── requirements.txt # Python dependencies
├── vercel.json # Vercel configuration
└── README.md # This file
MIT
- Anthropic Claude for the AI model
- OpenAI Embeddings for semantic search
- FastAPI for the backend framework
- Vercel for hosting