A FastAPI-based RAG (Retrieval-Augmented Generation) chatbot that answers user queries based on information extracted from a local resume.json.
Supports rate-limiting, CORS for frontend integration, and retrieval with Hugging Face embeddings + Chroma vector store.
✅ Retrieval-Augmented Generation using langgraph
✅ OpenAI Sentiment embeddings
✅ Chroma vector database for document retrieval
✅ FastAPI REST API ready for frontend integration
✅ CORS configured for specific frontend URLs
✅ Rate-limited endpoint to prevent abuse (10 requests per hour per IP)
✅ Cleaned AI responses (removes <think> tags)
.
├── main.py # FastAPI app and chatbot API
├── resume.json # JSON knowledge base for retrieval
├── requirements.txt
└── README.md
- FastAPI - RESTful API framework
- slowapi - Rate limiting
- langchain_huggingface / langchain_chroma - Embeddings & Vector DB
- Groq Deepseek model - LLM backend
- RecursiveCharacterTextSplitter - Chunking JSON documents
- LangChain Hub Prompt - For RAG prompt template
- CORS Middleware - Frontend integration
- Description: Ask the chatbot a question and get a generated answer
- Rate Limit: 10 requests per hour per IP
- Request JSON:
{
"message": "Your question here"
}- Response JSON:
{
"answer": "AI generated answer based on resume knowledge"
}http://localhost:5173https://pandalow.github.io/
- Load and split
resume.json - Store chunks in a Chroma vector database
- Accept user question
- Perform similarity search to retrieve relevant context
- Format context and question into a RAG prompt
- Generate response using the LLM (
deepseek-r1-distill-qwen-32b) - Clean response (remove
<think>tags) - Return the answer
pip install -r requirements.txtuvicorn main:app --reloadcurl -X POST "http://localhost:8000/ask" \
-H "Content-Type: application/json" \
-d '{"message": "Tell me about your backend skills."}'- Limit:
10/hourper IP - Returns 429 Too Many Requests if exceeded
✅ LLM model used: deepseek-r1-distill-qwen-32b via Groq
✅ Embedding model: sentence-transformers/paraphrase-MiniLM-L6-v2
✅ Vector DB: Chroma
✅ JSON schema customizable via JQ syntax
MIT License — Feel free to use and modify.