Skip to main content
cesteralDocs
FAQContact

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

FieldTypeDescription
knowledgeBaseIdstringID of the knowledge base to query
queryColumnstringRecord column whose value is used as the search query
searchTypevector | hybridStandard semantic search, or semantic combined with keyword matching (default: vector)
topKnumberNumber of chunks to retrieve (default: 5)
scoreThresholdnumberMinimum relevance score 0–1 for a chunk to be kept (default: 0.5)
useRerankingbooleanRe-rank retrieved chunks for higher quality (default: false)
rerankCredentialIdstringCredential for the reranking provider (e.g. Cohere)
generateAnswerbooleanGenerate an LLM answer from the retrieved context (default: true)
llmProvideropenai | anthropic | google | groqLLM provider for answer generation
llmModelstringModel identifier (e.g. gpt-4o-mini)
llmCredentialIdstringCredential for the LLM provider
outputColumnstringColumn to write the generated answer to (default: rag_answer)
temperaturenumberLLM sampling temperature (default: 0.7)
maxTokensnumberMaximum 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_score when scores are included.
  • When generateAnswer is true, the LLM answer is written to outputColumn (default rag_answer); when it is false, the node only attaches retrieved context and the LLM fields are ignored.
  • Chunks below scoreThreshold are 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.
  • searchType defaults to the knowledge base's own configured search type when left unset.

Related articles

Still stuck? Browse the FAQ or contact us.