AI Email Auto-Responder Agent with Knowledge Base
Integrates with:
Overview
Unlock Intelligent Email Automation with this AI Agent
This n8n workflow acts as a sophisticated AI agent for managing your email inbox. It automatically fetches new emails, uses DeepSeek (via OpenRouter) to generate concise summaries, and then employs OpenAI (gpt-4o-mini) to classify the email's intent. For specific inquiries, like company information requests, it taps into a Qdrant vector store—your custom knowledge base populated from Google Drive documents—to draft an informed reply using an OpenAI-powered agent. Before sending, the draft undergoes an AI review (DeepSeek) to ensure quality and adherence to your guidelines. This powerful automation frees up your time by handling routine email communications effectively.
Key Features & Benefits
- AI-Driven Email Processing: Automates receiving, understanding, and responding to emails.
- Multi-LLM Strategy: Leverages DeepSeek for summarization/review and OpenAI for classification/drafting, optimizing for task-specific strengths.
- RAG Powered Responses: Integrates with a Qdrant knowledge base (Retrieval Augmented Generation) built from your Google Drive files for context-aware answers.
- Automated Knowledge Base Management: Includes steps to easily create and refresh your vector store from Google Drive documents.
- Intelligent Classification & Routing: Directs emails based on AI-identified intent, ensuring the agent only handles relevant queries.
- AI-Assisted Drafting & Review: Generates professional, concise replies (under 100 words) and refines them before sending.
- End-to-End Workflow: Manages the entire lifecycle from email trigger (IMAP) to response (SMTP).
Use Cases
- Automated first-line support for common questions about company services or products.
- Instantly replying to information requests using a dynamically updated knowledge base.
- Filtering and pre-processing emails before escalating to human agents.
- Maintaining consistent and accurate email communication 24/7 for solopreneurs and small teams.
Prerequisites
- An n8n instance (Cloud or self-hosted).
- Credentials for your email account (IMAP for receiving, SMTP for sending).
- OpenAI API Key (models like gpt-4o-mini and text embedding models are used).
- OpenRouter API Key (for accessing DeepSeek or other LLMs).
- Access to a Qdrant instance (URL and API Key if secured).
- Google Drive account with a folder containing your knowledge base documents (text, markdown, etc.).
Setup Instructions
- Import the workflow JSON into your n8n instance. Knowledge Base Setup (Run manually first, then to update):
- In the 'Create collection' and 'Refresh collection' HTTP Request nodes: update
QDRANTURL
to your Qdrant instance URL andCOLLECTION
to your chosen collection name. Configure Qdrant API credentials if needed. - In the 'Qdrant Vector Store1' (insert mode) and 'Qdrant Vector Store' (retrieve mode) nodes: configure Qdrant credentials and ensure the
COLLECTION
parameter matches step 2. - Configure the 'Get folder' Google Drive node: set up credentials and specify the
folderId
of your Google Drive folder containing knowledge documents. - In 'Embeddings OpenAI1' and 'Embeddings OpenAI' nodes: configure your OpenAI API Key credentials.
- Execute the flow branch starting with 'When clicking ‘Test workflow’' (or 'Create collection' / 'Refresh collection') to initialize or update your Qdrant knowledge base from Google Drive. Email Auto-Responder Configuration:
- 'Email Trigger (IMAP)' node: configure your IMAP server details and credentials.
- 'DeepSeek R1' & 'DeepSeek' nodes (Langchain LM Chat OpenAI type): configure OpenRouter API Key credentials and select your desired DeepSeek model.
- 'OpenAI 4-o-mini' & 'OpenAI' nodes (Langchain LM Chat OpenAI type): configure OpenAI API Key credentials and select models (e.g., gpt-4o-mini).
- 'Email Classifier' node: customize the
categories
to suit your needs. - Review and tailor the system prompts within the 'Write email' (Agent) and 'Review email' (ChainLLM) nodes for your desired response style.
- 'Send Email' node: configure your SMTP server details and credentials.
- Activate the main workflow (branch starting with 'Email Trigger (IMAP)').
Want your own unique AI agent?
Talk to us - we know how to build custom AI agents for your specific needs.
Schedule a Consultation