Skip to main content

Basic RAG chat

Workflow preview

Workflow preview
100%
Basic RAG chat preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow demonstrates a simple Retrieval Augmented Generation (RAG) pipeline in n8n, split into two main sections: Part 1: Load Data into Vector Store Reads files from disk (or Google Drive...

Best for

  • Internal Wiki automation workflows
  • AI RAG automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.textsplitterrecursivecharactertextsplitter, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.chainretrievalqa, @n8n/n8n-nodes-langchain.retrievervectorstore, n8n-nodes-base.manualtrigger, @n8n/n8n-nodes-langchain.chattrigger, n8n-nodes-base.readwritefile

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by JustinLee.

Original n8n.io source

1.1 Workflow description

Title
Basic RAG chat
Workflow name
Basic RAG chat

This workflow demonstrates a simple Retrieval-Augmented Generation (RAG) pipeline in n8n, split into two main sections:

🔹 Part 1: Load Data into Vector Store Reads files from disk (or Google Drive).

Splits content into manageable chunks using a recursive text splitter.

Generates embeddings using the Cohere Embedding API.

Stores the vectors into an In-Memory Vector Store (for simplicity; can be replaced with Pinecone, Qdrant, etc.).

🔹 Part 2: Chat with the Vector Store Takes user input from a chat UI or trigger node.

Embeds the query using the same Cohere embedding model.

Retrieves similar chunks from the vector store via similarity search.

Uses Groq-hosted LLM to generate a final answer based on the context.

🛠️ Technologies Used: 📦 Cohere Embedding API

⚡ Groq LLM for fast inference

🧠 n8n for orchestrating and visualizing the flow

🧲 In-Memory Vector Store (for prototyping)

🧪 Usage: Upload or point to your source documents.

Embed them and populate the vector store.

Ask questions through the chat trigger node.

Receive context-aware responses based on retrieved content.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Recursive Character Text Splitter

Type / Role
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - textSplitterRecursiveCharacterTextSplitter
Config choices
Version 1

Block 2 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Default Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1

Block 5 - Question and Answer Chain

Type / Role
@n8n/n8n-nodes-langchain.chainRetrievalQa - chainRetrievalQa
Config choices
Version 1.2

Block 6 - Vector Store Retriever

Type / Role
@n8n/n8n-nodes-langchain.retrieverVectorStore - retrieverVectorStore
Config choices
Version 1

Block 7 - When clicking 'Test Workflow' button

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 8 - When clicking 'Chat' button below

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1

Block 9 - Read/Write Files from Disk

Type / Role
n8n-nodes-base.readWriteFile - readWriteFile
Config choices
Version 1

Block 10 - In-Memory Vector Store1

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreInMemory - vectorStoreInMemory
Config choices
Version 1

Block 11 - In-Memory Vector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreInMemory - vectorStoreInMemory
Config choices
Version 1

Block 12 - Embeddings Cohere

Type / Role
@n8n/n8n-nodes-langchain.embeddingsCohere - embeddingsCohere
Config choices
Version 1

Block 13 - Groq Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGroq - lmChatGroq
Config choices
Version 1

Block 14 - Embeddings Cohere1

Type / Role
@n8n/n8n-nodes-langchain.embeddingsCohere - embeddingsCohere
Config choices
Version 1

3. Summary Table

Workflow Basic RAG chat
Complexity intermediate
Nodes 14
Categories Internal Wiki, AI RAG
Author JustinLee
Published 18 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5028/5028.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Basic RAG chat do?

This workflow demonstrates a simple Retrieval Augmented Generation (RAG) pipeline in n8n, split into two main sections: Part 1: Load Data into Vector Store Reads files from disk (or Google Drive...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Internal Wiki, AI RAG use case.