Skip to main content

An AI-powered email monitoring and response system

Project description

📯 Mailos

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.

🤖 Multi-Agent System

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

✨ Features

  • 🤖 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

🚀 Installation

pip install mailos

🏃 Quick Start

  1. Launch the web interface:
mailos
  1. Open your browser and navigate to http://localhost:8080

  2. 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

⚙️ Configuration

Authentication Settings

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

Email Settings

  • IMAP server and port
  • Email address and password
  • Monitoring frequency
  • Auto-reply settings
  • Tool permissions

LLM Provider Options

OpenAI

{
    "llm_provider": "openai",
    "model": "gpt-4",
    "api_key": "your-api-key"
}

Anthropic Claude

{
    "llm_provider": "anthropic",
    "model": "claude-3-sonnet",
    "api_key": "your-api-key"
}

AWS Bedrock (Claude)

{
    "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"
}

🛠️ Tool System

Mailos includes a powerful tool system that extends agent capabilities:

Built-in Tools

  • Weather Tool: Fetch weather information
  • PDF Tool: Create and manipulate PDF documents
  • Python Interpreter: Execute Python code
  • Bash Command: Run system commands

Tool Configuration

{
    "enabled_tools": ["weather", "python_interpreter"],
    "tool_config": {
        "weather": {
            "default_units": "metric",
            "api_key": "your-api-key"
        },
        "python_interpreter": {
            "timeout": 30,
            "max_memory": 128
        }
    }
}

🔧 Development

  1. Clone the repository:
git clone https://github.com/tomatyss/mailos.git
cd mailos
  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install development dependencies:
pip install -e ".[dev]"
  1. Run tests:
pytest

🏗️ Architecture

The package consists of several key components:

  1. Email Monitor: Continuously checks for new emails using IMAP
startLine: 29
endLine: 78
  1. LLM Integration: Supports multiple AI providers through a unified interface
startLine: 8
endLine: 65
  1. Reply Handler: Manages email response generation and filtering
startLine: 169
endLine: 192

System Requirements

  • 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

🤝 Contributing

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.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and linting
  5. Submit a pull request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👤 Author

Ivan Iufriakov (tomatyss@gmail.com)

🙏 Acknowledgments

  • PyWebIO for the web interface
  • APScheduler for task scheduling
  • OpenAI, Anthropic, and AWS for their LLM services

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mailos-0.1.2.tar.gz (574.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mailos-0.1.2-py3-none-any.whl (50.9 kB view details)

Uploaded Python 3

File details

Details for the file mailos-0.1.2.tar.gz.

File metadata

  • Download URL: mailos-0.1.2.tar.gz
  • Upload date:
  • Size: 574.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for mailos-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7aacf6a76f805e60f6dae09a84137577bffb0f59d2f6c679e9363cc2586a806a
MD5 f35b9c77079d2dc96d618851751de568
BLAKE2b-256 4ccfafc676d2d5222d8e0a1dfd04b0112f95f04d87faf62135537cae554ebdca

See more details on using hashes here.

File details

Details for the file mailos-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mailos-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 50.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for mailos-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fc639a92b019c761f8c3c5c88713a9d9871ae342eb7217abc795f531957516c8
MD5 a7315c4646fe3958c805ee306c162e60
BLAKE2b-256 3bafd6df44fd220e9fd46f09673f96397bd370aafc3f9e6a463fa24b866d5089

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page