Ultimate Multi-AI WhatsApp Assistant with RAG Memory and Productivity Tools - n8n Workflow

Build an intelligent WhatsApp assistant using this complex n8n workflow. Integrate RAG memory (MongoDB), Google Suite, research tools, and AI image generation in one powerful n8n automation.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Advanced n8n Users: Individuals familiar with creating complex n8n templates and managing multiple AI and productivity integrations. Developers & Integrators: Those looking to deploy a high-performance, multi-functional chatbot using an n8n workflow. Productivity Enthusiasts: Users wanting to manage their Google Calendar, Google Tasks, and Gmail directly through a conversational interface like WhatsApp. AI Specialists: Anyone interested in deploying a sophisticated RAG (Retrieval-Augmented Generation) system integrated with a practical n8n trigger for real-time interaction.

Overview

This comprehensive n8n workflow transforms a standard WhatsApp channel into a highly sophisticated, multi-purpose AI assistant. It solves the fragmentation problem by centralizing communication, scheduling, research, and creative tasks into a single chat interface. Utilizing the power of LangChain agents within the n8n node ecosystem, the assistant dynamically decides whether to answer directly, analyze an image, search the web using tools like Brave Search and Wikipedia, or manage personal data via Google Calendar and Google Tasks. Crucially, this n8n automation features robust long-term memory (RAG via MongoDB Atlas), ensuring context and personalization are maintained across sessions, making it one of the most powerful n8n templates available for conversational AI.

How it Works

The entire process begins with the WhatsApp Trigger, which activates the primary n8n workflow upon receiving a message.


  1. Incoming Message Handling: The WhatsApp trigger captures the message. A subsequent Switch n8n node determines if the input is plain text or an image. If it's an image, the media is downloaded, passed to a Google Gemini n8n node for visual analysis, and the resulting text description is captured. If it’s text, a 'Typing....' HTTP node sends an immediate response indicator to the user.

  2. Core AI Orchestration: The normalized input proceeds to the main AI Agent1 n8n node. This agent operates with complex instructions, utilizes a Simple Memory buffer for short-term context, and queries the MongoDB Atlas Vector Store (RAG) for long-term memory retrieval.

  3. Tool Routing: Based on the user's intent, the AI Agent dynamically selects a specialized tool: Productivity: Routes scheduling and task requests to the Calendar Agent and Task agent (which manage Google Calendar and Google Tasks via various n8n nodes). Research: Routes factual queries to the Research agent, which intelligently queries Brave Search, Wikipedia, and other search endpoints.

* Image Creation: Triggers an internal image creation webhook, delegating the request to the dedicated Image Generation Sub-Workflow.

  1. Response and Memory Update: The AI Agent generates the final response, which is sent back to the user via a WhatsApp n8n node. Simultaneously, the conversation turn is sent to the Memory Webhook Sub-Workflow for long-term context extraction and storage.

  2. Memory Sub-Workflow: The conversation is analyzed by an LLM Chain to Extract Memory Info. If important context is identified (not 'nothing'), the data is prepared (Edit Fields1) and inserted into the MongoDB Vector Store using an embedding n8n node for future retrieval.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the provided JSON code and import it directly into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. WhatsApp Trigger Setup: Configure the initial WhatsApp Trigger node. This n8n trigger requires a Meta/WhatsApp Business API account setup and the corresponding OAuth credentials.

  3. Credential Configuration: You must configure credentials for all integrated services in the respective n8n node settings: AI Services: Google Gemini (for analysis), OpenRouter/Vercel/Groq (for LLMs), and Together.ai (for image generation) API keys.

Databases/RAG: MongoDB Atlas account details for the Vector Store nodes, including the specific collection and vector index names.
Productivity Tools: OAuth credentials for Google Calendar, Google Tasks, and Gmail are required for the respective n8n node tools.
Research Tools: API keys for Brave Search and the custom Perplexity/Tavily HTTP endpoints.

  1. Webhooks: Ensure the internal webhooks used for memory storage (Webhook2) and image generation (Webhook3) are active and accessible within your n8n setup. The main AI Agent n8n node needs the correct webhook URLs for these tools.

Node Details

WhatsApp Trigger: The primary n8n trigger, initiating the workflow upon receiving a WhatsApp message (text or image).
Switch: Routes the input flow based on message type (text or image) to ensure proper pre-processing.
Analyze image (Google Gemini): An n8n node that uses a multimodal model to analyze images downloaded from WhatsApp, converting visual data into descriptive text for the agent.
AI Agent1: The core execution engine. It manages conversational flow, accesses short-term memory (Simple Memory), performs RAG lookup (MongoDB Atlas Vector Store2), and intelligently routes requests to specialized sub-agents and tools (e.g., Research agent, Calendar Agent).
Research agent: A dedicated LangChain agent n8n node that orchestrates searches across external tools like Brave Search, Wikipedia, and Tavily web search to provide real-time information.
Calendar Agent / Task agent: Specialized agents that utilize Google Calendar and Google Tasks n8n node operations (create, get, delete) to manage user productivity from within the chat.
MongoDB Atlas Vector Store (Insert/Retrieve): Used in two modes. Retrieval provides context to the main AI Agent, while Insert (in the Memory Sub-Workflow) permanently stores important conversation details after analysis by the Extract Memory Info n8n node (LLM Chain).
HTTP Request (Image Generation): Executes image generation via an external API (like Together.ai), triggered by the main AI Agent's image creation tool.


  • Code1 / Clean Prompt Text1: Code n8n nodes used for data transformation: standardizing input for the main agent and cleaning the generated prompt text for the image API.

Related n8n Workflows

Free

Nodes: 30 Nodes
Updated: December 26 2025
View all
Created by

🚀 Automation expert & AI enthusiast. I build custom n8n workflows, AI agents, API integrations, and smart automations using LLMs, databases, cloud tools & more. Skilled in Docker, MongoDB, Google Sheets, ACRCloud, and building fast, context-aware agents. Let's turn your idea into a powerful workflow!

Featured*