Knowledge search
Semantic search in knowledge
A vectorized dataset can be used in a Knowledge search where you look for specific entries relevant to a query.
If you have not enabled knowledge in the process of
uploading your dataset, go to Data
page, switch from “Knowledge” to “Datasets”, use the Vectorize
button on the top to vectorize your data.
If you use other options than knowledge, you will see the name of the vector field as shown in the image
below.
How to use the Knowledge search step
Add the component
You need to add the “Knowledge search” step to your Tool (check how to get started with creating a tool).
Knowledge Source
Select the target dataset (datasets containing at least a vector field) from the drop-down menu. You can also select “All knowledge sets” to perform the search across all the uploaded and vectorized data.
Only use “All knowledge sets” if they all contain relevant data.
Query
The query is your reference to what you want from your data; it is similar to what you type in Google when performing web searches. Form your queries wisely, not too long, not too short, precisely mention what needs to be fetched from the data.
Search type
- Keyword: This search is suitable for word/phrase matching.
- Vector search: This search is suitable for semantic search and looking not just at words but at the concept.
Use word matching when looking for specific words, or even IDs such as model number or response id.
Model
This is the model used for vectorizing your data. By default, Relevance uses the MpNet model for enabling knowledge. So, if you have vectorized your data with a model other than MpNet, make sure to select the model from the drop-down menu, otherwise, you do not need to make any selection.
Content field
You can select which specific column in your knowledge table be searched. Enter the name of the column (i.e. the header) ** EXACTLY ** as seen in the table. If you do not select any field, Relevance searches across the whole dataset (Keyword), the first vector field (Vector).
When uploading a CSV file knowing one column will be used for search, it is better to only select that target column when enabling knowledge, instead of selecting all columns.
Page size
After a search query finalizes, you can specify, how many of the top matching results should be returned as the Search result.
Raw filters
If you wish to look at a subset of entries in your dataset and perform a search on that subset, you can set raw filters. Keep in mind you must form your filters as JSON objects.
- Supported operators and conditions:
==
,!=
,neq
,<=
,>=
,<
and>
. - The
AND
logic is applied when multiple filters are used (i.e. a list of filters).
Filter samples
List rows where entries in the field product_name
are exactly Durian Leather 2 Seater Sofa
:
Follow the links below for more information about
- How to run a step
- How to delete a step
- How to configure output
- How to configure a default value
- How to move a step in a Tool
- How to duplicate a step
- How to add condition to a step (i.e. execute only if a condition is met)
- How to loop a step (i.e. run one step multiple times)
Access the step output
The output is a dictionary with two keys results
and documents
containing the extracted relevant chunks of text from the knowledge set
and the full documents respectively.
Below you can see samples where the default name assigned to the step vector_search
is used.
Note that a step name is different from the step title. Step titles can be found on the top left
of steps. A step name is shown on the bottom left, in smaller font and highlighted green.
vector_search.results
vector_search.documents
Was this page helpful?