Built for uOttaHack 8 | Solace Agent Mesh + Solace PubSub+ + Django + React
An intelligent email security system that uses multiple AI agents to analyze incoming emails in real-time for spam detection, priority classification, tone analysis, action item extraction, and malicious URL scanning.
- ๐ซ Spam Detection - AI-powered spam and phishing classification
- ๐ฏ Priority Classification - Automatic urgency scoring (Urgent/High/Medium/Low)
- ๐ Smart Summaries - One-line AI summaries for quick scanning
- ๐ Tone Analysis - Sentiment detection (Professional, Friendly, Urgent, etc.)
- โ Action Item Extraction - Automatically extracts tasks with due dates
- ๐ URL Security Scanning - VirusTotal integration for malicious link detection
- ๐ฌ AI Chat Interface - Ask questions about your emails in natural language
- โก Real-time Updates - Server-Sent Events (SSE) for instant UI updates
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ React UI โโโโโโบโ Django Backend โโโโโโบโ Solace PubSub+ Broker โ
โ (Vite) โ SSE โ (DRF + JWT) โMQTT โ โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ
โ โ
โ โผ
โโโโโโโโโโโดโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PostgreSQL 16 โ โ Solace Agent Mesh (SAM) โ
โ + Redis 7 โ โ โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโ โ โ Event โ โ AI Agents โโ
โ โ Mesh GW โโบโ โข SpamAgent โโ
โโโโโโโโโโโโโโโโโโโโโ โ โ โ โ โข PriorityAgent โโ
โ Django Consumer โโโโโโโค โ โ โ โข SummaryAgent โโ
โ (MQTT Subscriber)โ โ โ โ โ โข ToneAnalyzer โโ
โโโโโโโโโโโโโโโโโโโโโ โ โ โ โ โข ActionItems โโ
โ โ โ โ โข URLScanner โโ
โ โโโโโโโโโโโ โ โข QueryAgent โโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโ
โ External Services โ
โ โข AWS Bedrock (Claude 3.5) โ
โ โข VirusTotal API (MCP) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
How it works:
- Django publishes new emails to Solace topics via MQTT
- SAM's Event Mesh Gateway fans out each email to 6+ specialist AI agents in parallel
- Each agent analyzes the email and publishes results to its own topic
- Django Consumer subscribes to all result topics and updates the database
- SSE pushes real-time updates to the React UI
uOttaMail/
โโโ backend/ # Django REST API + MQTT Consumer
โ โโโ api/ # DRF views, models, serializers
โ โ โโโ models.py # Email, User, ActionItem models
โ โ โโโ views.py # REST endpoints + SSE
โ โ โโโ solace_mqtt.py # MQTT publisher client
โ โโโ inboxfirewall/ # Django project settings
โ โโโ requirements.txt
โโโ frontend/ # React + Vite UI
โ โโโ src/
โ โ โโโ App.jsx # Main application component
โ โ โโโ index.css # Styling
โ โโโ package.json
โโโ sam/ # Solace Agent Mesh configuration
โ โโโ configs/
โ โ โโโ agents/ # AI agent definitions
โ โ โ โโโ spam_agent.yaml
โ โ โ โโโ priority_agent.yaml
โ โ โ โโโ summary_agent.yaml
โ โ โ โโโ email_tone_analyzer.yaml
โ โ โ โโโ action_items_agent.yaml
โ โ โ โโโ url-scanner.yaml
โ โ โ โโโ email_query_agent.yaml
โ โ โโโ gateways/ # Event Mesh Gateway configs
โ โ โโโ shared_config.yaml
โ โโโ src/inbox_agents/ # Custom Python tools
โโโ docker-compose.yml # Full stack orchestration
โโโ .env.example # Environment template
โโโ README.md
- Docker & Docker Compose
- AWS account with Bedrock access (Claude 3.5 Haiku enabled)
- VirusTotal API key (free tier works)
git https://github.com/Divi76h/uOttaMail.git
cd uOttaMail
# Copy environment files
cp .env.example .env
cp sam/.env.example sam/.envEdit sam/.env:
LLM_SERVICE_API_KEY=<your-aws-access-key>
LLM_SERVICE_API_KEY_SECRET=<your-aws-secret-key>
LLM_SERVICE_REGION=us-east-1
VIRUSTOTAL_API_KEY=<your-virustotal-key>docker compose up --buildNote: First run takes a few minutes as SAM installs the Event Mesh Gateway plugin.
| Service | URL | Credentials |
|---|---|---|
| React UI | http://localhost:5173 | Register new user |
| Django API | http://localhost:8001/api/ | JWT Auth |
| Solace Broker Manager | http://localhost:8080 | admin / admin |
- Register two users in the UI (e.g.,
aliceandbob) - Login as Alice and send an email to Bob
- Login as Bob - watch the email appear with AI analysis badges:
- ๐ข Priority badge (Urgent/High/Medium/Low)
- ๐ก๏ธ Spam status (Legitimate/Suspicious/Spam)
- ๐ One-line summary
- ๐ Tone indicator
- โ Extracted action items
- ๐ URL safety status
- Try the AI Chat - Ask "What emails mention deadlines?"
solace-broker/
โโโ email/
โ โโโ new/{user_id}/{email_id} # Trigger for all agents
โ โโโ chat/{user_id}/{session_id} # AI chat queries
โ โโโ priority/{user_id}/{email_id} # Priority results
โ โโโ spam/{user_id}/{email_id} # Spam detection results
โ โโโ summary/{user_id}/{email_id} # Summary results
โ โโโ tone/{user_id}/{email_id} # Tone analysis results
โ โโโ action_items/{user_id}/{email_id} # Action items results
โ โโโ url_scan/{user_id}/{email_id} # URL scan results
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | React 18 + Vite | Modern UI with hot reload |
| Backend | Django 5.1 + DRF | REST API framework |
| Auth | SimpleJWT | Token-based authentication |
| Database | PostgreSQL 16 | Primary data store |
| Cache | Redis 7 | Session management |
| Message Broker | Solace PubSub+ | Event-driven messaging |
| AI Framework | Solace Agent Mesh | Multi-agent orchestration |
| LLM | AWS Bedrock (Claude 3.5 Haiku) | AI inference |
| Security API | VirusTotal (MCP) | Malicious URL detection |
| Orchestration | Docker Compose | Container management |
# Backend only
cd backend && python manage.py runserver
# Frontend only
cd frontend && npm run dev
# View SAM logs
docker logs -f inbox-sam# Restart just SAM (after config changes)
docker compose restart sam
# View all container logs
docker compose logs -f
# Reset database (caution: deletes all data)
docker compose down -v
docker compose up --buildCheck for broker queue limits in Solace Manager (http://localhost:8080):
Queues > Look for queues starting with "#P2P"
If count is ~100, delete old queues and restart SAM
docker compose down
docker compose up -d postgres
# Wait for healthy status, then:
docker compose upVerify AWS credentials and ensure Claude 3.5 Haiku is enabled in your Bedrock region.
MIT License