Skip to main content

RAG Search Component

Use the RAG Search component to intelligently retrieve information from your agent’s memory. It fetches relevant content previously stored with RAG Remember using vector similarity, allowing your agent to generate grounded, context-aware responses.

Why this matters

Your agent cannot reason without access to meaningful memory. RAG Search enables smarter behavior by surfacing only the most relevant, contextually matched chunks of information. It also gives you full control over filtering, ranking, and explaining the results.

What You’ll Configure

Step 1: Define the Search Scope

Configure which memory bucket to search and how many results to retrieve.

SettingRequired?Description
NamespaceYesSelect the memory index to search. This must match the namespace used during storage with RAG Remember.
Results CountYesSet how many top results to return. Usually between 3 and 5 provides a good balance between recall and precision.
Think of Namespaces as memory folders

Each namespace holds a separate collection of content. Your agent will only search in the one you specify here.

Step 2: Filter and Format the Output

Use the score threshold to control result quality, and optionally include metadata or similarity scores in the output.

SettingRequired?Description
Score ThresholdOptionalFilters results below the specified similarity score. Range is 0 to 1. A value like 0.7 ensures high-confidence matches. Default is 0 (no filtering).
Include ScoreOptionalAdds the similarity score to each result in the output. Helpful for ranking or diagnostics.
Include MetadataOptionalIncludes document-level info like file name or section if it was added during indexing. Useful for traceability.
Filtering vs. displaying score

The score threshold filters what gets returned. The Include Score option adds the score value to each result. You can enable either or both.

Query Input

FieldRequired?Description
QueryYesThe question or search phrase. Can be natural language or keyword-based. The better your phrasing, the better the match.
INFO

Use clear and specific questions such as “What is the refund process?” instead of vague terms like “refund.”

Handle the Output

Each result contains the retrieved content and may include metadata and similarity, depending on configuration.

OutputDescription
ResultsA list of matched content items. Each item may include:
  • content: the retrieved text
  • metadata: document info (if enabled)
  • similarity: a score between 0 and 1 (if Include Score is enabled)

Example Output

[
{
"content": "Refunds must be submitted within 7 days of the original transaction through the billing portal.",
"similarity": 0.88,
"metadata": {
"document": "RefundPolicy.pdf",
"section": "2.1"
}
}
]

Best Practices

  • Use specific and well-phrased queries for more accurate results
  • Limit results to 3 to 5 to avoid overwhelming downstream logic
  • Apply a score threshold when quality matters
  • Include metadata if traceability is needed
  • Include score for debugging or conditional branching

Troubleshooting Tips

If your results seem off...
  • Check your namespace: Results only come from the specified bucket. If you indexed under another name, nothing will match.
  • Use a lower threshold: If you set the threshold too high, you might filter out valid results.
  • Inspect your query: A vague or incomplete query can return irrelevant results or nothing at all.
  • Verify indexing format: Content indexed without proper chunking or metadata can reduce match quality.

What to Try Next

  • Use RAG Remember to index fresh content
  • Pass the output of RAG Search into GenAI LLM to summarise or respond in natural language
  • Combine with conditional logic to route based on similarity or metadata
  • Build workflows that include score-based thresholds for fallback queries or alternate sources