Mailos is a Python framework that transforms email inboxes into an intelligent multi-agent system powered by Large Language Models (LLMs). It creates a network of AI agents that monitor email accounts and orchestrate automated interactions, leveraging various AI providers including OpenAI, Anthropic, and AWS Bedrock.
Mailos transforms emails into a sophisticated multi-agent ecosystem:
- Each email account becomes an autonomous agent capable of understanding and responding to messages
- Agents can collaborate and coordinate responses across multiple email accounts
- Built-in tool system allows agents to perform complex tasks (weather lookup, PDF manipulation, code execution)
- Configurable system prompts guide agent behavior and decision-making
- Smart filtering prevents unnecessary auto-replies and feedback loops
- 🤖 Multiple LLM Provider Support (OpenAI, Anthropic Claude, AWS Bedrock)
- 📧 IMAP Email Monitoring
- ⚡ Real-time Email Processing
- 🔄 Automatic Response Generation
- 🎯 Smart Reply Filtering
- 🌐 Web-based Configuration Interface
- ⏱️ Scheduled Email Checking
- 🛠️ Extensible Tool System
- 🔒 Optional Authentication System
pip install mailos
- Launch the web interface:
mailos
-
Open your browser and navigate to
http://localhost:8080
-
Click "Add New Checker" and configure your email account:
- Email credentials (IMAP server, port, etc.)
- LLM provider settings
- Auto-reply preferences
- Tool configurations
- System prompts
By default, the web interface is accessible without authentication. To enable authentication:
# Enable authentication
export MAILOS_AUTH_ENABLED=true
# Optional: Configure custom credentials (defaults to admin/admin)
export MAILOS_AUTH_USERNAME=your_username
export MAILOS_AUTH_PASSWORD=your_password
# Start Mailos
mailos
- IMAP server and port
- Email address and password
- Monitoring frequency
- Auto-reply settings
- Tool permissions
{
"llm_provider": "openai",
"model": "gpt-4",
"api_key": "your-api-key"
}
{
"llm_provider": "anthropic",
"model": "claude-3-sonnet",
"api_key": "your-api-key"
}
{
"llm_provider": "bedrock-anthropic",
"model": "anthropic.claude-3-sonnet",
"aws_access_key": "your-access-key",
"aws_secret_key": "your-secret-key",
"aws_region": "us-east-1"
}
Mailos includes a powerful tool system that extends agent capabilities:
- Weather Tool: Fetch weather information
- PDF Tool: Create and manipulate PDF documents
- Python Interpreter: Execute Python code
- Bash Command: Run system commands
{
"enabled_tools": ["weather", "python_interpreter"],
"tool_config": {
"weather": {
"default_units": "metric",
"api_key": "your-api-key"
},
"python_interpreter": {
"timeout": 30,
"max_memory": 128
}
}
}
- Clone the repository:
git clone https://github.com/tomatyss/mailos.git
cd mailos
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install development dependencies:
pip install -e ".[dev]"
- Run tests:
pytest
The package consists of several key components:
- Email Monitor: Continuously checks for new emails using IMAP
startLine: 29
endLine: 78
- LLM Integration: Supports multiple AI providers through a unified interface
startLine: 8
endLine: 65
- Reply Handler: Manages email response generation and filtering
startLine: 169
endLine: 192
- Python 3.8 or higher
- pip package manager
- IMAP-enabled email account
- API keys for chosen LLM provider
- Internet connection for email and API access
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Ivan Iufriakov (tomatyss@gmail.com)
- PyWebIO for the web interface
- APScheduler for task scheduling
- OpenAI, Anthropic, and AWS for their LLM services