Inspiration

Managing email can become overwhelming very quickly. Even though Gmail provides labels and organization tools, users still have to manually decide where each new email belongs.

I wanted to build something that could take that repetitive task away. The idea for AI Mail Organizer came from the thought: what if AI could actually organize your inbox for you instead of simply telling you what an email is about?

The goal was to create a practical AI assistant that could connect to a real Gmail account, understand incoming emails, classify them, and automatically organize them.

What it does

AI Mail Organizer uses AI to automatically organize emails in a user's Gmail account.

The application:

  • Connects to Gmail using Google OAuth.
  • Retrieves emails from the user's Gmail account.
  • Reads the sender, subject, and email content.
  • Uses AI to classify each email.
  • Categorizes emails into:
    • Work
    • Shopping
    • Finance
    • Social
    • Personal
    • Travel
    • Other
  • Automatically creates Gmail labels when needed.
  • Applies the appropriate label directly to the email in Gmail.
  • Displays the organized emails and their categories in a web dashboard.

The important part is that the organization happens in the user's actual Gmail account, rather than only inside the application.

How we built it

The backend was built using Python and FastAPI.

We used the Gmail API to retrieve emails and create/apply Gmail labels. Google OAuth 2.0 was used to authenticate users and securely access their Gmail account.

For AI classification, we used Ollama with Llama 3.2. The email sender, subject, and body are provided to the AI, which classifies the email into one of the predefined categories.

The frontend was built using Next.js, React, TypeScript, and Tailwind CSS. It provides a simple dashboard where users can organize their Gmail and see how their emails were categorized.

The overall process is:

User
 ↓
Next.js Frontend
 ↓
FastAPI Backend
 ↓
Google OAuth
 ↓
Gmail API
 ↓
Email Content
 ↓
Ollama + Llama 3.2
 ↓
Email Category
 ↓
Gmail Label
 ↓
Organized Gmail

Built With

Share this project:

Updates

Submission history