End to End AI Agent Project: "AI-powered Gmail assistant for reading, searching, sending, and managing emails efficiently"
π The application is deployed and live
Note
The web app may take 1-2 minutes to load.
To access and use the Gmail Assistant, your email address must first be authorized by the project owner. Please contact the owner from your email to request access.
Tip
For the best experience, please refer to the Usage Guide section below to learn how to navigate and use the web app effectively.
- The Gmail Assistant is an AI-driven application that helps users interact with their Gmail accounts using natural language. Built with Agno AI (formerly Phidata), Groq LLM, and Streamlit.
- The assistant utilizes Google OAuth 2.0 for authentication and interacts with the Gmail API to fetch and manage emails securely.
- It allows users to:
π© Read emails β Retrieve and summarize recent emails.
π Search emails β Find emails based on keywords, sender, or date.
β Send emails β Compose and send emails via Gmail.
π Manage emails β Handle spam, categorize emails, and more.
The user authenticates with Gmail via OAuth 2.0. The app retrieves an access token to interact with Gmail services.
The user enters a request (e.g., "Find my latest emails from John"). The input is processed and passed to the Groq-powered LLM.
The AI agent interprets the query, calls the Gmail API, and retrieves relevant data. A structured response is generated and displayed in the UI.
The web-based UI (built with Streamlit) allows users to interact seamlessly. User queries appear on the right, and assistant responses appear on the left, resembling a real chatbot.
| Technology | Description |
|---|---|
| Python | Programming language used |
| Streamlit | Web framework for UI of the assistant |
| Agno AI (formerly Phidata) | AI framework for building agents and tools |
| Groq LLM | LLM for natural language processing |
| Google OAuth 2.0 | User authentication for using the gmail assistant |
| Gmail API | Email retrieval and management |
/π Gmail-Assistant
βββ /π static # Static assets (images, styles)
β βββ gmail-logo.png # Logo for UI
βββ /π rough # Research and rough work purpose
| βββ rough.py # rough python file
βββ /π src # Source code
β βββ assistant_builder.py # Core AI logic for Gmail operations
β βββ /π utils
β β βββ exception.py # Custom exception handling
| | βββ helper.py # Google Oauth authentication
βββ Pipfile # Dependencies (Pipenv)
βββ Pipfile.lock # Locked dependencies
βββ requirements.txt # List of required libraries, modules, dependencies
βββ .env # Environment variables (OAuth keys)
βββ README.md # Project documentation
Gmail API enabled with OAuth 2.0 credentials
Pipenv (for managing dependencies)
git clone https://github.com/Dhanush-Raj1/Gmail-Assistant-Project.git
cd Gmail-Assistant-Projectpipenv install
pipenv shellCreate a .env file and add your credentials:
GROQ_API_KEY=your_groq_api_key
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_PROJECT_ID=your_project_id
GOOGLE_REDIRECT_URI=your_redirect_uri
HF_TOKEN_LLAMA=your_huggingface_token
streamlit run app.py
- Click on the "Authenticate with Gmail" button on the sidebar.
- Sign in with your Google account and click Select ALL to grant all the necessary permissions.
- The web app will be directed, click the Authenticate with Gmail button once again.
Note
- Give me the summary of my 3 latest emails in under 100 words
- Find me the recent 2 emails related to invoice
- Send an email to
<sender_email>saying I'm free on Wednesday at 4:30 PM - Find me the latest email from
<sender_email>and summarize in 100 words
- Click "Get Latest Emails" to get the most recent messages.
- The assistant will return Sender, Subject, and Received Time (converted to IST).
- Click "Get unread emails" to get a summary of the latest unread emails
- Click "Search emails by keyword to get emails related to specific keywords
- Eg: Search for emails related to 'invoice'
- Click "Send an email" to send an email to a person and you can enter the subject.
- The assistant will send the email with a structured format and a signature.
β¨ Authentication Page
β¨ Chatbot Interface
β¨ Email Summarization
πΉ Memory-Based Conversations
Store chat history using a vector database (FAISS or PostgreSQL).
πΉ Priority-Based Email Sorting
Categorize emails using AI-driven importance detection.
πΉ Sentiment Analysis for Emails
Analyze email tone (positive, neutral, negative) before responding.
πΉ Voice Commands Integration
Allow users to interact via voice instead of text input.
πΉ Multi-Account Support
Enable switching between multiple Gmail accounts.
πΉ Mobile App Version
Build a React Native or Flutter app for better mobile accessibility.
π‘ Have an idea? Feel free to contribute or open an issue and pull requests!
This project is licensed under the MIT License. Click to see the LICENSE.