This project utilizes CrewAI to classify incoming emails and generate appropriate responses based on their importance. It employs a two-agent system powered by the Llama-3.3-70B-Versatile model via Groq API.
- Email Classification: Assigns emails one of three categories: Important, Casual, or Spam.
- Automated Responses: Generates appropriate responses based on classification.
- Important Emails: Formal response.
- Casual Emails: Informal response.
- Spam Emails: Ignored.
- Multi-Agent Collaboration: Uses CrewAI framework to coordinate tasks between agents.
Ensure you have the following installed:
- Python 3.8+
- pip
- Clone the repository:
git clone https://github.com/RuvenGuna94/Llama-agent-spam-classifier.git cd Llama-agent-spam-classifier
- Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
- Create a
.env
file in the root directory. - Add the following line to it:
GROQ_API_KEY=your_api_key_here
- Create a
- Run the script:
python main.py
- The agents will classify an email and generate a response accordingly.
email_agent.py
: Core script defining agents and their tasks..env
: Stores environment variables.requirements.txt
: Lists dependencies.
Agent: Email Classifier
Classification: Casual
Agent: Email Responder
Response: "Noted! Thanks for the update."
- CrewAI: Agent-based workflow framework
- Llama 3: Large language model from Groq
- Python: Primary programming language
- Extend classification to include more categories.
- Integrate with an email API (e.g., Gmail API) for real-time processing.
- Store classified emails in a database.
This project is licensed under the MIT License.