EasyMail: A Gemini Email Organizer


📨 About the Project — EasyMail: A Gemini Email Organizer

🌟 Inspiration

Managing emails can be overwhelming — long threads, unclear requests, and language barriers make communication time-consuming. I wanted to build something that makes handling emails effortless — not just a reply generator, but a complete AI assistant for your inbox.

The inspiration came from the idea of leveraging Google Chrome’s built-in on-device AI capabilities (like the Writer, Summarizer, Rewriter, and Proofreader APIs) to create a privacy-focused, fast, and smart email companion — all running locally within the browser, without needing any external API keys.


🧠 What I Learned

Working on EasyMail gave me deep insights into the new generation of browser AI APIs — including:

  • The Prompt API for structured interactions with on-device models.
  • The Writer, Rewriter, Summarizer, Proofreader, and Translator APIs for different natural language tasks.
  • Handling user activation constraints (navigator.userActivation.isActive) required for creating AI instances securely.
  • Efficient DOM extraction and scripting using chrome.scripting.executeScript() to safely read email content.
  • Managing language detection using the experimental LanguageDetector API and dynamically adapting responses.

I also explored how context-aware summarization and tone adaptation could make AI replies more natural and human-like.


🛠️ How I Built It

EasyMail is built entirely as a Chrome Extension, with modular ES6-based architecture:

  • Frontend (Side Panel / Popup):

    • A clean UI for buttons like Summarize, Reply, Improve, Translate, and Proofread.
    • Real-time interaction area showing user prompts and AI responses.
  • APIs:

    • summarizer.js — Uses the Summarizer API for paragraph + key-point summaries.
    • writer.js — Leverages the Writer API to draft context-aware, polite replies.
    • rewriter.js — Refines or improves draft emails while preserving meaning.
    • proofreader.js — Corrects grammar and improves readability.
    • translator.js — Automatically translates emails based on detected language.
    • languageDetector.js — Uses the Language Detector API to auto-detect the language before processing.
    • prompt.js — Uses Prompt API for prompts given in chat box.
  • Chrome Integration:

    • Uses chrome.tabs.query and chrome.scripting.executeScript to capture open email content.
    • Handles asynchronous communication between background and content scripts.

Technology Stack: [ \text{HTML + CSS + JavaScript (ES Modules) + Chrome Extension APIs + Built-in AI APIs} ]


⚙️ Challenges I Faced

  1. Experimental API limitations — The built-in AI APIs (Writer, Summarizer, etc.) are still experimental, so I had to enable several Chrome flags like:
  • chrome://flags/#writer-api-for-gemini-nano
  • chrome://flags/#summarizer-api-for-gemini-nano
  • chrome://flags/#proofreader-api-for-gemini-nano This required handling cases where APIs were unavailable or user activation was missing.
  1. DOM inconsistency across email clients — Extracting the right email content from Gmail was tricky due to different HTML structures.

  2. Language and tone alignment — Ensuring that the reply tone matched the sender’s tone required fine-tuning the shared context and instructions.

  3. User activation requirement — Since the Summarizer and Writer APIs only initialize after a direct user action, I had to redesign UX flows so users always trigger generation through a click event.

  4. Testing and debugging experimental features — API behavior changed across Chrome builds, so continuous testing after each update was crucial.


🚀 Outcome

After overcoming these challenges, EasyMail now allows users to: ✅ Summarize long email threads. ✅ Generate smart, tone-matched replies. ✅ Translate messages automatically. ✅ Rewrite or improve drafts for clarity. ✅ Proofread outgoing emails instantly.

All of this happens locally, securely, and seamlessly inside your Chrome browser — no external APIs or data sharing needed.


💡 Future Scope

  • Adding voice command support to interact with emails hands-free.
  • Integrating auto-detection for email tone and urgency.
  • Expanding compatibility with multiple email providers.
  • Introducing smart templates and batch summarization for inboxes.

🧩 In Summary

EasyMail transforms your inbox into an intelligent workspace — using Chrome’s on-device AI to save time, write better, and communicate effortlessly.

Built With

Share this project:

Updates