Build Document RAG System with Kimi-K2, Gemini Embeddings & Qdrant

This n8n workflow builds a Retrieval-Augmented Generation (RAG) system for large documents, generating contextual page summaries with Kimi-K2, embedding them via Gemini, and storing in Qdrant for efficient retrieval.

n8n
Build Document RAG System with Kimi-K2, Gemini Embeddings & Qdrant

This advanced n8n workflow constructs a complete RAG pipeline for processing large documents, such as the UK Highway Code or educational materials. It imports documents via HTTP, extracts text, and processes each page individually by generating contextual summaries using the surrounding pages (previous and next) with the Kimi-K2 Instruct LLM from Moonshot AI. This approach ensures summaries capture broader context, improving retrieval accuracy over raw text embeddings.

The workflow then converts these summaries into high-quality embeddings using Google's Gemini-embedding-001 model via a custom HTTP request (due to n8n compatibility). Finally, the embeddings are upserted into a Qdrant vector database collection, ready for querying by agents, MCP servers, or other workflows. Integration with Featherless.ai for inference allows unlimited token usage under a flat fee, making it cost-effective for high-volume summarization.

Benefits include reduced token costs for RAG prep, scalable handling of lengthy docs without truncation issues, and superior semantic search via contextual embeddings. Ideal for education (online courses, textbooks), compliance docs, manuals, or any knowledge base needing precise retrieval.

Use cases: Automate RAG for course platforms, legal/policy docs, technical guides; integrate with chatbots for contextual Q&A; preprocess corpora for AI agents.

$24.99
Last updated October 3, 2026
30-day money-back guarantee
Instant download
Lifetime updates included

New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.

Secure checkout powered by Stripe

Support

How to import this workflow into n8n

  1. 1Purchase or download the workflow to get the n8n workflow JSON file.
  2. 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
  3. 3Open each node marked with a credential warning and connect your own accounts and API keys.
  4. 4Run the workflow once manually to verify the data flow, then toggle it to Active.

Related Education workflows

More from Emil Volkov

Need this deployed? We'll set it up for you.

Our automation experts deploy this workflow in your stack, connect your accounts, and verify it works — or build a custom solution from scratch.