A SaaS-style AI assistant that allows users to securely connect and chat with their own MongoDB Atlas data using Google's Gemini AI.
Live Website: https://romannihal-mongo-chat-app-3iou6q.streamlit.app/
Built with Streamlit, Google Gemini, PyMongo, and uv.
- Bring Your Own Database: Users securely connect their own MongoDB Atlas clusters via the UI.
- AI-Powered Analysis: Uses Gemini 1.5 Flash to reason across fetched JSON documents.
- SaaS Constraints: Includes built-in logic for a "Free Tier" (3 messages per session) and token limits.
- Service-Oriented Architecture: Modular codebase separating business logic, database services, and UI.
- Modern Stack: Powered by
uvfor lightning-fast dependency management.
- Frontend: Streamlit
- AI Engine: Google Gemini (Generative AI)
- Database: PyMongo (MongoDB Atlas)
- Package Manager: uv
⚠️ Important Prerequisite: > Before connecting, ensure your MongoDB Atlas cluster allows connections from outside your local network. Go to Network Access in Atlas and select "Allow Access from Anywhere" (whitelist IP0.0.0.0/0). This is required for the Streamlit Cloud server to reach your database.
- Open the app in your browser.
- Sidebar Config:
- Connection String: Paste your MongoDB Atlas URI (e.g.,
mongodb+srv://...). - Database Name: Enter the specific database name (e.g.,
ecommerce_db). - Collection Name: Enter the collection you want to chat with (e.g.,
products).
- Connection String: Paste your MongoDB Atlas URI (e.g.,
- Link: Click "Link Database" to securely fetch the documents and initialize the context.
- Chat: Ask questions to extract insights from your specific data (e.g., "Which product has the highest rating?").