Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

mails-analysis-chat

AI Email Analysis Chatbot

This project is a demo of a chat application that interacts with an AI model to analyze emails. The application leverages a custom MCP server and provides tools that allow the AI to access and analyze emails from the Apple Mail client on a MacBook.

Installation

  1. Clone the Repository:
    git clone https://github.com/nikyta384/mails-analysis-chat.git
    cd mails-analysis-chat
  2. Set up a Virtual Environment:
     python3 -m venv venv
     source venv/bin/activate
  3. Install Requirements:
     pip install -r requirements.txt
  4. Choose model: If you choose llama3.2, you must provide a URL for the llama model. You can specify the URL using the --llama-url flag, or the default URL http://localhost:11434/v1 will be used (see command for running in step 4).

If you choose openai:gpt-4.1-mini, ensure your OPENAI_APIKEY environment variable is set with your OpenAI API key.

 export OPENAI_API_KEY="your-openai-api-key"
  1. Running the Application:
     python3 run.py --model <model-type> # llama3.2 or openai:gpt-4.1-mini

Tools for Email Analysis

The AI agent has access to the following tools to interact with the user's emails:

check_email_for_hours(hours, exclude_subjects=None) Fetches emails from the last specified number of hours, excluding specified subjects.

check_latest_emails(n, exclude_subjects=None) Retrieves the latest n emails, excluding specified subjects.

##NOTE Ensure that your MacBook has Apple Mail configured and accessible by the AppleScript, as the tools rely on it to fetch and analyze emails.

About

AI email assistant for Apple Mail — custom MCP server exposing mailbox tools to a local Llama 3.2 or GPT-4.1-mini

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages