A full-stack chatbot application that answers queries using a Retrieval-Augmented Generation (RAG) pipeline over a news corpus.
- RAG Pipeline: Ingest news articles, generate embeddings, and retrieve relevant context
- Session Management: Each user gets a unique session with chat history
- Persistent Storage: Redis for session management and chat history
- Modern UI: Built with React and Tailwind CSS
- Backend: FastAPI (Python 3.11+)
- Frontend: React + Vite + Tailwind CSS
- Vector Database: ChromaDB
- Embeddings: Jina AI
- LLM: Google Gemini
- Caching & Sessions: Redis
- Python 3.11+
- Node.js 18+
- Redis
- Google Gemini API Key
- Jina AI API Key
- Clone the repository
- Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: .\venv\Scripts\activate
- Install dependencies:
cd backend pip install -r requirements.txt - Set up environment variables:
- Copy
.env.exampleto.env - Update the values in
.envwith your API keys
- Copy
- Navigate to the frontend directory:
cd frontend - Install dependencies:
npm install
- Create a
.envfile with:VITE_API_URL=http://localhost:8000
Make sure Redis is running locally or update the Redis configuration in .env.
cd backend
uvicorn app.main:app --reloadThe API will be available at http://localhost:8000
cd frontend
npm run devThe frontend will be available at http://localhost:5173
POST /api/chat- Send a chat messageGET /api/chat/{session_id}- Get chat history for a sessionDELETE /api/chat/{session_id}- Delete a chat session
Session data in Redis is set to expire after 24 hours by default. You can adjust this in app/db/redis_client.py by modifying the ttl attribute in the RedisManager class.
- Chat History: Stored in Redis with TTL
- Embeddings: Cached in ChromaDB
- Set
ENVIRONMENT=productionin.env - Use a production ASGI server like Uvicorn with Gunicorn:
gunicorn -w 4 -k uvicorn.workers.UvicornWorker app.main:app
Build for production:
cd frontend
npm run buildMIT


