RAG Query Node
Retrieve from a knowledge base and optionally generate an answer for each record
Last updated 24 Jun 2026
The RAG Query node runs a similarity search against a knowledge base for each record, attaches the retrieved context, and — by default — generates an answer with an LLM. It is the retrieval-augmented-generation counterpart to KB Ingest.
When to Use
Use RAG Query to answer questions grounded in your own documents, or to enrich each record with relevant context before a downstream step — for example, retrieving product documentation, competitor analysis, or research findings keyed off a field on each record.
Configuration
| Field | Type | Description |
|---|---|---|
knowledgeBaseId | string | ID of the knowledge base to query |
queryColumn | string | Record column whose value is used as the search query |
searchType | vector | hybrid | Standard semantic search, or semantic combined with keyword matching (default: vector) |
topK | number | Number of chunks to retrieve (default: 5) |
scoreThreshold | number | Minimum relevance score 0–1 for a chunk to be kept (default: 0.5) |
useReranking | boolean | Re-rank retrieved chunks for higher quality (default: false) |
rerankCredentialId | string | Credential for the reranking provider (e.g. Cohere) |
generateAnswer | boolean | Generate an LLM answer from the retrieved context (default: true) |
llmProvider | openai | anthropic | google | groq | LLM provider for answer generation |
llmModel | string | Model identifier (e.g. gpt-4o-mini) |
llmCredentialId | string | Credential for the LLM provider |
outputColumn | string | Column to write the generated answer to (default: rag_answer) |
temperature | number | LLM sampling temperature (default: 0.7) |
maxTokens | number | Maximum tokens in the generated answer |
Example
Answer a per-row question from a competitor-intel knowledge base:
knowledgeBaseId: <kb-uuid>
queryColumn: question
searchType: hybrid
topK: 5
scoreThreshold: 0.6
generateAnswer: true
llmProvider: anthropic
llmModel: claude-haiku-4-5
outputColumn: answer
Notes
- Every record gains
_rag_context(the concatenated retrieved chunks) and_rag_chunk_count, plus_rag_top_scorewhen scores are included. - When
generateAnsweristrue, the LLM answer is written tooutputColumn(defaultrag_answer); when it isfalse, the node only attaches retrieved context and the LLM fields are ignored. - Chunks below
scoreThresholdare dropped. If nothing clears the threshold for a row, the context columns are empty and the answer column (if enabled) is set to an empty string. searchTypedefaults to the knowledge base's own configured search type when left unset.
Related articles
Node Reference Complete reference for all automation node types, organized by categoryKB Ingest Node Ingest records into a knowledge base for vector searchLLM Node Generate text or structured data using a language modelTemplate Syntax Variable interpolation syntax for LLM, Agent, HTTP, and MCP node configurations
Still stuck? Browse the FAQ or contact us.