Skip to content

rajeshthangaraj1/email_assistant

Repository files navigation

Email Assistant with Gemini LLM

This project creates an automated email assistant that reads incoming emails and generates replies using Google's Gemini LLM through AgnoAI.

Setup Instructions

  1. Install the required dependencies:
pip install -r requirements.txt
  1. Set up Google Cloud Project and Gmail API:

    • Go to the Google Cloud Console
    • Create a new project
    • Enable the Gmail API
    • Create OAuth 2.0 credentials
    • Download the credentials and save them as credentials.json in the project directory
  2. Create a .env file in the project directory with the following content:

GEMINI_API_KEY=your_gemini_api_key_here
[email protected]
  1. Get your Gemini API key:

Usage

  1. Run the script:
python main.py
  1. On first run, you'll be prompted to authorize the application to access your Gmail account. Follow the browser prompts to complete the authorization.

  2. The script will:

    • Read the 5 most recent emails in your inbox
    • Generate replies using Gemini LLM
    • Send the replies automatically

Features

  • Automated email reading and reply generation
  • Uses Gemini LLM for intelligent response generation
  • Handles both plain text and multipart emails
  • Secure credential management
  • Error handling and logging

Security Notes

  • Never commit your .env file or credentials.json to version control
  • Keep your API keys secure
  • The script uses OAuth 2.0 for secure Gmail access

About

email assistant using gemini

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages