SYS // POLYMAIL

PolyMail

service loop active•PROTOTYPE•2026•May to Aug 2026

Enterprise email triage agent and native Android/Wear OS client featuring two-pass PII redaction and offline PBKDF2 authentication.

Stack

FastAPILlama 3.3 70BPresidio PIIKotlin / Wear OS

01 // THE CHALLENGE

Enterprise Email Cognitive Drain Meets the Cloud LLM Privacy Trap

Who hurts:Knowledge Workers & Security-Conscious Organizations

Professionals receive 120+ emails daily, spending hours context-switching across calendar, inbox, and task trackers to triage urgent requests from noise. Offloading triage to third-party cloud LLMs introduces catastrophic data exposure risks (SSNs, banking credentials, proprietary contracts), while generic mail clients lack scheduling context and drain mobile batteries.

Core Bottlenecks

Commercial LLM APIs ingest raw unmasked emails, leaking sensitive personal and financial data to model logs
Generative models hallucinate fake dates, names, and contact details in draft replies
Generic desktop tools fail to sync urgent deadlines down to mobile and wearable devices

02 // CAPABILITIES & WORKFLOW

Automated Triage, Privacy Gateway & Cross-Platform OTG Execution

An intelligent, privacy-first email agent that classifies priority, detects meeting conflicts, drafts context-aware replies via Llama 3.3 70B, and syncs across web, Android, and Wear OS devices.

Automated Triage, Privacy Gateway & Cross-Platform OTG Execution
Live Showcase

Automated Triage, Privacy Gateway & Cross-Platform OTG Execution

Intelligent triage dashboard displaying AI priority categorization, PII redaction tokens, and calendar conflict detection

01Zero Leakage

Two-Pass Privacy Gateway

Redacts 13+ PII entity types via Presidio and spaCy before inference, then scrubs model-invented PII before dispatch.

02Context Aware

Calendar Conflict Guard

Strips reply chains, extracts proposed meeting dates with zero-shot LLM prompts, and checks calendar availability.

03Jetpack Compose

OTG Android & Wear OS Clients

Native Material 3 client with hands-free voice triage, encrypted local storage, and a Wear OS companion for wrist triage.

03 // SYSTEM BLUEPRINT

Distributed Multi-Source Ingestion & Edge-to-Cloud Pipeline

Event-driven architecture decoupling synchronous HTTP/socket mail ingestion from PII anonymization, LLM reasoning, encrypted persistence, and mobile clients.

Execution Flow Sequence

1.Ingest via IMAP (CONDSTORE) or Microsoft Graph (Azure Entra ID)
2.Sanitize & Mask PII via PrivacyGateway (Presidio + Regex)
3.Extract Dates & Check Calendar Conflicts via LLM (Groq Llama 3.3 70B)
4.Two-Pass Rehydration & Hallucination Scrubbing
5.Asynchronous Daemon Commit to Fernet-Encrypted PostgreSQL
6.Dispatch to Web Dashboard, Android App & Wear OS Wrist Watch

FastAPI Core & Mail Connectors

Python 3.11

Asynchronous REST gateway, WebSocket events, IMAP and Microsoft Graph connectors

Privacy Gateway & Llama 3.3

Sub-800ms

Presidio PII redaction pipeline feeding sub-second Groq Llama 3.3 70B inference

Encrypted Storage & Mobile Clients

Kotlin M3

Fernet BYTEA PostgreSQL storage with native Jetpack Compose & Wear OS clients

04 // THE HARD PROBLEMS

Solving LLM Hallucinated PII & IMAP Cold-Start Deadlocks

Eliminating Synthetic PII Leaks and Multi-Threaded Mailbox Socket Starvation

During stress testing, two critical failure modes emerged: First, when drafting replies, the 70B LLM occasionally hallucinated believable but synthetic phone numbers, emails, and credentials in the response body. Second, on server reboot, multiple simultaneous client requests for /api/emails triggered parallel IMAP mailbox selections, deadlocking the underlying TCP socket and freezing the event loop.

What Was Tried & Failed
  • ✕Standard one-shot regex placeholder restoration blindly reintroduced masked values without verifying whether newly generated tokens appeared in the output
  • ✕Direct concurrent calls to imaplib from FastAPI worker coroutines corrupted the SSL socket state and caused unhandled BadCommand exceptions
  • ✕Device-code OAuth polling in Microsoft Graph blocked the asyncio event loop for 30+ seconds during user authentication
What Worked & Shipped

Architected a two-pass PII rehydration engine: pass one restores verified token mappings ([[EMAIL_ADDRESS_1]]), and pass two executes a secondary Presidio scan via _redact_new_pii to detect and strip any synthetic entities invented by the model. Wrapped IMAP mailbox queries in an in-memory asyncio.Lock with UID/CONDSTORE delta-sync, and converted Graph device-code polling into a non-blocking background task with token cache auto-refresh.

05 // ARCHITECTURAL TRADEOFFS

Engineering Decisions & Tradeoffs

Key technical choices balancing zero-latency mobile responsiveness, stringent enterprise data privacy, and hackathon execution velocity.

Chose: Centralized FastAPI gateway running Llama 3.3 70B with local Presidio PII scrubbingoverRunning quantized 1B/3B small language models locally on Android devices

Rationale: Mobile SLMs severely degraded calendar conflict reasoning quality and drained device batteries during background thread parsing.

Resulting Impact: Maintained 94%+ classification accuracy and sub-800ms inference while keeping mobile RAM overhead below 45MB.

Chose: Fernet BYTEA encryption with dedicated in-memory daemon writer queue (queue.Queue)overDirect plaintext column inserts or synchronous database writes

Rationale: Synchronous encryption and Postgres commits added 25 to 40ms latency directly onto the user-facing HTTP request path.

Resulting Impact: Added 0ms latency to API response times while guaranteeing database at-rest privacy compliance.

Chose: Two-pass validation with secondary Presidio detectionoverSingle-pass string replacement of masked placeholders

Rationale: Generative models frequently hallucinate plausible new PII (e.g. fake callback numbers) that were never in the source email.

Resulting Impact: 100% elimination of synthetic PII leaks in generated outgoing email drafts.

06 // BENCHMARKS & VERIFIED SIGNAL

Empirical System Benchmarks & Buildathon Outcomes

Audited using automated pytest suites, offline golden dataset evaluation reports, and physical hardware profiling.

National Standing

Top 10/60K+

Capgemini AgentifAI Buildathon

Inference Latency

3,400ms (Ollama)→780ms (Groq)

Groq Llama 3.3 70B p95

PII Recall

100%

13+ supported entity types

eval pass rate

Continuous Benchmarking

* Verified before Capgemini executive leadership and confirmed by official Top 10 Finalist credential (Certificate date: 12.08.2026).

07 // PROOF & DELIVERABLES

Verified Code, Credentials & Presentation Artifacts

Open-source repositories, executive evaluation certificate, and Buildathon deliverables.