Titan AI Business Analytics Copilot
by AnavMidha
README.md
# Titan AI Business Analytics Copilot - POC
This is a Proof of Concept (POC) demonstrating how the **Model Context Protocol (MCP)** can be used at Titan Watches to build an internal AI Business Analytics Copilot. The system routes natural language queries to backend analytics tools using Google Gemini's function calling.
## Architecture
- **Frontend**: Vanilla JS, HTML, CSS, Chart.js for visualization.
- **Backend**: FastAPI (Python) serving as the MCP Gateway.
- **AI**: Google Gemini API for intelligent tool selection (intent mapping without keyword matching).
- **Database**: SQLite (`data.db`) acting as a Mock Enterprise Data Warehouse.
## Files
- `database.py`: Schema definition and deterministic mock data generation.
- `mcp_tools.py`: Python implementations of the MCP tools (Sales, Finance, Customer, Service) that query the database.
- `main.py`: FastAPI server bridging the frontend, Gemini AI, and MCP tools.
- `index.html`, `style.css`, `script.js`: Modern enterprise dashboard.
- `requirements.txt`: Python dependencies.
## Setup & Run Instructions
1. **Install Dependencies**
```bash
pip install -r requirements.txt
```
2. **Initialize Database**
```bash
python database.py
```
*(This will create `data.db` and populate it with realistic mock data)*
3. **Set API Key (Required for AI)**
```bash
export GOOGLE_API_KEY="your-gemini-api-key"
```
*(Note: If the key is not set, the app will run in fallback mock mode)*
4. **Run the Server**
```bash
uvicorn main:app --reload
```
5. **Access Dashboard**
Open your browser and navigate to: `http://localhost:8000`
## Demo Scenarios to Try
Try asking the AI Assistant these queries to see how it routes to different MCP tools:
- *"What are our top selling products?"* -> Invokes `sales_analytics`
- *"Show me the sales revenue by region."* -> Invokes `sales_analytics`
- *"What is our financial summary and net profit?"* -> Invokes `finance_analytics`
- *"Give me a breakdown of our customer segments."* -> Invokes `customer_intelligence`
- *"Show me the distribution of service request issues."* -> Invokes `service_analytics`
This server cannot be deployed
Maintenance
ActivityStale
ResponsivenessNo issues