Skip to main content

Adaptive RAG with Google Gemini & Qdrant: context-aware query answering

Workflow preview

Workflow preview
100%
Adaptive RAG with Google Gemini & Qdrant: context-aware query answering preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Description This workflow automatically classifies user queries and retrieves the most relevant information based on the query type. It uses adaptive strategies like; Factual, Analytical, Opinio...

Best for

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

Tools used

@n8n/n8n-nodes-langchain.agent, n8n-nodes-base.switch, @n8n/n8n-nodes-langchain.chattrigger, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.lmchatgooglegemini, @n8n/n8n-nodes-langchain.memorybufferwindow, @n8n/n8n-nodes-langchain.embeddingsgooglegemini, n8n-nodes-base.stickynote

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Adaptive RAG with Google Gemini & Qdrant: context-aware query answering
Workflow name
Adaptive RAG with Google Gemini & Qdrant: context-aware query answering

Description This workflow automatically classifies user queries and retrieves the most relevant information based on the query type. 🌟 It uses adaptive strategies like; Factual, Analytical, Opinion, and Contextual to deliver more precise and meaningful responses by leveraging n8n's flexibility. Integrated with Qdrant vector store and Google Gemini, it processes each query faster and more effectively. πŸš€

How It Works? Query Reception: A user query is triggered (e.g., through a chatbot interface). πŸ’¬

Classification: The query is classified into one of four categories:

Factual: Queries seeking verifiable information.

Analytical: Queries that require in-depth analysis or explanation.

Opinion: Queries looking for different perspectives or subjective viewpoints.

Contextual: Queries specific to the user or certain contextual conditions.

Adaptive Strategy Application: Based on classification, the query is restructured using the relevant strategy for better results.

Response Generation**: The most relevant documents and context are used to generate a tailored response. 🎯

Set Up Steps

Estimated Time: ⏳ 10-15 minutes Prerequisites: You need an n8n account and a Qdrant vector store connection. Steps:

Import the n8n workflow: Load the workflow into your n8n instance.

Connect Google Gemini and Qdrant: Link these tools for query processing and data retrieval.

Connect the Trigger Interface: Integrate with a chatbot or API to trigger the workflow.

Customize: Adjust settings based on the query types you want to handle and the output format. πŸ”§

For more detailed instructions, please check the sticky notes inside the workflow. πŸ“Œ

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 - Query Classification

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

Block 2 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 3 - Factual Strategy - Focus on Precision

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

Block 4 - Analytical Strategy - Comprehensive Coverage

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

Block 5 - Opinion Strategy - Diverse Perspectives

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

Block 6 - Contextual Strategy - User Context Integration

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

Block 7 - Chat

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

Block 8 - Factual Prompt and Output

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

Block 9 - Contextual Prompt and Output

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

Block 10 - Opinion Prompt and Output

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

Block 11 - Analytical Prompt and Output

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

Block 12 - Gemini Classification

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

Block 13 - Gemini Factual

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

Block 14 - Gemini Analytical

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

Block 15 - Chat Buffer Memory Analytical

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 16 - Chat Buffer Memory Factual

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 17 - Gemini Opinion

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

Block 18 - Chat Buffer Memory Opinion

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 19 - Gemini Contextual

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

Block 20 - Chat Buffer Memory Contextual

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 21 - Embeddings

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

Block 22 - Sticky Note

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

Block 23 - Sticky Note1

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

Block 24 - Sticky Note2

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

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

3. Summary Table

Workflow Adaptive RAG with Google Gemini & Qdrant: context-aware query answering
Complexity advanced
Nodes 40
Categories Internal Wiki, AI RAG
Author Nisa
Published 14 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4043/4043.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 Adaptive RAG with Google Gemini & Qdrant: context-aware query answering do?

Description This workflow automatically classifies user queries and retrieves the most relevant information based on the query type. It uses adaptive strategies like; Factual, Analytical, Opinio...

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.