The demo showcases how MongoDB can revolutionize call center operations for insurance companies by converting call recordings into searchable vectors. This transformation allows agents to quickly access relevant information, improving customer service and enhancing customer satisfaction.
MongoDB shines in this solution by providing a robust platform for storing and querying vectorized data through MongoDB Atlas Vector Search. Its flexibility and scalability enable real-time data access and integration with AI-driven applications, facilitating efficient and accurate information retrieval for customer service enhancements.
Learn more about MongoDB here.
For a detailed exploration of this demo and its impact on customer service in the insurance industry, check out our blog post: AI-Powered Call Centers: A New Era of Customer Service.
- MongoDB Atlas for the database
- Python for the backend language
- FastAPI for the backend framework
- Uvicorn for ASGI server
- Poetry for dependency management
- Next.js for the frontend framework
- CSS Modules for styling
- Docker for containerization
- Docker desktop (optional)
Before you begin, ensure you have met the following requirements:
- MongoDB Atlas account, you can create one here. Free tier is sufficient for this project.
- Node.js 14 or higher
- Python 3.10 or higher (but less than 3.11)
- Poetry (install via Poetry's official documentation)
To enhance the functionality of the demo, you need to import the data/insurance_customer_service.FAQs.json
file into your MongoDB Atlas database. This file contains frequently asked questions, their corresponding answers and the Cohere Embeddings which will be used to improve customer service interactions.
-
Set Up MongoDB Atlas:
- If you haven't already, create a MongoDB Atlas account and set up a cluster. Follow the MongoDB Atlas Getting Started Guide for detailed instructions.
- Once your cluster is ready, obtain the connection string. You can find this in the "Connect" section of your cluster dashboard.
-
Download and Install MongoDB Compass:
- Download MongoDB Compass from the official website and install it on your machine.
-
Connect to MongoDB Atlas Using Compass:
- Open MongoDB Compass.
- In the "New Connection" dialog, paste your MongoDB Atlas connection string.
- Click "Connect" to establish a connection to your Atlas cluster.
-
Import the JSON File:
- Once connected, create a database called
insurance_customer_service
. - Create a collection called
FAQS
. - Click on "Add Data" > "Import File".
- Choose the
insurance_customer_service.FAQs.json
file from your local machine. - Click "Import" to load the data into your collection.
- Once connected, create a database called
-
Verify the Import:
- After importing, you can verify that the data has been successfully added by browsing the
FAQS
collection in your MongoDB Atlas database.
- After importing, you can verify that the data has been successfully added by browsing the
- Ensure that your MongoDB Atlas connection string includes the necessary credentials and permissions to write to the database.
- The import process in Compass is straightforward and provides a graphical interface to manage your data easily.
By following these steps, you will have the FAQs data imported into your MongoDB Atlas database, ready to be used by the demo application.
- Navigate to the
/frontend
folder. - Create a
.env.local
file:
NEXT_PUBLIC_WEBSOCKET_URL=ws://localhost:8000/TranscribeStreaming
NEXT_PUBLIC_TEXT_SEARCH_URL=http://localhost:8000/textSearch
- Navigate to the
/frontend
folder. - Install dependencies by running:
npm install --legacy-peer-deps
- Start the frontend development server with:
npm run dev
- The frontend will now be accessible at http://localhost:3000 by default, providing a user interface.
Note: Create a
.env
file within the/backend
directory.
MONGO_URI=
AWS_KEY_REGION=
- (Optional) Set your project description and author information in the
pyproject.toml
file:description = "Your Description" authors = ["Your Name <you@example.com>"]
- Open the project in your preferred IDE.
- Open a Terminal window.
- Ensure you are in the root project directory where the
makefile
is located. - Execute the following commands:
- Poetry start
make poetry_start
- Poetry install
make poetry_install
- Verify that the
.venv
folder has been generated within the/backend
directory.
- To run the backend, execute the following command:
poetry run uvicorn main:app --host 0.0.0.0 --port 8000
Note: Notice that the backend is running on port
8000
. You can change this port by modifying the--port
flag.
Make sure to run this on the root directory.
- To run with Docker use the following command:
make build
- To delete the container and image run:
make clean
- Check that you've created an
.env.local
file that contains the required environment variables.
- Check that you've created an
.env
file that contains the required environment variables.
- Add tests
- Code quality checks
- Automate the deployment process using GitHub Actions or CodePipeline