The RAG Retriever finds relevant information from knowledge collections and stores the results in a variable for use in subsequent nodes.
{{user_message}})Optionally enable AI to generate and test multiple optimized search queries, then evaluate and filter the results for relevance.
The search results are stored with content, scores, and metadata:
Results: {{rag.results[0].content}}
Count: {{rag.count}}
Search Query
handlebars
Required
The search query to find relevant documents.
Supports Handlebars syntax:
{{variable_name}}
Knowledge Collections
knowledge_collections
Required
Select one or more knowledge collections to search.
Select one or more knowledge collections to search. Collections are managed in the Knowledge section.
Search Settings
search_settings
Configure search behavior and result filtering.
Configuration options:
Search types:
AI Query Optimization
toggle
Enable AI-powered query optimization. When enabled, AI generates multiple optimized search queries, searches with all of them, merges results, and uses AI to evaluate and filter results for relevance. This improves search quality for complex queries but adds latency.
agenticOptimization
toggle
AI Query Optimization
Enable AI-powered query optimization. When enabled, AI generates multiple optimized search queries, searches with all of them, merges results, and uses AI to evaluate and filter results for relevance. This improves search quality for complex queries but adds latency.
false
AI Configuration
agent_settings
Configure the AI model and behavior.
Configuration options:
Temperature guide:
This node stores its output in a variable that can be referenced in subsequent nodes using the {{variable}} syntax.
{{variable}}.results
array
Array of search result objects with content, score, source, and metadata
{{variable}}.results[].id
string
Unique identifier for the search result chunk
{{variable}}.results[].content
string
The text content of the search result chunk
{{variable}}.results[].score
number
Relevance score for this result (0.0-1.0)
{{variable}}.results[].source
string
Source document name or URL
{{variable}}.results[].metadata
object
Additional metadata about the search result
{{variable}}.results[].collection_id
string
ID of the collection this result came from
{{variable}}.results[].collection_name
string
Name of the collection this result came from
{{variable}}.query
string
Original search query that was executed
{{variable}}.count
number
Number of results returned
{{variable}}.metadata
object
Search metadata including total_count, search_type, and timestamp
{{variable}}.metadata.total_count
number
Total number of results found (same as count)
{{variable}}.metadata.returned_count
number
Number of results returned (same as count)
{{variable}}.metadata.search_type
string
Search type used: hybrid, semantic, or keyword
{{variable}}.metadata.timestamp
string
ISO 8601 timestamp when search was executed
output
empty_results