Performs a semantic vector search against one of your Knowledge Bases, returning the most relevant document excerpts. Use in combination with the Agent node to give AI models access to your private documents, product knowledge, or any other indexed content.
ragRAG stands for Retrieval-Augmented Generation. Instead of relying purely on the AI model's training data, RAG lets you retrieve the most relevant passages from your own documents and feed them to the model as context. This dramatically improves accuracy for questions about your specific domain, products, policies, or any information the model has not been trained on.
The RAG node takes a search query โ typically the user's question โ and performs a vector similarity search across all the documents you have indexed in the selected Knowledge Base. It returns the top-matching chunks, each scored by relevance. These results can then be injected directly into an Agent node via its Context Sources setting, or referenced manually in a prompt.
Before using this node, you must have at least one Knowledge Base with indexed documents. You can manage Knowledge Bases from the Knowledge Bases section of the main navigation.
| Field | Status | Description |
|---|---|---|
| Knowledge Base | Required | The Knowledge Base to search. Only Knowledge Bases with at least one document in completed status will return results. |
| Query | Required | The search query. Supports {{ variable }} references โ in most workflows, this is the user's question, such as {{ trigger.output.question }} or {{ form.output.query }}. |
| Limit | Optional | Maximum number of document chunks to return. Range is 1โ50. Default is 5. Returning more chunks gives the agent more context but increases prompt length and API cost. |
| Threshold | Optional | Minimum similarity score (0โ1) a chunk must achieve to be included in results. Default is 0.7. Higher values return only closely matching chunks; lower values cast a wider net. Set to 0 to return results regardless of similarity. |
| Query Expansion | Optional | When enabled, Flusso automatically generates several rephrased variations of the original query and searches with each. This improves recall for vague or ambiguous queries by finding relevant content that might not surface with the original wording alone. |
| Diversity Mode | Optional | When enabled, Flusso uses the MMR (Maximal Marginal Relevance) algorithm to select results that are both relevant to the query and diverse from each other. Use this when you want broad coverage across multiple aspects of a topic rather than several chunks from the same passage. |
| Diversity Lambda | Optional | Controls the balance between relevance and diversity when Diversity Mode is on. Range is 0โ1. A value of 1.0 returns purely the most relevant results (no diversity penalty). A value of 0.0 maximises diversity regardless of relevance. Default is 0.5. |
The RAG node produces an array of matching document chunks:
| Field | Type | Description |
|---|---|---|
items | array | An array of matching chunks, sorted by relevance score descending. Each item contains the fields below. |
items[].text | string | The raw text content of the matching chunk. |
items[].score | number | The similarity score (0โ1) indicating how closely this chunk matches the query. |
items[].document_name | string | The name of the source document this chunk came from. |
items[].metadata | object | Any additional metadata stored with this chunk (e.g. page number, section heading). |
{{ trigger.output.question }}.
Leave Limit at 5 and Threshold at 0.7.
If you prefer to format the context yourself rather than using Context Sources: