AI Email Responder with RAG & Human Approval
Integrates with:
Overview
Unlock intelligent email automation with this AI Agent
This workflow creates a powerful AI Email Responder. It monitors an inbox, summarizes new emails, and then uses a Retrieval-Augmented Generation (RAG) approach to draft accurate, context-aware responses. The agent queries your private knowledge base (powered by Qdrant and OpenAI embeddings) to find relevant information. Before any email is sent, the draft is routed to a human for a quick review. The agent understands the feedback ('approved' or 'needs changes') and either sends the email or revises it based on your instructions.
Key Features & Benefits
- Retrieval-Augmented Generation (RAG): Drafts replies using information from your own documents, ensuring brand consistency and accuracy.
- Automated Summarization: Quickly understands the context of incoming emails with an AI-powered summarization step.
- Human-in-the-Loop: Integrates a seamless approval workflow. Drafts are sent for review, and the agent acts on the feedback.
- Intelligent Feedback Processing: Uses an AI classifier to interpret review feedback (e.g., 'Looks good, send it' vs. 'Please rephrase this part').
- Knowledge Base Ingestion: Includes a setup flow to easily vectorize your documents from Google Drive and populate your knowledge base.
Use Cases
- Automating Level 1 customer support responses, using a knowledge base of product docs and FAQs.
- Handling inbound sales inquiries by providing instant, accurate information about services from marketing materials.
- Managing internal HR or IT helpdesk requests by drafting answers from company policy documents.
- Streamlining founder inboxes by drafting replies to common questions, freeing up time for high-value tasks.
Prerequisites
- An n8n instance (Cloud or self-hosted).
- OpenAI API Key (e.g., for gpt-4o-mini).
- Qdrant instance URL and API Key.
- Credentials for your trigger email account (IMAP).
- Gmail credentials for the approval and sending steps.
- Google Drive credentials for knowledge base ingestion.
Setup Instructions
- Import & Configure Credentials: Import the workflow and configure the credentials for OpenAI, Qdrant, IMAP, Gmail, and Google Drive in the Credentials section of your n8n instance.
- Setup Knowledge Base (One-Time):
- In the "Create collection" and "Refresh collection" HTTP nodes, replace
QDRANTURLandCOLLECTIONwith your Qdrant instance details. - In the "Get folder" node, point to the Google Drive folder containing your knowledge documents.
- Manually run the "When clicking ‘Test workflow’" trigger once to build your initial knowledge base.
- In the "Create collection" and "Refresh collection" HTTP nodes, replace
- Configure Main Flow:
- In the "Email Trigger (IMAP)" node, select your configured IMAP credential.
- In the "Qdrant Vector Store" tool node, set your Qdrant collection name.
- In the "Gmail" node (send for approval), set the
sendToemail address to your reviewer's email. - In the final "Send Email" node, configure your SMTP credential.
- Customize & Activate: Review the prompts in the AI Agent nodes ("Write email", "Email Reviewer") to match your desired tone and style. Activate the workflow.
Want your own unique AI agent?
Talk to us - we know how to build custom AI agents for your specific needs.
Request a Consultation