Source: https://www.mongodb.com/developer/products/mongodb/mistral-ai-integration/
This project integrates Mistral AI's powerful language model with MongoDB to create a responsive chatbot that can answer queries based on the context provided from uploaded documents. The integration involves processing PDF documents, storing their contents as embeddings in MongoDB, and using those embeddings to fetch relevant context for generating responses to user queries.
- Ensure MongoDB is set up and accessible.
- Store your Mistral AI API key and MongoDB URI in a
.env
file in the project directory. - Install required dependencies via
pip install -r requirements.txt
. - Run
python data_preparation.py sample.pdf
to process the PDF and store data in MongoDB. - Launch the Gradio interface with
python gradio_interface.py
to start the chatbot web application. - Open the local URL displayed in your terminal to interact with the chatbot.
Please make sure you have a file named sample.pdf
in your project directory, or adjust the file path as needed when processing documents.