Skip to content

createVectorRetrievalTool

function createVectorRetrievalTool(options): Tool<{
query: string;
topK?: number;
}, VectorRetrievalToolOutput>;

Creates a retrieval tool that can be added to any Kuralle agent.

The tool wraps any Retriever implementation, allowing the LLM to decide when to search for relevant knowledge. Uses the Vercel AI SDK tool() directly.

Parameter Type

options

VectorRetrievalToolOptions

Tool<{ query: string; topK?: number; }, VectorRetrievalToolOutput>