Skip to content

Dhanush-Raj1/Gmail-Assistant-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

93 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“§ AI-Powered Gmail Assistant

End to End AI Agent Project: "AI-powered Gmail assistant for reading, searching, sending, and managing emails efficiently"


πŸš€ Live Applicaiton

🌐 The application is deployed and live

πŸ‘‰ Access the web app here

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.


πŸš€ Project Overview

  • 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.

🎯 How the Project Works

User Authentication:

The user authenticates with Gmail via OAuth 2.0. The app retrieves an access token to interact with Gmail services.

Query Processing:

The user enters a request (e.g., "Find my latest emails from John"). The input is processed and passed to the Groq-powered LLM.

AI-driven Response:

The AI agent interprets the query, calls the Gmail API, and retrieves relevant data. A structured response is generated and displayed in the UI.

Chatbot 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.


πŸ› οΈ Tech Stack

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

πŸ“‚ Project Structure

/πŸ“‚ 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

πŸš€ Setup & Installation

Prerequisites

Gmail API enabled with OAuth 2.0 credentials
Pipenv (for managing dependencies)

Installation Steps

1️⃣ Clone the repository:

git clone https://github.com/Dhanush-Raj1/Gmail-Assistant-Project.git
cd Gmail-Assistant-Project

2️⃣ Set up a virtual environment:

pipenv install
pipenv shell

3️⃣ Configure environment variables:

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

4️⃣ Run the application:

streamlit run app.py

πŸ“ Usage Guide

Access the web app

πŸ”Ή Step 1: Authenticate with Gmail

  • 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.

πŸ”Ή Step 2: Chat with your Inbox

Chat with the assistant in natural language

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

πŸ”Ή Quick Actions:

Play with the quick actions button from the side bar

πŸ“© Retrieve Latest Emails

  • Click "Get Latest Emails" to get the most recent messages.
  • The assistant will return Sender, Subject, and Received Time (converted to IST).

πŸ” Get unread emails

  • Click "Get unread emails" to get a summary of the latest unread emails

🧐 Search emails by keyword

  • Click "Search emails by keyword to get emails related to specific keywords
  • Eg: Search for emails related to 'invoice'

➀ Send an Email

  • 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.

πŸ–ΌοΈ Screenshots

✨ Authentication Page


✨ Chatbot Interface


✨ Email Summarization


πŸš€ Future Enhancements

πŸ”Ή 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.


🀝 Contributing

πŸ’‘ Have an idea? Feel free to contribute or open an issue and pull requests!

πŸ“œ License

This project is licensed under the MIT License. Click to see the LICENSE.

About

An AI powered agent that can read, send, draft, manage your emails seemlessly.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages