0xrushi / emailgenius

EmailGenius: AI-Driven Email Categorization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

EmailGenius is an AI-driven email categorization tool that automates the process of sorting and labeling emails using the Opensource LLAMA API. It connects to an IMAP server, fetches emails, and categorizes them based on user-defined criteria. The project also includes a Streamlit interface for an interactive user experience.

Purpose

The market offers various proprietary email categorization and management tools, including:

  • SaneBox: This tool automatically organizes incoming emails into different folders based on user behavior.
  • Clean Email: A management tool designed to help users declutter their inboxes from unnecessary emails.

However, these tools have limitations, such as not being opensource and requiring payment and often adopting a pricing model based on each email account. With the ongoing democratization of AI, it's expected that even standard servers will be capable of running similar processes more affordably, accommodating any number of accounts within the next five years.

In contrast, widely-used email services like Microsoft Outlook, Gmail, and Zoho Mail can be cumbersome in setting up email filter rules, often involving numerous steps. Moreover, users frequently encounter issues where emails from unsubscribed websites persist in appearing in their inboxes.

Requirements

Installation

  1. Clone the repository:
    git clone https://github.com/0xrushi/emailgenius.git
    
  2. Navigate to the project directory:
    cd emailgenius
    
  3. Install the required Python packages:
    pip install -r requirements.txt
    

Configuration

  1. Create a .env file in the project root with the following variables:
    • OPENAI_API_KEY - Your OpenAI API key.
    • OPENAI_API_BASE - OpenAI API base URL.
    • USERNAME - IMAP server username.
    • PASSWORD - IMAP server password.
  2. Load environment variables:
    load_dotenv()

Usage

  1. To ingest emails from your IMAP server to a data/email_data.json file:
    streamlit run src/main.py -- --ingest true
    
  2. To run the Streamlit app for categorization:
     streamlit run src/main.py
    
  3. To use it in production:
     streamlit run src/main.py -- --approve true
    

Streamlit App

  • Launch the app and enter a category in the text input field.
  • Click 'Submit' to categorize emails based on the specified category.
  • The app displays the processed emails along with their categorization.
  • In production mode (using the --approve flag), labels are generated and the actual sorting of emails into these labels occurs.

Screenshots

Screenshot 2023-11-28 at 9 44 10 PM Screenshot 2023-11-28 at 9 49 00 PM Screenshot 2023-11-28 at 10 12 53 PM Screenshot 2023-11-28 at 10 13 08 PM

Limitations

  • As of now, the existing code template is compatible exclusively with Gmail.

Contributing

Contributions to EmailGenius are welcome. Please follow the standard fork, branch, and pull request workflow.

Buy Me A Coffee

About

EmailGenius: AI-Driven Email Categorization

License:MIT License


Languages

Language:Python 100.0%