Welcome to the Chatbot project! This chatbot is built using the FARM stack (FastAPI, React, MongoDB Atlas) and implements a Retrieval-Augmented Generation (RAG) application to enhance its capabilities.
This project is a chatbot application designed to provide intelligent and context-aware responses by leveraging the FARM stack and a RAG application. The chatbot uses MongoDB Atlas as its database to store and retrieve documents, enhancing its response capabilities based on the stored information.
- Intelligent and context-aware responses using RAG application
- User authentication and registration
- Integration with MongoDB Atlas for document storage and retrieval
- Real-time chat interface
- Responsive design with React
- FastAPI: For building the backend API
- React: For building the frontend user interface
- MongoDB Atlas: For cloud-based database storage
- RAG Application: For enhanced response generation using document retrieval
Follow these steps to set up and run the project locally.
- Node.js and npm installed
- Python 3.7+ installed
- MongoDB Atlas account
- Clone the repository:
git clone https://github.com/yourusername/chatbot.git cd chatbot/backend - Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
- Install the required packages:
pip install -r requirements.txt
- Set up environment variables in a .env file:
MONGO_URL=your_mongo_url MONGO_DB=your_database_name OPENAI_API_KEY=your_openai_api_key
- Run the FastAPI server:
uvicorn main:app --reload
- Navigate to the frontend directory:
cd ../frontend - Install the required packages:
npm install
- Start the React development server:
npm start
Access the frontend at http://localhost:3000. Interact with the chatbot through the chat interface. The chatbot will respond based on the documents stored in the MongoDB Atlas database.