A Streamlit application that automatically processes and generates responses to customer emails using AI. The app uses LangChain and Groq for natural language processing and understanding.
- Email Categorization: Automatically categorizes emails into specific categories like price inquiries, customer complaints, product inquiries, customer feedback, and off-topic emails.
- Automatic Research: Performs web searches for complex queries or specific product details using the Tavily API.
- Professional Response Generation: Generates tailored, professional email responses using the Groq API.
- Streamlit Interface: A user-friendly web interface to input email content, view categorization, see research, and generate responses in real-time.
src/
: Contains the main application codechains.py
: Logic for categorizing emails, conducting research, and generating responses.config.py
: Configuration and environment variable loading.processors.py
: Functions for processing emails, performing research, and drafting responses.prompts.py
: Templates used for AI prompt generation.state.py
: State management for the email processing workflow.workflow.py
: Defines the workflow using state graphs for processing emails.
utils/
: Utility functions for file operations and other helper tasks.outputs/
: Stores generated response files like email drafts and research info..env
: Environment variables for API keys (Groq, Tavily).
-
Clone the repository
git clone https://github.com/Bhavik-Jikadara/AI-Email-Reply-Agent.git cd AI-Email-Reply-Agent
-
Create a virtualenv (windows user)
pip install virtualenv virtualenv venv # windows users source venv/Scripts/activate # mac users source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Create a .env file with your API keys:
GROQ_API_KEY=your_groq_api_key TAVILY_API_KEY=your_tavily_api_key
-
Run the Streamlit app:
streamlit run app.py
- Open the Streamlit app in your browser
- Enter the email content in the text area
- Click "Generate Response"
- View the generated professional response