Adaptive RAG with Google Gemini & Qdrant: context-aware query answering
Needs changesWhat this workflow does
This AI workflow has 30 nodes and runs when another workflow calls it (plus 1 other trigger). Along the way it connects Google Gemini Chat Model, Embeddings Google Gemini and Qdrant Vector Store.
How it runs
Trigger: When another workflow calls it (plus 1 other trigger).
- Combined Fields (Edit Fields (Set)): sets 3 fields: user_query, chat_memory_key, vector_store_id
- Query Classification (AI Agent): runs an AI agent, with model: Gemini Classification
- Switch: routes items into 4 branches
- Factual Strategy - Focus on Precision (AI Agent): runs an AI agent, with model: Gemini Factual; memory: Chat Buffer Memory Factual
- Analytical Strategy - Comprehensive Coverage (AI Agent): runs an AI agent, with model: Gemini Analytical; memory: Chat Buffer Memory Analytical
- Opinion Strategy - Diverse Perspectives (AI Agent): runs an AI agent, with model: Gemini Opinion; memory: Chat Buffer Memory Opinion
- Contextual Strategy - User Context Integration (AI Agent): runs an AI agent, with model: Gemini Contextual; memory: Chat Buffer Memory Contextual
- Factual Prompt and Output (Edit Fields (Set)): sets 2 fields: output, prompt
- Analytical Prompt and Output (Edit Fields (Set)): sets 2 fields: output, prompt
- Opinion Prompt and Output (Edit Fields (Set)): sets 2 fields: output, prompt
…plus 6 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in Query Classification (v1.8), Factual Strategy - Focus on Precision (v1.7), Analytical Strategy - Comprehensive Coverage (v1.7)…: replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) Query Classification (v1.8), Factual Strategy - Focus on Precision (v1.7), Analytical Strategy - Comprehensive Coverage (v1.7), Opinion Strategy - Diverse Perspectives (v1.7), Contextual Strategy - User Context Integration (v1.7), Answer (v1.8) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (11)
- AI Agent
@n8n/n8n-nodes-langchain.agent - Switch
n8n-nodes-base.switch - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Edit Fields (Set)
n8n-nodes-base.set - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Embeddings Google Gemini
@n8n/n8n-nodes-langchain.embeddingsGoogleGemini - Summarize
n8n-nodes-base.summarize - Qdrant Vector Store
@n8n/n8n-nodes-langchain.vectorStoreQdrant - Respond to Webhook
n8n-nodes-base.respondToWebhook - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger
From the author
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…