AutomationMart
Home/Browse/Retrieve and answer Gmail email queries with Llama 3.2, mxbai-embed, and Qdrant
n8n

Retrieve and answer Gmail email queries with Llama 3.2, mxbai-embed, and Qdrant

n8nn8n21 modulesv1.0
GmailSlackOpenAIGoogle DriveZendeskIntercomOutlookGemini

Self-Hosted This workflow provides a complete end-to-end system for automatically managing your inbox by reading incoming questions, matching them to approved guidelines, and sending consistent, 24/7 replies. By combining local AI processing with an automated retrieval-augmented generation (RAG) pipeline, it ensures fast resolution times without compromising data privacy or incurring ongoing AI API costs. Who is this for? This is designed for University Admissions, Student Support Teams, Custome

At a glance

Retrieve and answer Gmail email queries with Llama 3.2, mxbai-embed, and Qdrant is a ready-made n8n workflow you import as a workflow JSON file โ€” no build required. It connects Gmail, Slack, OpenAI, Google Drive. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
Gmail, Slack, OpenAI, Google Drive, Zendesk, Intercom
Modules
21
Price
Free
Version
v1.0
Retrieve and answer Gmail email queries with Llama 3.2, mxbai-embed, and Qdrant workflow diagram

About this workflow

Self-Hosted This workflow provides a complete end-to-end system for automatically managing your inbox by reading incoming questions, matching them to approved guidelines, and sending consistent, 24/7 replies. By combining local AI processing with an automated retrieval-augmented generation (RAG) pipeline, it ensures fast resolution times without compromising data privacy or incurring ongoing AI API costs. Who is this for? This is designed for University Admissions, Student Support Teams, Customer Service Staff, or professionals in any industry who are overwhelmed by their inboxes and spend countless hours answering repetitive questions. It is particularly useful for any organization looking to automate routine FAQs across various fields, maintaining personalized, human-like, and threaded email conversations while keeping data completely in-house. ๐Ÿ› ๏ธ Tech Stack - n8n: For workflow orchestration of both the ingestion pipeline and response automation. - Docker & Docker Compose: For containerizing and orchestrating the n8n and Qdrant services locally. - Google Drive: To host and trigger updates from the approved FAQ knowledge base. - Gmail: For real-time incoming email triggers and threaded outbound replies. - Qdrant: For self-hosted vector database storage and similarity matching. - LM Studio: To host the local AI models via an OpenAI-compatible API for two primary tasks: - Embedding Generation: Uses the mxbai-embed-large-v1 model to convert FAQ data and incoming questions into high-dimensional vectors for semantic matching. - Response Generation: Uses the llama-3.2-3b-instruct model to process the retrieved context and craft a polite, personalized HTML email reply. โœจ How it works 1. Knowledge Base Ingestion: The workflow automatically detects updates to a specific FAQ JSON file in Google Drive, converts the Q&A pairs into vector embeddings using the local mxbai model, and stores them in Qdrant. 2. Email Trigger: The resolution pipeline kicks off instantly when a new incoming email arrives via the Gmail trigger. 3. Semantic Search: The incoming question is converted to an embedding using the mxbai-embed-large-v1 model and checked against the Qdrant database to retrieve the top 3 most relevant FAQ answers, enforcing a minimum 0.7 similarity threshold for quality control. 4. LLM Response Generation: The OpenAI node (pointing to LM Studio) processes the retrieved context and the student's email using the llama-3.2-3b-instruct model to craft a polite, personalized HTML email response. 5. Threaded Reply: The Gmail node sends the generated response directly back into the original email thread, exactly like a human would. ๐Ÿ“‹ Requirements - Docker and Docker Compose installed to run n8n and Qdrant locally. - LM Studio running a local server on port 1234. - mxbai-embed-large-v1 (GGUF) and llama-3.2-3b-instruct (GGUF) models loaded in LM Studio. - Google Cloud Console account with Gmail and Google Drive APIs enabled. - An FAQ JSON file properly formatted and hosted in Google Drive. ๐Ÿš€ How to set up 1. Prepare your Local AI: - Open LM Studio, download both the embedding and LLM models. - Start the Local Server on port 1234. - Note your machine's local IP address (e.g., 192.168.1.50). 2. Spin up Services: - Clone the repository and configure the .env file with your QDRANTCOLLECTION name. - Run docker compose up -d to start the n8n and Qdrant containers. 3. Import the Workflow: - Open n8n at and import the provided JSON workflow file. 4. Link Services: - Update the Google Drive nodes with the File ID of your FAQ JSON document. - Update the embedding and AI nodes with your local IP address in the Base URL. 5. Test and Activate: - Execute the ingestion pipeline manually to populate Qdrant. - Toggle the workflow to Active. - Send a test email to your connected Gmail address to verify the automated reply. ๐Ÿ”‘ Credential Setup To run this workflow, you must configure the following credentials in n8n: - Google (Gmail & Drive): - Create new Gmail OAuth2 API and Google Drive OAuth2 API credentials. - Enter your Client ID and Client Secret obtained from the Google Cloud Console (the same credentials can be used for both). - Qdrant API: - Create a new Qdrant API credential. - REST URL: Set this to - Leave the API key blank for the self-hosted Docker setup. - OpenAI API (Local): - Create a new OpenAI API credential for connecting to LM Studio. - API Key: Enter any placeholder text (e.g., lm-studio). - Base URL: Set this to your machine's local IP address (e.g., to ensure n8n can connect to the local AI server from within the Docker network. โš™๏ธ How to customize - Refine Response Tone: Update the System Message in the AI node to change the personality, signature, or formatting rules of the generated email reply. - Switch to Cloud AI: If you prefer not to host models locally, swap out the local LM Studio connection for external APIs like OpenAI (GPT-4o), Anthropic (Claude), or Cohere for both embeddings and text generation. - Change Embedding Models: While the workflow uses a local model by default, anyone can easily swap the embedding nodes to use alternative models like OpenAI (text-embedding-3-small) or Google Gemini (text-embedding-004) if desired. - Adjust Similarity Threshold: Modify the semantic search threshold (default 0.7) in the Qdrant node to be stricter or more lenient depending on your knowledge base accuracy. - Alternative Triggers & Channels: Replace the Gmail nodes with Outlook / Microsoft 365, Zendesk, Intercom, or Slack to resolve queries across different communication platforms.

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n โ†’ click the menu โ†’ Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

AI-powered multi-platform assistant with Google Suite, LinkedIn & Twitter

MCP Personal Assistant Workflow Description This workflow integrates multiple productivity tools into a single AI-powered assistant using n8n, acting as a centralized control hub to receive and execute tasks across Google Calendar, Gmail, Google Drive, LinkedIn, Twitter, and more. --- โœ… Key Capabilities - AI Agent + Tool Use: Built using n8n's AI Agent and MCP system, enabling intelligent multi-step reasoning. - Tool Integration: - Google Calendar: schedule, update, delete events - Gmail: sea

Free

AI-powered WhatsApp customer support for Shopify brands with LLM agents

AI-Powered WhatsApp Customer Support for Shopify Brands This n8n template builds a WhatsApp support copilot that answers order status and product availability from Shopify using LLM "agents," then replies to the customer in WhatsApp or routes to human support. ------------------------------------------------------------------------ Use cases - "Where is my order?" โ†’ live status + tracking link - "What are your best-selling T-shirts?" โ†’ in-stock sizes & variants - Greetings / small talk โ†’ welcome

Free

Analyze Telegram messages with OpenAI and send notifications via Gmail & Telegram

AI-powered Telegram message analysis with multi-tool notifications (Gmail, Telegram) This workflow triggers on Telegram updates, analyzes messages with an AI Agent using MCP tools, and sends notifications via Gmail and Telegram. Detailed Description Who is this for? This template is for teams, businesses, or individuals using Telegram for communication who need automated, AI-driven insights and notifications. Itโ€™s ideal for customer support teams, project managers, or tech enthusiasts wanting

Free

Send Gmail messages when a HERE Tracking IoT device is below/above range

Every time a HERE Tracking indicator reaches the specified range, Make will automatically post a message via Gmail.

Free

Sending messages from GREEN-API for WhatsApp to Slack

Full article: https://green-api.com/en/docs/integration/make/slack/ In this template, we'll resend messages from WhatsApp to private channel in Slack. You'll need GREEN-API instance https://green-api.com/ and OpenAI API key and Slack account https://slack.com/.

Free

Automated content generation & publishing - Wordpress

Workflow Description: Automated Content Publishing for WordPress This n8n workflow automates the entire process of content generation, image selection, and scheduled publishing to a self-hosted WordPress website. It is designed for bloggers, marketers, and businesses who want to streamline their content creation and posting workflow. --- ๐ŸŒŸ Features โœ… AI-Powered Content Generation - Uses ChatGPT to generate engaging, market-ready blog articles - Dynami

Free

Build lists of profiles from any platform using Airtop and Google Sheets

About The List Building Automation This automation will guide you on how to automate list building using Airtop. Youโ€™ll have a streamlined workflow that can reduce your research time by up to 90% while improving the accuracy of your target lists. How to automate list building It can be challenging to spend too much time on tasks like compiling lists of potential investors, customers, job candidates, industry influencers, or key decision-makers. Verifying contact details often requires significan

Free

Generate sales emails based on business events with Explorium MCP & Slack

Explorium Event-Triggered Outreach This n8n and agent-based workflow automates outbound prospecting by monitoring Explorium event data (e.g. product launches, new office opening, new investment and more), researching companies, identifying key contacts, and generating tailored sales emails leveraging the Explorium MCP server. Template Workflow Overview Node 1: Webhook Trigger Purpose: Listens for real-time product launch events pushed from Explorium's webhook system. How it works: Explorium sen

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint โ€” instant download
  • Setup guide PDF included
  • 5 downloads ยท valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

โ‚น2,499/ session
3 hrs ยท video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free