This project is a robust, production-ready chatbot system with:
- FastAPI backend for PDF upload, chunking, embedding (Google Gemini 2.0 Flash), vector search, and chat
- MongoDB for vector storage and retrieval
- React frontend with chat UI and admin panel (Netligent branding)
- Environment variable support for all secrets/config
- CORS enabled for frontend integration
- Clone this repo and navigate to the project directory.
- Install dependencies:
pip install -r requirements.txt
- Set up a
.env
file with your MongoDB URI, database name, and Gemini API key:MONGO_URI=your_mongodb_uri DB_NAME=chatbot_db GEMINI_API_KEY=your_gemini_api_key
- Run the FastAPI server:
uvicorn main:app --reload
POST /upload_pdf
— Upload a PDF to update chatbot knowledgePOST /chat
— Ask a question about the course contentGET /pdfs
— List all uploaded PDFs (admin)GET /pdf/{id}
— View PDF details and chunks (admin)DELETE /pdf/{id}
— Delete a PDF and its data (admin)
- Navigate to the
frontend
directory:cd frontend
- Install dependencies:
npm install
- Set the backend API base URL in
frontend/.env
:REACT_APP_API_BASE_URL=http://localhost:8000
- Start the React app:
npm start
- Chat UI with Netligent branding and logo
- Admin panel: upload, view, and delete PDFs; view PDF chunks
- Robust error handling and logging
- All secrets/configuration via environment variables
For workspace-specific Copilot instructions, see .github/copilot-instructions.md
.