WorkersTools
Search
📸 Screenshots
Here are visual examples of this section:
Search - Worker Configuration Interface
1. Overview and Purpose
The Search worker performs vector similarity searches across different knowledge bases and search engines. It supports multiple backends including Supabase vector databases, Databricks vector search, and external engines like Weaviate and Exa. The worker returns relevant documents based on semantic similarity to the input query.
2. Configuration Parameters
engine: Specifies the search engine to use - "weaviate", "exa", "supabase", or "databricks"maxResults: Maximum number of search results to return (default: 5)domain: Array of domains to restrict search scope for external enginesdistance: Similarity threshold for filtering results (default: 0.5 for external, 0.3 for Supabase)collections: Array of collection IDs to search within for Supabase enginetoolDescription: Description text when worker is used as a tooldatabricksEndpoint: API endpoint URL for Databricks vector searchdatabricksIndex: Index name for Databricks vector search
3. Input/Output Handles
input: Input handle - accepts search query stringoutput: Output handle - returns array of VectorDocument objectstextOutput: Output handle - returns search results formatted as markdown textreferences: Output handle - returns array of reference objects with links and titlestool: Input handle - enables use as a tool in agent workflowsengine: Input handle - accepts engine type overridedomain: Input handle - accepts domain restrictions arraydistance: Input handle - accepts similarity threshold overridemaxResults: Input handle - accepts result limit overridecollections: Input handle - accepts collection IDs for Supabase searches
4. Usage Examples with Code
// Basic search configuration
const searchWorker = {
parameters: {
engine: "supabase",
maxResults: 10,
distance: 0.3,
collections: ["collection-1", "collection-2"]
}
}
// Tool usage in agent
const tool = {
parameters: {
query: "artificial intelligence applications"
}
}5. Integration Examples
This worker integrates with knowledge management workflows by providing semantic search capabilities. It can be chained with other workers to retrieve relevant context before generating responses or used as a tool that agents can call dynamically during conversations.
6. Best Practices
- Use lower distance thresholds (0.2-0.4) for more precise matches, higher values (0.6-0.8) for broader results
- Configure appropriate maxResults based on downstream processing capacity
- For Supabase searches, ensure collections contain properly embedded documents
- Test different engines to find the best match for your specific use case and data types
7. Troubleshooting Tips
- Verify API keys are properly configured for your chosen search engine
- Check that collection IDs exist and contain embedded documents for Supabase searches
- Ensure Databricks endpoint and index parameters are correctly formatted
- If no results are returned, try increasing the distance threshold or broadening the search query
