{"id":49570861,"url":"https://github.com/intelliswarm-ai/intelli-mailbox","last_synced_at":"2026-05-17T12:25:17.713Z","repository":{"id":354964476,"uuid":"1225471559","full_name":"intelliswarm-ai/intelli-mailbox","owner":"intelliswarm-ai","description":"Never miss an Email. A local AI assistant for your Gmail inbox. Summarizes long threads, ranks what's important, and drafts replies - all running on your laptop with Ollama. Nothing leaves your machine","archived":false,"fork":false,"pushed_at":"2026-05-17T10:11:33.000Z","size":1080,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-17T10:43:48.066Z","etag":null,"topics":["ai","email","gmail","inbox","java","llm","ollama","privacy","spring-boot"],"latest_commit_sha":null,"homepage":"https://intelliswarm.ai/products/intelli-mailbox","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intelliswarm-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"tmessini"}},"created_at":"2026-04-30T10:05:08.000Z","updated_at":"2026-05-17T10:10:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/intelliswarm-ai/intelli-mailbox","commit_stats":null,"previous_names":["intelliswarm-ai/intelli-mailbox"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/intelliswarm-ai/intelli-mailbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelliswarm-ai%2Fintelli-mailbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelliswarm-ai%2Fintelli-mailbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelliswarm-ai%2Fintelli-mailbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelliswarm-ai%2Fintelli-mailbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intelliswarm-ai","download_url":"https://codeload.github.com/intelliswarm-ai/intelli-mailbox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelliswarm-ai%2Fintelli-mailbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33137856,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","email","gmail","inbox","java","llm","ollama","privacy","spring-boot"],"created_at":"2026-05-03T14:00:31.793Z","updated_at":"2026-05-17T12:25:17.696Z","avatar_url":"https://github.com/intelliswarm-ai.png","language":"Java","funding_links":["https://github.com/sponsors/tmessini"],"categories":[],"sub_categories":[],"readme":"# Intelli-mailbox\n\n\u003e AI-preprocessed inbox on top of your real Gmail. Local LLM by default — emails never leave your laptop.\n\nA Spring Boot web app that reads your Gmail through a CDP-attached real Chrome, then runs every visible email through a local LLM in the background. As each email finishes analysis, the UI updates live over SSE with **multi-category badges** and **structured action items** (with due dates, priority, and source quotes).\n\n## What's different from a generic inbox triage tool\n\n* **Preprocessing, not on-click**: open the app and analysis starts automatically. You see badges and CTAs as soon as the LLM finishes each email — you don't click \"Analyze\" per row.\n* **Multi-category badges** instead of a single urgency rating: `MEETING`, `RISK`, `EXTERNAL`, `AUTOMATED`, `VIP`, `FOLLOW_UP`, `NEWSLETTER`, `FINANCE`. Click any badge to filter the inbox.\n* **Structured CTAs**: each action item carries a type (`REPLY` / `REVIEW` / `SCHEDULE` / `PAY` / `SUBMIT` / `READ` / `OTHER`), a priority (`LOW` / `MEDIUM` / `HIGH`), an optional ISO due date (overdue ones are highlighted), and a verbatim source quote from the email so you can audit the LLM.\n* **Two themes**: an Intelliswarm dark palette (default) and a clean light theme. Toggle in the header, persisted in `localStorage`.\n* **Local-by-default LLM**: ships configured for Ollama on `localhost:11434`. Add `SPRING_PROFILES_ACTIVE=openai-mini OPENAI_API_KEY=…` to use `gpt-4o-mini` instead.\n\n## Quick start\n\n```bash\n./run.sh\n```\n\nOn first run:\n1. The app launches a dedicated Chrome at `~/.intelliswarm/intellimailbox-chrome`.\n2. Sign in to Gmail in that Chrome window.\n3. The Intelli-mailbox UI auto-opens at `http://localhost:8090/` in a new tab.\n4. Click **↻ Refresh inbox**. The inbox listing renders immediately; badges and CTAs stream in as each email is analyzed.\n\nTo use OpenAI instead of local Ollama:\n```bash\nSPRING_PROFILES_ACTIVE=openai-mini OPENAI_API_KEY=sk-… ./run.sh\n```\n\n## Architecture\n\n```mermaid\nflowchart LR\n    subgraph User[\"You\"]\n        UI[Browser at :8090]\n    end\n\n    subgraph App[\"Intelli-mailbox (Spring Boot)\"]\n        Ctrl[InboxController\u003cbr/\u003e/api/inbox\u003cbr/\u003e/api/inbox/stream]\n        Pipeline[PreprocessingPipeline\u003cbr/\u003esingle-thread queue\u003cbr/\u003e+ in-memory cache]\n        Reader[EmailReader\u003cbr/\u003eBrowserTool wrapper]\n        Enrichment[EnrichmentService\u003cbr/\u003ecombined LLM call]\n    end\n\n    subgraph Chrome[\"Real Chrome (auto-launched, CDP-attached)\"]\n        Tab[gmail.com\u003cbr/\u003esigned in]\n    end\n\n    subgraph LLM[\"Local LLM (default) or OpenAI\"]\n        Model[(Ollama / gpt-4o-mini)]\n    end\n\n    UI -- \"GET /api/inbox\" --\u003e Ctrl\n    UI -- \"SSE /api/inbox/stream\" --\u003e Ctrl\n    Ctrl --\u003e Pipeline\n    Pipeline --\u003e Reader\n    Reader -- \"navigate / evaluate_js / scrape\" --\u003e Tab\n    Pipeline --\u003e Enrichment\n    Enrichment \u003c-- \"Task.outputType(EnrichmentResult.class)\" --\u003e Model\n    Pipeline -- \"EnrichedEmail event\" --\u003e Ctrl\n    Ctrl -- \"SSE event\" --\u003e UI\n```\n\n* `EmailReader` — scrapes the inbox listing and a single email body via `BrowserTool`.\n* `PreprocessingPipeline` — single-thread executor (BrowserTool drives one Chrome page, no parallelism), in-memory cache keyed by inbox-position id, fan-out to SSE subscribers.\n* `EnrichmentService` — one LLM call per email returns `{summary, badges, ctas, phishingSuspected}` via Spring AI's structured output.\n* `InboxController` — REST + SSE. The SSE endpoint replays the cache on connect so a late-arriving client sees the full state.\n\n## REST + SSE API\n\n| Endpoint | Method | Purpose |\n|---|---|---|\n| `/api/inbox` | GET | Scrape Gmail, return `InboxItem[]`, queue any uncached rows for enrichment |\n| `/api/inbox/stream` | GET (SSE) | Stream of `EnrichedEmail` events as enrichment completes; replays cache on connect |\n| `/api/email/{id}/reprocess` | POST | Force re-enrichment of one row |\n| `/api/health` | GET | Liveness + cached-row count |\n\n## LLM provider matrix\n\n| Profile | Cost | Latency per email | Data leaves laptop? | When to use |\n|---|---|---|---|---|\n| `ollama` (default) | $0 | 30–90 s on CPU, 2–4 s on GPU | **No** | Personal email, work inboxes with confidential subjects |\n| `openai-mini` | ~$0.0005/email | 2–5 s | Yes — first 4,000 chars per email | Demos, large inboxes, no privacy concerns |\n\n## Layout\n\n```\nintellimailbox/\n├── pom.xml\n├── run.sh\n└── src/main/\n    ├── java/ai/intelliswarm/intellimailbox/\n    │   ├── IntelliMailboxApplication.java       Spring Boot main + Chrome attach orchestration\n    │   ├── gmail/\n    │   │   ├── RealChromeLauncher.java           Locate + spawn real Chrome with CDP\n    │   │   └── EmailReader.java                  BrowserTool wrapper: list inbox, read email body\n    │   ├── enrichment/\n    │   │   ├── Badge.java                        8-category enum\n    │   │   ├── CtaType.java, Priority.java       enums\n    │   │   ├── Cta.java                          structured action item record\n    │   │   ├── EnrichmentResult.java             raw LLM output POJO\n    │   │   ├── EnrichedEmail.java                final aggregate the UI renders\n    │   │   └── EnrichmentService.java            combined LLM call (summary + badges + CTAs)\n    │   ├── pipeline/\n    │   │   ├── InboxItem.java                    inbox-row record\n    │   │   └── PreprocessingPipeline.java        async worker + cache + SSE fan-out\n    │   └── web/\n    │       └── InboxController.java              REST + SSE\n    └── resources/\n        ├── application.yml                       defaults (web on :8090, BrowserTool attach)\n        ├── application-ollama.yml                local LLM (default)\n        ├── application-openai-mini.yml           cloud LLM opt-in\n        └── static/index.html                     two-theme UI (Intelliswarm dark / Light)\n```\n\n## Trade-offs honestly\n\n* **Inbox scraping is selector-based**: Gmail rotates CSS classes (`bog`, `y2`, `xW`, `zE`, …) every few quarters. If a Google update breaks the listing, fix the selectors in `EmailReader.java`.\n* **Sequential per-email**: BrowserTool drives one Chrome page, so we can't open many emails in parallel. For 25 emails on local Ollama (CPU), expect 10–30 minutes; on `openai-mini` ~1 minute.\n* **No persistence**: enrichment cache is in-memory only. Restart the app and the next refresh re-pays the LLM cost.\n* **Read-only**: no mark-as-read / archive / reply / send actions. By design, for safety on a first pass.\n\n## Roadmap\n\n* Quick-reply drafts (3 tones), inspired by `enterprise-mailbox-assistant`'s `generate_quick_reply_drafts`.\n* RAG enrichment from a local KB via the framework's vector-store starters.\n* Persistence (JDBC + H2) so the cache survives restarts.\n* Per-email phishing sub-classification (`authority_scam`, `credential_harvesting`, …).\n\"# intelli-mailbox\" \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintelliswarm-ai%2Fintelli-mailbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintelliswarm-ai%2Fintelli-mailbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintelliswarm-ai%2Fintelli-mailbox/lists"}