A Langgraph system for streamlining client interactions, ensuring every customer receives a quick and accurate response. 🌟
In today's fast-paced environment, customers demand quick, accurate, and personalized responses—expectations that can overwhelm traditional support teams. Managing large volumes of emails, categorizing them, crafting appropriate replies, and ensuring quality consumes significant time and resources, often leading to delays or errors, which can harm customer satisfaction.
Customer Support Email Automation is an AI solution designed to enhance customer communication for businesses. Leveraging a Langgraph-driven workflow, multiple AI agents collaborate to efficiently manage, categorize, and respond to customer emails. The system also implements RAG (Retrieval-Augmented Generation) technology to deliver accurate responses to any business or product-related questions.
- Continuously monitors the agency's Gmail inbox
- Categorizes emails into 'customer complaint,' 'product inquiry,' 'customer feedback,' or 'unrelated'
- Automatically handles irrelevant emails to maintain efficiency
- Quickly drafts emails for customer complaints and feedback using Langgraph
- Utilizes RAG techniques to answer product-related questions accurately
- Creates personalized email content tailored to each customer's needs
- Automatically checks email quality, formatting, and relevance
- Ensures every response meets high standards before reaching the client
- Employs Langchain/Langgraph to manage the workflow of the AI agents and LLMs
- Utilizes multiple AI agents working in tandem to process various types of emails
- Email Monitoring: The system constantly checks for new emails in the agency's Gmail inbox using the Gmail API.
- Email Categorization: AI agents sort each email into predefined categories.
- Response Generation:
- For complaints or feedback: The system quickly drafts a tailored email response.
- For product questions: The system uses RAG to retrieve accurate information from agency documents and generates a response.
- Quality Assurance: Each draft email undergoes AI quality and formatting checks.
- Sending: Approved emails are sent to the client promptly, ensuring timely communication.
- Time Efficiency: Significantly reduces time spent on email management.
- Enhanced Accuracy: Improves the precision and relevance of email responses through AI and RAG.
- Consistency: Provides a uniform experience across all customer communications.
- Improved Focus: Allows support teams to concentrate on complex issues rather than routine email tasks.
This is the detailed flow of the system:
- Python 3.7+
- Groq api key
- Gmail API credentials
- Necessary Python libraries (listed in
requirements.txt
)
-
Clone the repository:
git clone https://github.com/kaymen99/langgraph-email-automation.git cd langgraph-email-automation
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set up environment variables:
Create a
.env
file in the root directory of the project and add your GMAIL address, as we are using llama3-70b with Groq you must also get an API key to access it:MY_EMAIL=your_email@gmail.com GROQ_API_KEY=your_groq_api_key
-
Ensure Gmail API is enabled:
Follow this guide to enable Gmail API and obtain your credentials.
-
Start the workflow:
python main.py
The application will start checking for new emails, categorizing them, synthesizing queries, drafting responses, and verifying email quality.
You can customize the behavior of each agent by modifying the corresponding methods in the Nodes
class or the agents prompt prompts
located in the src
directory.
You can also add your own agency data into the data
folder, then you must create your own vector store by running (update first the data path):
python create_index.py
Contributions are welcome! Please open an issue or submit a pull request for any changes.
If you have any questions or suggestions, feel free to contact me at aymenMir1001@gmail.com
.