GroqMail is a sophisticated email assistant designed to streamline your email communication with the power of AI, ensuring every message is crafted professionally, effectively, and securely. Leveraging Llama Guard 3 8B powered by Groq for robust content filtering, GroqMail maintains a high standard of safety by analyzing generated email content for potentially unsafe language, making it a reliable choice for business and personal use.
This project is created for the Groq Bounty competition, showcasing the capabilities of Groq’s Llama Guard in ensuring safe, AI-powered email generation.
For the purposes of this demo and to showcase the new Groq API capabilities directly, the current GroqMail implementation uses the API in its raw form. However, as the author of Pytector, I’ve developed a streamlined package that also integrates seamlessly with the Groq API. Pytector offers a production-grade solution for efficiently accessing Groq’s powerful features with minimal setup, designed to scale with larger applications.
Benefits of Pytector:
- Security-Focused API Calls: Offers a streamlined approach to Groq API integration, designed with a focus on prompt injection detection.
- Error Handling and Logging: Built-in error handling to ensure stable and reliable API communication.
- Scalability for Production: Developed with a focus on streamlined, scalable implementations suitable for high-demand environments.
For more details and to use Pytector in your projects, visit the Pytector GitHub repository.
Email communication is a critical aspect of both personal and business interactions, and AI-powered tools like GroqMail can save users time, enhance professionalism, and improve communication efficiency. However, as AI applications generate content autonomously, maintaining safety becomes essential, especially when inappropriate or harmful content could damage business reputation or compromise user trust.
GroqMail addresses this by integrating Llama Guard 3 8B for real-time content safety checks, ensuring that every generated email aligns with safety standards. This integration underscores the importance of reliable and safe AI tools in sensitive areas like business communications.
- Content Filtering with Llama Guard: Every generated email is checked by Llama Guard 3 8B for unsafe content. If inappropriate content is detected, it raises an alert, ensuring that only safe emails are displayed.
- AI-Driven Email Generation: Users can generate custom emails for various tones (formal, friendly, professional) and relationships, tailoring each email to the context.
- Easy-to-Use Interface: A streamlined, user-friendly interface built with Streamlit that allows users to quickly draft or respond to emails with minimal input.
- Groq-Powered Badge: Displays a "Powered by Groq" badge in the UI, showcasing the advanced technology behind GroqMail.
- Python 3.7 or higher
- Required packages:
Streamlit
,groq-sdk
,python-dotenv
,streamlit-option-menu
-
Clone the Repository:
git clone https://github.com/yourusername/groqmail.git cd groqmail
-
Install Dependencies:
pip install -r requirements.txt
-
Set Up Environment Variables:
- Create a
.env
file in the root directory with your Groq API key.
GROQ_API_KEY=your_groq_api_key
- Create a
-
Run the App:
streamlit run app.py
-
Access the App: Open your browser and navigate to
http://localhost:8501
.
- Navigate Using the Sidebar: Select the function you need (Main Page, Write an Email, Reply to an Email).
- Write an Email: Fill in the recipient's name, relationship, email purpose, tone, and length. GroqMail generates a custom email for you.
- Reply to an Email: Paste the received email, specify the relationship with the sender, and any details for your response. GroqMail generates a context-aware reply.
- Content Safety Check: Each email goes through Llama Guard 3 8B for safety, and users are notified if any unsafe content is detected.
GroqMail offers significant value for professionals and businesses by providing an efficient, safe, and adaptable email assistant. Ideal for sales, customer service, and client communications, GroqMail assists users in drafting emails that match professional standards, fostering clarity, and maintaining a polished image.
- Time Efficiency: Reduces the time spent drafting and responding to emails, letting users focus on higher-priority tasks.
- Safety Compliance: Llama Guard’s content filtering is essential for industries requiring strict adherence to communication standards, ensuring professionalism and avoiding harmful language.
- Scalable Solution: GroqMail’s adaptability makes it ideal for both small businesses and large enterprises looking for reliable and safe AI-powered communication tools.
- Backend: Groq API using Llama Guard 3 8B for content filtering and Llama Versatile 70B for email generation.
- Frontend: Streamlit, providing an interactive and user-friendly interface.
- Deployment: Easily deployable on platforms supporting Python and Streamlit, such as Heroku or Vercel.
For an in-depth look at each function and safety feature, refer to docs.md. This document contains detailed explanations of the check_email_safety
function and safety protocols, as well as usage guidelines for GroqMail’s email generation capabilities.
This README provides a comprehensive overview, emphasizing Llama Guard's safety features and the business use case, making it suitable for submission to the Groq Bounty competition.