{"id":30061784,"url":"https://github.com/serverdaun/email_assistant","last_synced_at":"2025-08-08T02:54:09.070Z","repository":{"id":308048976,"uuid":"1020417820","full_name":"serverdaun/email_assistant","owner":"serverdaun","description":"Email Agent is an AI assistant that automates and streamlines Gmail email management.","archived":false,"fork":false,"pushed_at":"2025-08-03T19:39:53.000Z","size":96,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-03T21:24:40.198Z","etag":null,"topics":["agentic-ai","gmail","langgraph-python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serverdaun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-15T20:52:11.000Z","updated_at":"2025-08-03T19:41:15.000Z","dependencies_parsed_at":"2025-08-03T21:24:46.938Z","dependency_job_id":"3a2444b6-9b0f-4be0-88aa-20438b2e6a14","html_url":"https://github.com/serverdaun/email_assistant","commit_stats":null,"previous_names":["serverdaun/email_assistant"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/serverdaun/email_assistant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverdaun%2Femail_assistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverdaun%2Femail_assistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverdaun%2Femail_assistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverdaun%2Femail_assistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serverdaun","download_url":"https://codeload.github.com/serverdaun/email_assistant/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverdaun%2Femail_assistant/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269356485,"owners_count":24403508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-ai","gmail","langgraph-python"],"created_at":"2025-08-08T02:54:08.499Z","updated_at":"2025-08-08T02:54:09.058Z","avatar_url":"https://github.com/serverdaun.png","language":"Python","readme":"# Email Agent\n\nAn intelligent AI assistant for email management built with LangGraph, featuring human-in-the-loop capabilities and persistent memory.\n\n## Overview\n\nThis project implements an email assistant that can automatically triage, respond to, and manage emails using Gmail API integration. The agent learns from user feedback and adapts to preferences over time through persistent memory storage.\n\n**Inspired by the [LangChain Agents From Scratch course](https://github.com/langchain-ai/agents-from-scratch)** - This project builds upon the concepts and patterns demonstrated in the course, applying them to create a production-ready email management system.\n\n## Features\n\n- **Smart Email Triage**: Automatically classifies emails as ignore, notify, or respond\n- **Gmail Integration**: Direct connection to Gmail API for email management\n- **Human-in-the-Loop**: User review and approval for important actions using [Agent Inbox](https://github.com/langchain-ai/agent-inbox) UI\n- **Persistent Memory**: Learns from user feedback and adapts preferences\n- **Calendar Integration**: Schedule meetings and check availability\n- **Structured Responses**: Generates professional email responses\n\n## Architecture\n\nThe system uses LangGraph to orchestrate a multi-step workflow:\n\n1. **Email Triage**: Analyzes incoming emails and routes them appropriately\n2. **Response Generation**: Creates contextually appropriate responses\n3. **Human Review**: Allows user intervention for important decisions via Agent Inbox interface\n4. **Memory Updates**: Persists learning from user feedback\n\n## Quick Start\n\n### Prerequisites\n\n- Python 3.11+\n- Gmail API credentials\n- OpenAI API key\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone \u003crepository-url\u003e\ncd email-agent\n\n# Install dependencies\npip install -e .\n\n# Set up environment variables\ncp .env.example .env\n# Edit .env with your API keys\n```\n\n### Configuration\n\n1. Set up Gmail API credentials following the [Gmail Tools README](src/tools/gmail/)\n2. Add your API keys to `.env`:\n   ```\n   OPENAI_API_KEY=your_openai_api_key\n   LANGSMITH_API_KEY=your_langsmith_api_key\n   ```\n\n### Usage\n\n```python\nfrom src.main import create_email_agent\n\n# Create the agent\nagent = create_email_agent()\n\n# Process an email\nresult = agent.invoke({\n    \"email_input\": {\n        \"id\": \"email_id\",\n        \"subject\": \"Meeting Request\",\n        \"from_email\": \"sender@example.com\",\n        \"content\": \"Can we schedule a meeting?\"\n    }\n})\n```\n\n## Project Structure\n\n```\nsrc/\n├── main.py              # Main agent implementation\n├── prompts.py           # System prompts and instructions\n├── schemas.py           # Pydantic models and state schemas\n├── utils.py             # Utility functions\n└── tools/\n    ├── base_tools.py    # Core tool definitions\n    ├── gmail_tools.py   # Gmail API integration\n    └── gmail/           # Gmail setup and configuration\n```\n\n## Key Components\n\n- **State Management**: Uses LangGraph's `MessagesState` for conversation tracking\n- **Memory System**: Persistent storage for user preferences and learning\n- **Tool Integration**: Modular tool system for email, calendar, and scheduling operations\n- **Human-in-the-Loop**: Interrupt handlers for user review and approval using Agent Inbox\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverdaun%2Femail_assistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserverdaun%2Femail_assistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverdaun%2Femail_assistant/lists"}