GT RAG Memory Search
GT RAG Memory Search
AI-generatedOverview
This node, named GT RAG Memory Search, is designed to search through past conversation memories within a specified session. It provides advanced filtering capabilities including time-based filters and metadata field filters. This makes it particularly useful in scenarios where you want to:
- Retrieve relevant past conversations based on a user query.
- Limit searches to specific time periods (e.g., today, last 7 days, or a custom date range).
- Filter results by metadata such as user type, conversation length, or other custom fields.
- Obtain recent context or historical context selectively depending on the use case.
Practical examples:
- A chatbot that recalls previous interactions with a user from the same session to provide continuity.
- Customer support automation that fetches prior tickets or conversations filtered by date or tags.
- Analytics tools that analyze conversation trends over specific time frames or user segments.
Properties
| Name | Meaning |
|---|---|
| Search Query | The text query to search for within conversation memories. It can be dynamically set from incoming JSON fields like query, search_query, or message. |
| Session ID | Identifier of the session within which to perform the memory search. |
| Results Limit | Maximum number of search results to return. Accepts values between 1 and 50. |
| Minimum Score | Minimum combined score threshold (between 0.0 and 1.0) to filter out less relevant results. |
| Time Filter Name or ID | Filters memories by predefined time periods: No Filter, Today, Yesterday, Last 7 Days, Last 30 Days, or Custom Range. You can also specify a value via expression. |
| Start Date | Start date for the custom time range filter (ISO 8601 format). Only shown if "Custom Range" is selected in the Time Filter. |
| End Date | End date for the custom time range filter (ISO 8601 format). Only shown if "Custom Range" is selected in the Time Filter. |
| Metadata Filters | Allows adding multiple metadata field filters. Each filter includes: - Field: Metadata field name. - Operation: One of Equals, Not Equals, In, Not In, Contains, Exists, Greater Than, Less Than. - Value: Filter value (comma-separated for "in" and "not_in"). |
Output
The node outputs an array of items where each item contains a json property holding the search results returned from the external memory API. The structure of the output JSON corresponds directly to the API response and typically includes matched conversation memories along with their associated metadata and relevance scores.
If the node encounters errors during execution, it outputs error details in the json field with keys such as error, itemIndex, and timestamp.
The node does not output binary data.
Dependencies
- Requires connection to an external memory API service.
- Needs credentials containing:
- An API domain URL.
- An API token for authorization.
- The API endpoint used is
/api/v1/memory/searchon the configured domain. - Proper configuration of these credentials in n8n is mandatory for the node to function.
Troubleshooting
- Missing API Domain or Token: The node will throw errors if the API domain or token is not provided in credentials. Ensure credentials are correctly set up.
- Empty Search Query or Session ID: Both are required parameters; missing them will cause the node to fail.
- Invalid Time Filter Values: Using unsupported time filter values may result in no results or errors.
- Metadata Filter Format: Incorrectly formatted metadata filters (e.g., missing field names or invalid operations) can cause request failures.
- API Request Failures: Network issues or incorrect API domain/token can lead to request errors. Check connectivity and credential validity.
- Handling Errors: If "Continue On Fail" is enabled, errors for individual items will be output as JSON objects with error details instead of stopping the workflow.
Links and References
- n8n Expressions Documentation
- General REST API usage guidelines for integrating external services in n8n workflows.