Smart assistant that classifies, prioritizes, summarizes and drafts replies for email messages.
- Multi-Agent Pipeline: classifier, priority scorer, summarizer and response generator
- Configurable Keywords: edit
default_config.json
, setCREWAI_CONFIG
, or use--config
- Batch Processing: reuse agents to handle multiple messages
- Parallel Batch:
triage_batch(messages, parallel=True)
for concurrency - Gmail Integration: fetch unread messages via IMAP
- Verbose Metrics:
--verbose
flag shows processing statistics
# Install in editable mode with test extras
pip install -e .[test]
# Triage a single message
python triage.py --message "Urgent meeting tomorrow!" --pretty
# Process multiple messages from a file
python triage.py --batch-file messages.txt
# Process unread Gmail messages (requires $GMAIL_USER and $GMAIL_PASSWORD)
python triage.py --gmail --max-messages 5
The package ships with a default_config.json
containing classifier keywords and priority scores.
You can supply a custom JSON file via --config /path/to/file
or set the environment variable CREWAI_CONFIG
.
# Example custom config
echo '{"classifier": {"urgent": ["urgent", "asap"]}}' > mycfg.json
python triage.py --message "ASAP reply needed" --config mycfg.json
Install the package with test dependencies:
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install with test dependencies
pip install -e ".[test]"
# Run all tests
pytest
# Run tests in parallel for speed
pytest -n auto -q
# Run with coverage
pytest --cov=src/crewai_email_triage
# Run specific test file
pytest tests/test_pipeline.py
See CONTRIBUTING.md for setup and commit guidelines. Install pre-commit hooks to catch lint and secret issues before committing:
pre-commit install
Distributed under the MIT license. See LICENSE for details.