Query Collection Block
Query and filter collections within Scout workflows
The Query Collection block enables users to perform searches within a specified Scout collection. It supports filtering based on metadata and querying with Jinja templating, providing flexible data retrieval options.
Configuration (Required)
The ID of the collection to query. Ensure the collection ID is correct and accessible. This field supports Jinja templating for dynamic content generation.
Specifies the maximum number of documents to retrieve from the collection. The default value is 10
. Adjust this setting based on the specific needs of your task or application.
Determines the threshold for document similarity in the retrieval process. A value closer to 1.0
requires a higher similarity between the query and the document text, while a value closer to 0.0
allows for more lenient matches. The default value is 0.5
, with a step of 0.1
.
Filters to apply to the collections metadata. Use appropriate filters to narrow down search results and retrieve precise data. The default is an empty list.
The query to search for in the collection. This input supports Jinja templating, allowing for dynamic query construction based on workflow state.
Outputs
The block outputs a list of results matching the query, including similarity scores, text, and metadata. This structured output allows for further processing and integration within the workflow.
Usage Context
Use this block to search and filter data within a Scout collection. This is particularly useful for retrieving specific documents or entries based on dynamic query conditions.
Best Practices
- Ensure the collection ID is correct and accessible to prevent errors during execution.
- Use Jinja templating in the ‘query’ and ‘collection’ fields for dynamic content generation.
- Set appropriate ‘limit’ and ‘minimum_similarity’ values to optimize search results.
- Define clear and precise filters to narrow down search results effectively.