Files

1 line
11 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"repo": "ankitsingh0805/mailmind", "files": {"README.md": {"786ebe4085b4d4091d871d7cdefeac7fb3606ff9": {"t": 1785747228.6526902, "n": 5061, "h": "78db2a693b7c71b4", "c": "# AI-Driven Email Assistant\n\nAn AI-powered email automation system that fetches, filters, summarizes, and generates responses to emails using advanced language models. It integrates with both IMAP and SMTP servers and utilizes a state-graph workflow to manage email processing.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Features](#features)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Usage](#usage)\n- [Directory Structure](#directory-structure)\n- [Testing](#testing)\n- [Contributing](#contributing)\n- [License](#license)\n- [Acknowledgments](#acknowledgments)\n\n## Overview\n\nThis repository implements an email processing pipeline that leverages state-of-the-art language models (via Deepseek API) and a state graph workflow (using LangGraph) to:\n\n- **Ingest Emails:** Fetch emails from an IMAP server or load simulated emails from a JSON file.\n- **Filter Emails:** Classify incoming emails as _spam_, _urgent_, _informational_, or _needs review_.\n- **Summarize Emails:** Generate concise summaries of email content.\n- **Generate Responses:** Automatically draft email replies while allowing human review.\n- **Send Emails:** Dispatch responses via SMTP or send drafts to a Gmail account.\n\n## Features\n\n- **Email Ingestion:** Supports both live email fetching (via IMAP) and simulation (via a local JSON file).\n- **Filtering Agent:** Uses a language model to classify emails into categories.\n- **Summarization Agent:** Generates 2–3 sentence summaries of email bodies.\n- **Response Agent:** Drafts polite and professional responses based on email content and summaries.\n- **Human Review:** Provides an option for manual review and editing of auto-generated responses.\n- **State Graph Workflow:** Orchestrates the email processing steps (filtering, summarization, and response generation) with conditional transitions.\n- **Logging:** Detailed logging for debugging and monitoring application behavior.\n\n## Installation\n\n### Prerequisites\n\n- Python 3.8 or above\n- [pip](https://pip.pypa.io/)\n- (Optional) [virtualenv](https://virtualenv.pypa.io/)\n\n### Setup\n\n1. **Clone the repository:**\n\n ```bash\n git clone https://github.com/Ankitsingh0805/MailMind.git\n ```\n\n2. **Create and activate a virtual environment (recommended):**\n\n ```bash\n python -m venv venv\n source venv/bin/activate # On Windows: venv\\Scripts\\activate\n ```\n\n3. **Install the dependencies:**\n\n ```bash\n pip install -r requirements.txt\n ```\n\n## Configuration\n\nThe application requires several configuration settings (such as API keys and email server credentials). Create a `.env` file in the project root with the following variables:\n\n```dotenv\n# Deepseek API\nDEEPSEEK_API_KEY=your_deepseek_api_key\n\n# SMTP Settings\nEMAIL_SERVER=smtp.yourserver.com\nEMAIL_USERNAME=your_email@example.com\nEMAIL_PASSWORD=your_email_password\nEMAIL_PORT=587 # Or your SMTP port\n\n# IMAP Settings (defaults to Gmail settings if not provided)\nIMAP_USERNAME=your_imap_username\nIMAP_PASSWORD=your_imap_password\nIMAP_SERVER=imap.gmail.com\nIMAP_PORT=993\n```\n\nAdjust the values as needed for your environment and email provider.\n\n## Usage\n\nTo run the main email processing application, simply execute:\n\n```bash\npython main.py\n```\n\n### What to Expect\n\n1. **Fetching Emails:** \n The app will retrieve emails from your IMAP server (or simulate using `sample_emails.json` if configured for simulation).\n\n2. **Email Processing:** \n Each email is passed through a state graph workflow:\n - **Filtering:** Classifies the email (e.g., spam, urgent, informational, needs review).\n - **Summarization:** Generates a short summary of the email content.\n - **Response Generation:** Drafts a reply. If the response is uncertain or flagged for review, it prompts for human intervention.\n\n3. **Sending/Drafting:** \n You’ll be prompted to send the email or save it as a draft (which will be sent via SMTP to your specified Gmail address).\n\n\n\n## Testing\n\nTo run tests (if provided), you can use a testing framework like `pytest`:\n\n```bash\npytest\n```\n\nOr run:\n\n```bash\npython -m unittest discover\n```\n\nEnsure that any test dependencies are installed and that you have configured your environment variables for testing if needed.\n\n## Contributing\n\nContributions are welcome! To contribute:\n\n1. Fork the repository.\n2. Create a new branch (`git checkout -b feature/my-feature`).\n3. Commit your changes and push to your branch.\n4. Open a Pull Request with a clear description of your changes.\n\nPlease follow our coding conventions and include relevant tests when applicable.\n\n\n\n## Acknowledgments\n\n- **Deepseek:** For the API and language model backend.\n- **LangChain & LangGraph:** For the frameworks that help in building language model–driven workflows.\n- **Open Source Contributors:** Thank you to everyone who has contributed to the libraries and tools used in this project.\n\n---\n\nThis documentation should serve as a comprehensive guide to setting up, using, and contributing to the AI-Driven Email Assistant. Feel free to modify or expand sections as your project evolves.\n"}, "a85686f1f561ecc6d13990f142e0c086b32de1e1": {"t": 1785771509.512827, "n": 5082, "h": "a8d1eaf21b6edcdd", "c": "# AI-Driven Email Assistant\n\nAn AI-powered email automation system that fetches, filters, summarizes, and generates responses to emails using advanced language models. It integrates with both IMAP and SMTP servers and utilizes a state-graph workflow to manage email processing.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Features](#features)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Usage](#usage)\n- [Directory Structure](#directory-structure)\n- [Testing](#testing)\n- [Contributing](#contributing)\n- [License](#license)\n- [Acknowledgments](#acknowledgments)\n\n## Overview\n\nThis repository implements an email processing pipeline that leverages state-of-the-art language models (via Deepseek API) and a state graph workflow (using LangGraph) to:\n\n- **Ingest Emails:** Fetch emails from an IMAP server or load simulated emails from a JSON file.\n- **Filter Emails:** Classify incoming emails as _spam_, _urgent_, _informational_, or _needs review_.\n- **Summarize Emails:** Generate concise summaries of email content.\n- **Generate Responses:** Automatically draft email replies while allowing human review.\n- **Send Emails:** Dispatch responses via SMTP or send drafts to a Gmail account.\n\n## Features\n\n- **Email Ingestion:** Supports both live email fetching (via IMAP) and simulation (via a local JSON file).\n- **Filtering Agent:** Uses a language model to classify emails into categories.\n- **Summarization Agent:** Generates 2–3 sentence summaries of email bodies.\n- **Response Agent:** Drafts polite and professional responses based on email content and summaries.\n- **Human Review:** Provides an option for manual review and editing of auto-generated responses.\n- **State Graph Workflow:** Orchestrates the email processing steps (filtering, summarization, and response generation) with conditional transitions.\n- **Logging:** Detailed logging for debugging and monitoring application behavior.\n\n## Installation\n\n### Prerequisites\n\n- Python 3.8 or above\n- [pip](https://pip.pypa.io/)\n- (Optional) [virtualenv](https://virtualenv.pypa.io/)\n\n### Setup\n\n1. **Clone the repository:**\n\n ```bash\n git clone https://github.com/Ankitsingh0805/MailMind.git\n cd your-repo-name\n ```\n\n2. **Create and activate a virtual environment (recommended):**\n\n ```bash\n python -m venv venv\n source venv/bin/activate # On Windows: venv\\Scripts\\activate\n ```\n\n3. **Install the dependencies:**\n\n ```bash\n pip install -r requirements.txt\n ```\n\n## Configuration\n\nThe application requires several configuration settings (such as API keys and email server credentials). Create a `.env` file in the project root with the following variables:\n\n```dotenv\n# Deepseek API\nDEEPSEEK_API_KEY=your_deepseek_api_key\n\n# SMTP Settings\nEMAIL_SERVER=smtp.yourserver.com\nEMAIL_USERNAME=your_email@example.com\nEMAIL_PASSWORD=your_email_password\nEMAIL_PORT=587 # Or your SMTP port\n\n# IMAP Settings (defaults to Gmail settings if not provided)\nIMAP_USERNAME=your_imap_username\nIMAP_PASSWORD=your_imap_password\nIMAP_SERVER=imap.gmail.com\nIMAP_PORT=993\n```\n\nAdjust the values as needed for your environment and email provider.\n\n## Usage\n\nTo run the main email processing application, simply execute:\n\n```bash\npython main.py\n```\n\n### What to Expect\n\n1. **Fetching Emails:** \n The app will retrieve emails from your IMAP server (or simulate using `sample_emails.json` if configured for simulation).\n\n2. **Email Processing:** \n Each email is passed through a state graph workflow:\n - **Filtering:** Classifies the email (e.g., spam, urgent, informational, needs review).\n - **Summarization:** Generates a short summary of the email content.\n - **Response Generation:** Drafts a reply. If the response is uncertain or flagged for review, it prompts for human intervention.\n\n3. **Sending/Drafting:** \n You’ll be prompted to send the email or save it as a draft (which will be sent via SMTP to your specified Gmail address).\n\n\n\n## Testing\n\nTo run tests (if provided), you can use a testing framework like `pytest`:\n\n```bash\npytest\n```\n\nOr run:\n\n```bash\npython -m unittest discover\n```\n\nEnsure that any test dependencies are installed and that you have configured your environment variables for testing if needed.\n\n## Contributing\n\nContributions are welcome! To contribute:\n\n1. Fork the repository.\n2. Create a new branch (`git checkout -b feature/my-feature`).\n3. Commit your changes and push to your branch.\n4. Open a Pull Request with a clear description of your changes.\n\nPlease follow our coding conventions and include relevant tests when applicable.\n\n\n\n## Acknowledgments\n\n- **Deepseek:** For the API and language model backend.\n- **LangChain & LangGraph:** For the frameworks that help in building language model–driven workflows.\n- **Open Source Contributors:** Thank you to everyone who has contributed to the libraries and tools used in this project.\n\n---\n\nThis documentation should serve as a comprehensive guide to setting up, using, and contributing to the AI-Driven Email Assistant. Feel free to modify or expand sections as your project evolves.\n"}}}}