Skip to main content

Build document RAG system with Kimi-K2, Gemini embeddings and Qdrant

Workflow preview

Workflow preview
100%
Build document RAG system with Kimi-K2, Gemini embeddings and Qdrant preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Generating contextual summaries is an token int...

Best for

  • Document Extraction automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-featherless.featherless, n8n-nodes-base.manualtrigger, n8n-nodes-base.extractfromfile, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.splitout, n8n-nodes-base.stickynote, n8n-nodes-qdrant.qdrant

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Build document RAG system with Kimi-K2, Gemini embeddings and Qdrant
Workflow name
Build document RAG system with Kimi-K2, Gemini embeddings and Qdrant

Generating contextual summaries is an token-intensive approach for RAG embeddings which can quickly rack up costs if your inference provider charges by token usage.

Featherless.ai is an inference provider with a different pricing model - they charge a flat subscription fee (starting from $10) and allows for unlimited token usage instead. If you're typically spending over $10 - $25 a month, you may find Featherless to be a cheaper and more manageable option for your projects or team.

For this template, Featherless's unlimited token usage is well suited for generating contextual summaries at high volumes for a majority of RAG workloads.

LLM: moonshotai/Kimi-K2-Instruct Embeddings: models/gemini-embedding-001

How it works

  1. A large document is imported into the workflow using the HTTP node and its text extracted via the Extract from file node. For this demonstration, the UK highway code is used an an example.
  2. Each page is processed individually and a contextual summary is generated for it. The contextual summary generation involves taking the current page, preceding and following pages together and summarising the contents of the current page.
  3. This summary is then converted to embeddings using Gemini-embedding-001 model. Note, we're using a http request to use the Gemini embedding API as at time of writing, n8n does not support the new API's schema.
  4. These embeddings are then stored in a Qdrant collection which can then be retrieved via an agent/MCP server or another workflow.

How to use

  • Replace the large document import with your own source of documents such as google drive or an internal repo.
  • Replace the manual trigger if you want the workflow to run as soon as documents become available. If you're using Google Drive, check out my Push notifications for Google Drive template.
  • Expand and/or tune embedding strategies to suit your data. You may want to additionally embed the content itself and perform multi-stage queries using both.

Requirements

  • Featherless.ai Account and API Key
  • Gemini Account and API Key for Embeddings
  • Qdrant Vector store

Customising this workflow

  • Sparse Vectors were not included in this template due to scope but should be the next step to getting the most our of contextual retrieval.
  • Be sure to explore other models on the Featherless.ai platform or host your own custom/finetuned models.

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 - Kimi-K2 via Featherless.ai

Type / Role
n8n-nodes-featherless.featherless - featherless
Config choices
Version 1

Block 2 - When clicking ‘Execute workflow’

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

Block 3 - Extract from File

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

Block 4 - Get Response

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 5 - Download Large Document

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 6 - Split Pages

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

Block 7 - Sticky Note

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

Block 8 - Sticky Note1

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

Block 9 - Retrieval Vectors with Gemini Embeddings 001

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 10 - Add Docs To Qdrant Vector Store

Type / Role
n8n-nodes-qdrant.qdrant - qdrant
Config choices
Version 1

Block 11 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 12 - Chunk Ref

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

Block 13 - Create Collection

Type / Role
n8n-nodes-qdrant.qdrant - qdrant
Config choices
Version 1

Block 14 - Create Summary Index

Type / Role
n8n-nodes-qdrant.qdrant - qdrant
Config choices
Version 1

Block 15 - When chat message received

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

Block 16 - Subworkflow Trigger

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 17 - Google Gemini Chat Model1

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

Block 18 - Highway Code Manual1

Type / Role
@n8n/n8n-nodes-langchain.toolWorkflow - toolWorkflow
Config choices
Version 2.2

Block 19 - Highway Code Manual

Type / Role
@n8n/n8n-nodes-langchain.toolWorkflow - toolWorkflow
Config choices
Version 2.2

Block 20 - Highway Code MCP Server

Type / Role
@n8n/n8n-nodes-langchain.mcpTrigger - mcpTrigger
Config choices
Version 2

Block 21 - Highway Code Expert

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.1

Block 22 - Retrieval Vectors with Gemini-Embeddings-001

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 23 - Test Questions

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 24 - Split Out

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

Showing the first 24 of 35 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Build document RAG system with Kimi-K2, Gemini embeddings and Qdrant
Complexity advanced
Nodes 35
Categories Document Extraction, AI RAG
Author Jimleuk
Published 28 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6574/6574.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 Build document RAG system with Kimi-K2, Gemini embeddings and Qdrant do?

Generating contextual summaries is an token int...

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 Document Extraction, AI RAG use case.