WorkersTools
Vectorsearch
📸 Screenshots
Here are visual examples of this section:
Vectorsearch - Worker Configuration Interface
1. Overview and Purpose
The Vectorsearch worker performs semantic search across configured knowledge bases using vector similarity. It takes a search query and returns relevant documents from various sources including Supabase, Exa, Weaviate, Jina, and other configured data sources. The worker supports multiple search configurations and can deduplicate results across different sources.
2. Configuration Parameters
source: The ID of the knowledge base source to search in (required)toolDescription: Description for the search tool when used in agent workflows (defaults to "Search tool")
3. Input/Output Handles
input: Input handle - accepts the search query stringoutput: Output handle - returns array of VectorDocument objects with search resultstextOutput: Output handle - returns search results formatted as markdown textreferences: Output handle - returns deduplicated array of reference links from search resultstool: Input handle - accepts tool configuration for agent integration
4. Usage Examples with Code
// Configure the worker with a knowledge base source
const vectorSearchWorker = {
parameters: {
source: "kb_source_id_123",
toolDescription: "Search company documentation"
}
}
// Execute search with a query
worker.fields.input.value = "How to configure authentication"
await worker.execute({ apiKeys, team })
// Access results
const documents = worker.fields.output.value // Array of VectorDocument objects
const textResults = worker.fields.textOutput.value // Markdown formatted results
const references = worker.fields.references.value // Deduplicated reference links5. Integration Examples
This worker integrates seamlessly with agent workflows as a tool, allowing AI agents to search knowledge bases dynamically. It works well in combination with text processing workers that can further analyze or summarize the search results.
6. Best Practices
- Always configure a valid knowledge base source before executing searches
- Use specific, descriptive queries for better search results
- Consider the distance threshold and result limits configured in your knowledge base sources
- Review the references output to provide proper attribution for search results
7. Troubleshooting Tips
- Ensure the specified source ID exists and is properly configured in the kbsources table
- Verify that the knowledge base source has valid search configurations defined
- Check that API keys are properly configured for external search services
- If no results are returned, try adjusting the distance threshold or expanding the search query
