This project implements a multi-agent system using Langraph to automate email processing. The system consists of three agents:
- Email Reader Agent – Fetches unseen emails from an email inbox.
- Classification Agent – Uses AI to categorize emails into predefined labels (e.g., Job, LinkedIn, Spam, Medium, etc.).
- Action Agent – Moves classified emails into appropriate folders or applies labels.
- Automatically fetches unseen emails.
- AI-powered classification of emails.
- Moves emails to the correct folders based on their category.
email_multi_agent/
│── email_reader_agent.py # Fetches emails
│── classification_agent.py # Classifies emails using AI
│── action_agent.py # Moves emails based on classification
│── run_email_reader.py # Runs the Email Reader Agent
│── test.py # Tests the full workflow
│── requirements.txt # Dependencies
│── README.md # Project Documentation
python3 -m venv emailvenv
source emailvenv/bin/activate # On Windows, use: emailvenv\Scripts\activatepip install -r requirements.txtEdit email_reader_agent.py and action_agent.py to add your email and app password:
EMAIL = "your_email@gmail.com"
PASSWORD = "your_app_password" # Use an App Password, NOT your email passwordpython run_email_reader.pypython test.py- The Email Reader Agent logs into the email inbox and fetches unseen emails.
- The Classification Agent processes the emails and categorizes them using AI.
- The Action Agent moves the emails to the correct folders.
- The system logs all actions taken.
- Uses NLP techniques (e.g., TF-IDF, BERT, or Llama-2) to analyze email content.
- Classifies emails into predefined categories.
Authentication Failed Error:
- Enable IMAP in Gmail settings.
- Use an App Password instead of your regular password.
No Emails Found:
- Ensure there are unseen emails in your inbox.
- Auto-reply agent to send responses based on email type.
- Summarization agent to provide brief email summaries.
- Customizable rules for classification.
Feel free to contribute or suggest improvements! 🚀