Vector Search Skill
Getting Answers from Your Data:
Traditional searches in a database are great for finding exact matches, like a transaction with a specific ID or a client with a known last name. But what if you need to find documents based on meaning or context, not just keywords?
The Vector Search Skill is your workflow's "smart search" tool. It performs a semantic search on a vector database, which stores information in a way that understands the relationships and context between different pieces of data. This allows you to retrieve the most relevant documents based on the intent of your query, enabling smarter, more contextual AI responses.
Finding Lender Policies for a Specific Loan Type
Imagine your workflow guides a user through a loan application. The user wants to know the required documents for a specific type of loan, such as a Small Business Line of Credit (SBLOC). All your lender policies are stored as documents in a vector database. You need to find the most relevant policy documents that cover SBLOC loans.
The Challenge:
Your lender policies are lengthy, and a simple keyword search for "SBLOC" might miss documents that describe the same loan type using different terminology (e.g., "small business credit facility").
The Solution:
By using a Vector Search Skill, you can query your vector database with a natural language query like "What are the required documents for an SBLOC loan?" The Skill will understand the meaning of your query and retrieve the most relevant policy documents, even if they don't contain the exact keywords.
Setting Up the Vector Search Skill
Let's walk through how to set up this Skill to find relevant lender policies.
Locate the Skill: Drag and drop the Vector Search Skill onto your Workflow Builder canvas. Place it in your workflow at the point where you need to search your knowledge base for contextual information
Configure "Vector Store ID": This is the ID of the vector database you want to query.
Click on the Vector Search Skill to open its configuration panel.
In the "Vector Store ID" field, select the ID of the vector database that contains your lender policies.
Configure "Query": This is the text or embedding you'll use to search.
In the "Query" field, use the output from a previous Skill that contains the user's question. For our use case, you would enter a query like "What are the required documents for an SBLOC loan?"
Set "k" (Number of Candidates): This tells the Skill how many of the top, most similar results to return.
In the "k" field, enter a number. A higher number is useful when your knowledge base is vast or the data is scattered. For example, 5 or 10 is a good starting point.
Add "Filters" (Optional): If your documents have metadata attached (e.g., tags, categories), you can use this field to refine your search.
In the "Filters" field, provide a stringified JSON object to narrow down the search. For example,
{"document_type": "lender_policy"}would only search within policy documents.
Understanding the Outcome
After the Vector Search Skill runs, it provides a list of the most relevant documents, which you can then pass to another Skill (like a Prompt Skill) for summarization or further processing.
retrievedDocs:This is a list of documents found by the search. Each document will contain its
pageContentandmetadata.statusCode: A number indicating the result (200 for success, 400 for an invalid configuration, 500 for a service error).
error: A descriptive message if the search failed.
By using the Vector Search Skill, you make your AI Agents smarter by giving them the power to search for information based on what a user means, not just what they say.