Skip to main content

Knowledge Base Search

The Knowledge Base Search Tool allows users to search through a specified knowledge source using a search query, filter the results, and define the number of results to be returned. Additionally, users can configure guardrails validators to ensure the quality and relevance of the search results.

How to Use the Knowledge Base Search Tool

Step 1: Access the Tool

  1. Go to the Add User Step section.
  2. From the available options, select the Knowledge Base Search Tool.

Step 2: Input the Knowledge Source

Specify the knowledge source from which you want to search.

Step 3: Input the Search Query

After selecting the knowledge source, you need to provide the search query that you want to search. You have two options to input the topic name:

1. Manual Input

Type the search query directly into the input field.

2. User Input Variable

Use a user input variable to dynamically provide the search query. This is useful if the search query is being collected from user interaction elsewhere in your application.

You can use a user input variable that captures the user's input using {{}}. For example, if the variable is named input_0, you would set the topic name field to {{input_0}}.

Step 4: Input the Filter Expression

Type the filter expression based on your requirements. Filter expressions help refine the search results by including or excluding specific criteria.

Step 5: Specify the Number of Results

Type the number of results you want to receive from the search in the field labeled Number of Results.

Step 6: Configure Guardrails Validators (Optional)

Set up validators based on your specific needs. This may include rules for filtering out low-quality results, ensuring relevance, or other criteria.

Once you have entered all the necessary information, initiate the search:

Click the Search Button: Look for a button labeled "Search" or "Submit." Click this button to perform the search. Wait for Results: The tool will process your request and search through the specified knowledge source based on your query and filters.

Step 8: View the Output

The search results will be displayed according to the specified number of results and filters. Here's how you can view and interpret the output:

Results Display: The results will be presented in a structured format, often in JSON, which includes key information about each result such as title, source, snippet, and more. Example JSON Output:

In this example: title: The title of the search result. source: The source or origin of the search result. snippet: A brief snippet or summary of the content from the search result.

Step 9: Utilize the Results

You can now use the search results for further processing, analysis, or integration into your application.

Tips for Effective Use

1. Specific Queries: Use specific and clear search queries to get the most relevant search results.

2. Effective Filters: Apply filter expressions to narrow down the search results to the most relevant ones.

3. Guardrails Validators: Configure guardrails validators to ensure the quality and relevance of the search results.