This project aims to classify and respond to emails using AI agents. The project utilizes llama 3.2
model and crewai
to create agents for classifying emails based on their importance and responding accordingly.
The project consists of two main agents:
- Email Classifier: Classifies emails into three categories: important, casual, or spam.
- Email Responder: Responds to emails based on their classification.
-
Classifier Agent:
- Role: Email classifier
- Goal: Accurately classify emails based on their importance.
- Backstory: An AI assistant focused on classifying emails accurately and honestly.
-
Responder Agent:
- Role: Email responder
- Goal: Write concise responses to emails based on their importance.
- Backstory: An AI assistant tasked with writing short responses based on email importance provided by the classifier agent.
-
Classify Email:
- Description: Classify the provided email.
- Expected Output: One of these three options:
important
,casual
, orspam
.
-
Respond to Email:
- Description: Respond to the email based on its importance.
- Expected Output: A concise response based on the email's classification.
- Download and install Ollama
https://ollama.com/download/OllamaSetup.exe
- Pull llama 3.2 model
ollama run llama3.2
- Run the model as a server in localhost
ollama serve
-
Clone the repository:
git clone https://github.com/RepZ97/email-classification-and-response-llama3.2.git cd email-classification-and-response-llama3.2
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required packages:
pip install -r requirements.txt
-
Install
crewai
if not already installed:pip install crewai
To run the email classification and response workflow:
- Ensure you have
ollama/llama3.2
model installed. - Execute the
main.py
script:python main.py