RAG (retrieve)
RAG (retrieve) searches a vector knowledge base for the chunks most similar to a query and returns them. It’s the “read” half of RAG (the other is RAG (ingest), which loads the content).
It has dual use:
- Connected to the
ragport of an AI Agent: the agent retrieves context and injects it into the prompt before answering (so it answers with your content and doesn’t make things up). - As a standalone node in a flow: it returns the results in
data.resultsfor you to use afterwards.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| namespace | text | Yes | Namespace to search in (the same you used when indexing). |
| top_k | number | No | How many chunks to retrieve. Default 4. |
| provider | select | Yes | Embeddings provider (openai, local, together, mistral). |
| model | text | Yes | Embeddings model (the same as when indexing). |
| credentials_id | credentials | Yes | Embeddings provider credential. |
| attach_to | text | No* | Agent alias (only if used as a RAG sub-node). |
Example — Agent that answers about your documentation
Section titled “Example — Agent that answers about your documentation”This agent answers based on a manual previously indexed in the product-manual namespace.
- RAG (retrieve):
namespace:product-manualtop_k:4provider:openai,model:text-embedding-3-smallcredentials_id: your credential
- Connect its output to the agent’s
ragport (amber). - AI Agent —
system_prompt: “Answer using only the retrieved context. If it isn’t there, say so.”
For “how do I configure a webhook?”, the agent retrieves the 4 most similar chunks from the manual and adds them to the prompt before the LLM writes the answer.
Output (standalone use)
Section titled “Output (standalone use)”{ "query": "how do I configure a webhook", "results": [ { "text": "To create a webhook…", "score": 0.89 }, { "text": "The endpoint receives…", "score": 0.82 } ]}