End to End AI Agent Project: "AI-powered Gmail assistant for reading, searching, sending, and managing emails efficiently"
- 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-Project
pipenv install
pipenv shell
Create 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 main.py
- Click on the "Authenticate with Gmail" button.
- Sign in with your Google account and grant the necessary permissions.
- Chat with the gmail assistant in natural langugage. Example:
- Give me the summary of my latest emails
- Find me the emails related to invoice
- Send an email to <sender_email id> conveying that I'm free on wednesday at 4.30pm and ready to meet him about the investment.
- What is the latest email about AI news?
- Click "Fetch Latest Emails" to get the most recent messages.
- The assistant will return Sender, Subject, and Received Time (converted to IST).
- Enter a keyword, sender email, or date in the search bar.
- The assistant will list matching emails from the Inbox and Spam folders.
- Enter the recipientβs email, subject, and message body.
- The assistant will send the email with a structured format and a signature.
- View, organize, and handle emails based on priority, sender, or time received.
- Spam detection and handling for junk or phishing emails.
β¨ 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.