RAG Search Component
Use the RAG Search component to fetch relevant pieces of information that your agent previously stored using the RAG Remember component. It enables smart memory recall across documents, notes, messages, or any other text-based content.
What You’ll Configure
Namespace
Field | Required? | Description |
---|---|---|
Namespace | Yes | This defines which "memory bucket" to search in. It must match the one used during indexing with RAG Remember. |
Results Count
Field | Required? | Description |
---|---|---|
Results Count | No | Set how many top results to return (usually 3–5 is ideal). Helps control what gets passed downstream. |
Include Metadata
Field | Required? | Description |
---|---|---|
Include Metadata | No | Includes source info like document name, section number, author, etc.—only if metadata was added during indexing. |
Inputs
Query
Field | Required? | Description |
---|---|---|
Query | Yes | This is the question or phrase your agent uses to search memory. Can be natural language, keywords, or anything meaningful. |
Outputs
Results
Output | Description |
---|---|
Results | Returns an array of relevant content. Each item includes: - text : the matched content - score : relevance score (optional) - metadata : original doc info (if enabled) |
Real-World Example: Internal Policy Lookup
Let’s say your agent acts as a company helpdesk. You’ve previously indexed HR and policy documents under the namespace company_docs
.
Now your agent needs to answer a user query like:
“How do I process a customer refund?”
Your RAG Search Configuration
Setting | Value |
---|---|
Namespace | company_docs |
Results Count | 3 |
Include Metadata | Yes |
Example Query
Field | Value |
---|---|
Query | Steps for processing a refund |
Output Example
[
{
"text": "Refunds must be processed through the billing portal within 7 days of the original transaction.",
"score": 0.94,
"metadata": {
"document": "RefundPolicy2024.pdf",
"section": "2.1"
}
}
]
Now your agent can forward this text to a downstream LLM component to format it as a human-readable response.
Real-World Example: Internal Policy Lookup
Consider an enterprise helpdesk agent built with SmythOS. You’ve previously stored internal documents (HR policies, refund terms, tech protocols) using the RAG Remember
component under the namespace company_docs
.
Now, you want your agent to intelligently retrieve responses when users ask questions like:
- "How many days of paid leave do I get?"
- "What’s the process for refunding a customer?"
Setup
- Namespace:
company_docs
- Results Count: 3
- Include Metadata: Enabled (to show document name and version)
Input
Field | Value |
---|---|
Query | "Steps for processing a refund" |
Output Sample
[
{
"text": "Refunds must be processed through the billing portal within 7 days of the original transaction.",
"score": 0.94,
"metadata": {
"document": "RefundPolicy2024.pdf",
"section": "2.1"
}
},
]
Best Practices
- Keep your namespace naming consistent across components
- Ask precise questions in the query field — just like you'd Google something
- Stick to 3–5 results max unless you want a broader recall
- Always include metadata when you want traceability or audit context
- Use RAG Search before LLM generation to reduce hallucination and boost accuracy
What to Try Next
- Feed
Results
into a GenAI LLM for summarization - Index new documents with RAG Remember for future retrieval
- Use metadata to filter or route results programmatically