Slack Knowledge Base Chatbot using RAG and Claude - n8n Workflow

Build a powerful Slack AI Chatbot n8n workflow using RAG, Qdrant, Google Drive, and Anthropic Claude 3.7. Automate internal queries instantly with this high-density n8n template.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

HR and Operations Managers: Seeking to reduce repetitive questions about policies and procedures.
Developers and n8n specialists: Looking for advanced n8n templates integrating LangChain components (Agents, RAG, Memory).
Technical Teams: Utilizing Qdrant for vector storage and requiring a robust, customized n8n node setup for their internal AI tools.
Companies using Slack and Google Drive: Who need to leverage their existing documentation for immediate query resolution.

Overview

This robust n8n workflow solves the problem of dispersed corporate knowledge by integrating a custom AI agent directly into Slack. Leveraging the Retrieval Augmented Generation (RAG) pattern, the chatbot uses Qdrant as its vector database, populated with documents sourced from Google Drive. When an employee mentions the bot on Slack, the n8n trigger captures the query. The AI Agent, powered by Anthropic's Claude 3.7 Sonnet and equipped with Simple Memory for contextual conversations, uses the RAG tool to search and retrieve the most relevant document chunks from Qdrant. This ensures answers are accurate, grounded in company documentation, and formatted appropriately for Slack. This specific n8n workflow provides an immediate, efficient, and accurate alternative to manual document searching, significantly boosting team productivity and showcasing a powerful use case for n8n.

How it Works

This comprehensive n8n workflow operates in two main phases: Document Indexing and Live Chat Interaction.

Phase 1: Document Indexing (RAG Setup)


  1. A Manual n8n trigger initiates the process for updating the knowledge base.

  2. The workflow uses HTTP Request n8n node steps to create and subsequently clear the designated Qdrant collection, ensuring data freshness.

  3. The Google Drive n8n node retrieves files from a specified folder.

  4. These files are downloaded, loaded via the Default Data Loader n8n node, and chunked using the Token Splitter n8n node.

  5. The chunks are then vectorized using OpenAI Embeddings and inserted into Qdrant via the Qdrant Vector Store n8n node, successfully building the RAG knowledge base for this n8n template.

Phase 2: Live Chat Interaction


  1. The Get message Slack n8n trigger activates when the bot is mentioned in a channel (app_mention).

  2. The incoming message is passed to the AI Agent n8n node.

  3. The Agent uses the Anthropic Chat Model (Claude 3.7 Sonnet) for reasoning. It also accesses the Simple Memory n8n node to maintain conversation history (context window length of 10).

  4. If the query requires external knowledge, the Agent calls the RAG tool (Qdrant Vector Store in retrieve-as-tool mode). This n8n node tool searches the Qdrant index, retrieves relevant document excerpts, and feeds them back to the LLM.

  5. The Agent generates a precise, cited response based on the retrieved information and the detailed system prompt.

  6. Finally, the Send message Slack n8n node posts the formatted reply back to the original channel thread, completing the powerful n8n workflow.

Installation Guide


  1. Import the n8n template: Copy the provided JSON and import it into your n8n instance.

  2. Credentials Setup: You must configure credentials for the following services:

Slack: A Slack Bot Token with necessary scopes (refer to the Sticky Note in the n8n workflow for required permissions: app_mention, chat:write, etc.).
Anthropic: For the Anthropic Chat Model (Claude 3.7 Sonnet).
OpenAI: For the Embeddings OpenAI n8n node (used for generating vector embeddings).
Google Drive: For indexing company documents.
* Qdrant: Configure the Qdrant API URL and Key (using HTTP Header Auth).

  1. Indexing Configuration: Locate the Indexing flow (starting with the Manual n8n trigger) and update the Qdrant HTTP Request n8n nodes (Create collection, Refresh collection) with your actual QDRANTURL and COLLECTION name. Update the Get folder n8n node to point to the specific Google Drive folder ID. Run the Indexing flow once using the Manual n8n trigger to vectorize your data.

  2. Live Workflow Activation: Update the RAG Qdrant n8n node with the correct COLLECTION ID. Activate the Get message Slack n8n trigger to start monitoring app mentions.

Node Details

This sophisticated n8n workflow template uses several key n8n node types:

Get message (Slack Trigger n8n trigger):
Function: Starts the n8n workflow upon a Slack mention, initiating the chat interaction.
Key Configuration: Trigger set to appmention.
AI Agent (LangChain Agent n8n node):
Function: The central orchestration point. It processes the query, decides whether to use RAG or Calculator tools, manages memory, and crafts the final response using the LLM. This crucial n8n node defines the chatbot's behavior.
Key Configuration: Connected to Anthropic Chat Model, Simple Memory, and both RAG/Calculator tools. The system message enforces a RAG-specific persona and source citation requirements.
RAG (Qdrant Vector Store n8n node):
Function: Acts as a specialized tool for the AI Agent to perform vector searches against the corporate knowledge base, providing Retrieval Augmented Generation capabilities to the n8n workflow.
Key Configuration: Mode is retrieve-as-tool, configured with the tool name companyinfo.
Simple Memory (Memory Buffer Window n8n node):
Function: Stores the last 10 turns of conversation, ensuring the Agent maintains conversational context across multiple Slack messages.
Key Configuration: Session Key is dynamically generated based on Slack channel and user ID.
Download Files (Google Drive n8n node):
Function: Used during indexing to fetch documents from Google Drive and convert them to text/plain for vectorization.
Qdrant Vector Store1 (Qdrant Vector Store n8n node):
Function: Used exclusively in the indexing flow (mode: insert) to upload vectorized document chunks, created using an Embeddings OpenAI n8n node, into the Qdrant database.
Send message (Slack n8n node):
Function: Sends the final, generated response from the AI Agent back to Slack, ensuring the reply is correctly placed within the original thread.

Related n8n Workflows

Free

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

Full-stack Web Developer based in Italy specialising in Marketing & AI-powered automations. For business enquiries, send me an email at [email protected] or add me on Linkedin.com/in/davideboizza

Featured*