MITR is a web-based, multi-persona AI chatbot designed to provide empathetic and context-aware conversations. It leverages a modern microservice architecture and Google's Generative AI to create a persistent and personalized user experience.
- Multi-Persona System: Switch between four distinct AI personalities (Lucy, Suzanne, Lexi, and Roxy), each with a unique style.
- Persistent Session History: Conversations are saved per-persona. Users can create new sessions, load past conversations, and delete old ones.
- Client-Side Voice Mode: A fully functional voice-to-text mode that uses the browser's microphone for real-time transcription.
- Shared AI Memory: All personas contribute to and learn from a common memory pool, allowing for richer, context-aware interactions over time.
- Modern, Responsive UI: A stylish and animated user interface featuring a persona selection carousel.
- HTML5, CSS3, & JavaScript: Core technologies for the modern and interactive web interface.
- Tailwind CSS: For modern, responsive, and utility-first styling.
- Swiper.js: A powerful library used to create the animated, touch-enabled persona selection carousel.
- Docker & Docker Compose: For containerizing the application into portable services and managing the multi-service environment.
- Python: The core language for all server-side logic and API integrations.
- Chatbot Service (
emoAI.py): A lightweight Python server that serves the frontend and handles AI and voice transcription logic. - Data Service (
mcp_server.py): A robust Flask & Gunicorn API dedicated to all database operations.
- Google Gemini 1.5 Flash: The core AI model for generating empathetic replies.
- Google Cloud Speech-to-Text: For real-time, high-accuracy voice transcription.
- Google Cloud Firestore: A scalable NoSQL database used to store all user sessions and shared AI memories.
- (Optional) Vertex AI & Natural Language API: The platform is built to easily integrate further Google Cloud AI services.
Follow these instructions to get a copy of the project up and running on your local machine.
You need to have the following software installed:
-
Clone the repository:
git clone <your-repository-url> cd <your-repository-name>
-
Google Cloud Setup:
- Create a new project in the Google Cloud Console.
- Make sure Billing is enabled for your project.
- Enable the following APIs for your project: Cloud Firestore API, Cloud Speech-to-Text API, and Vertex AI API.
-
Create a Service Account:
- In your Google Cloud project, navigate to IAM & Admin > Service Accounts.
- Click + CREATE SERVICE ACCOUNT.
- Give it a name (e.g.,
mitr-chatbot-sa) and grant it the Owner role for simplicity during development. - Create the account, go to the Keys tab, click Add Key > Create new key, select JSON, and create it.
- A JSON file will be downloaded. Rename this file to
ttsbot-471404-39e4ea704298.jsonand place it in the root of your project folder.
-
Get Your Gemini API Key:
- Go to Google AI Studio and create a new API key.
- Copy this key.
-
Create a Local Environment File:
- In your project folder, create a new file named
.env. - Copy the content below into the
.envfile and paste your Gemini API key.
# .env # Paste your Gemini API key here GEMINI_API_KEY=AIzaSyxxxxxxxxxxxxxxxxxxxxxxx
- In your project folder, create a new file named
- Make sure Docker Desktop is running.
- Open a terminal in the project's root directory.
- Run the following command:
docker-compose up --build
- Wait for both services (
chatbot-1andmcp-server-1) to build and start. - Open your web browser and navigate to:
http://localhost:8080
This application is configured for easy deployment to Google Cloud Run. The cloudbuild.yaml file and the gcloud deployment scripts used in our development can be adapted for a production CI/CD pipeline.