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 start
Create 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_url
The 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