An intelligent email automation agent for Gmail that automatically classifies and acts on incoming emails using deterministic rules and LLM-powered intelligence.
Ashford is a self-hosted, single-user email automation system that:
- Automatically classifies incoming Gmail messages using rule-based logic and AI
- Executes configured actions (archive, label, delete, etc.) with approval workflows
- Provides a web interface for managing rules and viewing action history
- Integrates with Discord for notifications and interactive approvals
- Maintains full traceability and undo capabilities for all actions
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Gmail API │────▶│ Rust Agent │────▶│ Discord │
│ (Pub/Sub) │ │ (axum + queue) │ │ (approvals) │
└─────────────────┘ └────────┬─────────┘ └─────────────────┘
│
▼
┌──────────────────┐
│ SvelteKit UI │
│ (web interface)│
└──────────────────┘
- Rust Agent Service (
server/) - Core backend with job queue, Gmail integration, rule engine, and Discord bot - SvelteKit Web App (
web/) - Web interface for rules management, action history, and settings - libsql Database - Durable storage for messages, rules, decisions, and job queue
Backend:
- Rust (2024 edition)
- Axum HTTP server
- libsql (SQLite fork)
- Tokio async runtime
- OpenTelemetry for observability
Frontend:
- SvelteKit 2
- TypeScript
- Tailwind CSS
- Bits UI components
- Rust (1.85+)
- Node.js 20+ / Bun
- pnpm
- Gmail API credentials
- Discord bot token (optional, for approvals)
Create a configuration file (see docs/configuration.md for all options):
database_path = "./ashford.db"
[gmail]
credentials_path = "./credentials.json"
token_path = "./token.json"
[discord]
bot_token = "your-discord-bot-token"
channel_id = "your-channel-id"cd server
cargo run --releasecd web
pnpm install
pnpm devashford/
├── server/ # Rust backend
│ ├── crates/
│ │ ├── ashford-core/ # Core domain logic, queue, database
│ │ └── ashford-server/ # HTTP API server
│ └── migrations/ # SQL migrations
├── web/ # SvelteKit frontend
│ └── src/
│ ├── routes/ # Pages and layouts
│ └── lib/ # Shared components
├── docs/ # Architecture documentation
└── tasks/ # Development milestones (rmplan)
See the docs/ directory for detailed documentation:
- Overview - High-level architecture
- Data Model - Database schema
- Decision Engine - Classification logic
- Rules Engine - Rule evaluation
- Gmail Integration - Gmail API setup
- Discord - Discord bot integration
- Web UI - Frontend specification
- Configuration - All config options
- Rust skeleton & queue
- Gmail ingest (Pub/Sub + History)
- Rule engine & decision pipeline
- Gmail actions
- Discord bot integration
- SvelteKit web UI
- Rules assistant (chat interface)
MIT