An intelligent email analytics application that connects to Gmail, analyzes communication patterns, ranks contacts by friendliness, and allows natural language queries over email history.
- Gmail Integration: Connect via MCP (Model Context Protocol) or OAuth 2.0
- Data Analytics: Contact ranking, friendliness scoring, time-based trends
- AI Query Interface: Natural language queries with RAG-powered responses
- Export & Sharing: PDF, CSV, JSON exports with optional anonymization
The project follows a modular architecture with clear separation of concerns:
mailmind/
βββ backend/ # FastAPI backend
β βββ app/
β β βββ core/ # Core configuration and utilities
β β βββ models/ # Database models
β β βββ services/ # Business logic services
β β βββ api/ # API routes
β β βββ utils/ # Utility functions
β βββ tests/ # Backend tests
β βββ requirements.txt # Python dependencies
βββ frontend/ # React frontend (future)
βββ database/ # Database migrations and schemas
βββ docs/ # Documentation
- Python 3.9+
- Node.js 16+ (for frontend)
- Gmail API credentials
-
Clone and setup environment:
cd backend python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Configure environment:
cp .env.example .env # Edit .env with your API keys and settings -
Run the application:
uvicorn app.main:app --reload
cd frontend
npm install
npm startCreate a .env file in the backend directory:
# Database
DATABASE_URL=sqlite:///./mailmind.db
# Gmail API
GMAIL_CLIENT_ID=your_client_id
GMAIL_CLIENT_SECRET=your_client_secret
# OpenAI API
OPENAI_API_KEY=your_openai_key
# MCP Configuration
MCP_SERVER_URL=your_mcp_server_urlThe application uses SQLite with the following main entities:
- Users
- Emails
- Contacts
- Analytics
- Queries
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
MIT License - see LICENSE file for details