← back
Local AI Email Agent (Ollama + Qwen + Corteza + Microsoft Graph)

Local AI Email Agent (Ollama + Qwen + Corteza + Microsoft Graph)

Pending
💰 USD 250–750 👤 Unknown 🕒 13d ago status: new
Docker Rust API Development API Integration Microsoft Graph AI Text-to-text AI Chatbot AI Model Development AI Development AI Agents
I need an AI agent that runs entirely on my VPS, loads through Ollama, and uses the Qwen‑3 14B or 32B model. There must be zero external API calls for inference everything stays local. The agent must listen to my Office 365 mailbox via a Microsoft Graph Webhook and process every new message within a maximum delay of five minutes. Workflow requirements When an email arrives, the agent should: • parse intent, entities, urgency, required actions, sentiment, and deadlines • decide whether to:  (a) create a follow‑up task in Corteza CRM  (b) schedule a meeting  (c) draft a context‑aware reply • push the chosen action back to the relevant system through its API (Corteza or Microsoft Graph) The agent must be idempotent and avoid double‑processing emails (store processed message IDs). Infrastructure requirements • Everything runs inside a Docker‑Compose stack • All secrets and configuration values must be stored in ENV variables • One‑command startup: docker-compose up -d • No manual setup steps (or minimal) except creating the Graph app • Rust preferred, but another language is acceptable if it significantly reduces inference latency • LLM prompts must be externalised in a template file • Provide structured JSON logging for all steps • Implement retry logic with exponential backoff • Implement error logging and a fallback queue for failed actions • Provide /health endpoint for monitoring Microsoft Graph requirements • Use client‑credentials flow (daemon app) • Implement automatic token refresh • Implement automatic subscription renewal (Graph subscriptions expire every 72 hours) • Webhook endpoint must validate Microsoft Graph signatures • Draft replies must be stored in the Outlook Drafts folder • Meeting scheduling must propose at least 3 possible time slots Corteza CRM requirements • Tasks must be created with correctly mapped fields • Use Corteza REST API • Namespace ID and module ID must be configurable via ENV Weekly report A config toggle must enable a weekly monitoring report summarising: • email volumes • classifications • actions taken • errors The report must be emailed to REPORT_RECIPIENT. Acceptance criteria • New emails are ingested via Microsoft Graph Webhook within five minutes • The agent operates fully offline on the VPS (Qwen model via Ollama) • Tasks appear in Corteza CRM with correct field mapping • Meeting invites are created when the intent is “schedule” • Draft replies are generated and stored in Outlook Drafts • All services start with a single docker-compose up command (or PM2 if preferred) Deliverables • Docker‑Compose file • .env.example • Source code • README with step‑by‑step instructions to reproduce the setup on a clean Debian server
↗ View on Freelancer