1. Tasks
  2. Search Knowledge Library

Tasks

Search Knowledge Library

Searches through your knowledge library.

Overview

This task allows you to search for snippets from knowledge library articles.
Typically you'll supply a query in text and the task will return matching snippets from any articles in the rooms & shelves that you specify.

This task allows building AI Agents with access to large amounts of information and documents.

See the debug block for a visual way to debug this task.

Basic usage

Search all of your knowledge library articles for ~~stubpost.message.

loading...

Parameters

branch
required
string

the branch to search in


query
Object

the query to search with

Show child attributes
text_small
Object

the text_small query, corresponding to the text_small vector

Show child attributes
content
required
string

the string/text content of the text_small query

ai_enrich
Object

optional configuration for enriching the text_small query with AI

Show child attributes
model
string

the model to use for the ai_enrich

Default: gpt-4o

system_prompt
string

the system prompt used to enrich the query


filter
Object

allows filtering of the search using arbitrary data

Show child attributes
by_categorization
Object
Show child attributes
knowledge_library
Object

filter by knowledge library categorization

Show child attributes
enabled
boolean

whether to enable the knowledge library filter

libraries
StringBooleanMap

the libraries to filter by

rooms
StringBooleanMap

the rooms to filter by

shelves
StringBooleanMap

the shelves to filter by

by_score
Object

filter by score

Show child attributes
min_threshold
number

the minimum score threshold for the search


return
Object

the return configuration, controls what data this task returns

Show child attributes
limit
number

the maximum number of results to return

rerank
Object

optional reranking configuration for the returned results

Show child attributes
enabled
boolean

whether to enable reranking

query_with
string

which query content to use for reranking, one of text_small or ai_enrich, defaults to text_small

limit
number

optional limit for how many snippets to return after reranking

results_array_key
string

the key to use for the results array in the return payload

debug
boolean

whether to return debug information

item_structure
Object.<string, string>
string

allows modifying the structure of the returned items using variable substitution

ai_summarize
Object

optional configuration for summarizing the results with AI, see ai_summary

Show child attributes
model
string

the model to use for the ai summary

system_prompt
string

the system prompt used to summarize the results


Result

loading...

Properties

results
Array.<Object>

an array of matching points that were found.

if params.return.results_array_key is set, the results will be under that key instead of results

Show child attributes
score
float

how closely the snippet matched the query

payload
Object

object containing additional data that was stored along with the point

Show child attributes
article
Object

contains info about the article this snippet came from

Show child attributes
articleuuid
string

the unique identifier for the article

categorization
Object

categorization details for the article

Show child attributes
knowledge_library
Object
Show child attributes
library
string

what library the article is in

room
string

what room the article is in

shelf
string

what shelf the article is in

details
Object
Show child attributes
name
string

the name of the article the snippet belongs to

data
Object

any additional data stored with the article

snippet
Object

represents a small part of the article that matched the query

Show child attributes
text_small
Object
Show child attributes
content
string

the piece of text that matched the query

hash
string

the hash of the text that matched the query


ai_summary
Object

object containing the summary of all results, only returned if return.ai_summarize is set

Show child attributes
content
string

the summary of all results


debug
Object

if return.debug is set, this will contain debug information.

This can be useful to inspect the internals of the task, and is required to use the search_knowledge_library_debug block.


Examples

Advanced usage of ai_enrich, filter and return params

loading...

Result

loading...