Interface: LibrarySearch
Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:77
A search.
Properties
anyOf?
optionalanyOf:Pick<LibrarySearch,"tags"|"kinds"|"folderId"|"folderIds"|"sourceIds">[]
Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:106
Several narrowings at once: a passage is found when any one of them holds. Each is searched with the one
embedding of the text under the same scope, a passage found twice kept once, and the answer is ranked as one
search's: each leg by the passage's own score across every branch (its similarity to the text, the lexical rank
of the text's words in it), the two legs of a hybrid search fused once. A branch's fields replace the search's
own of the same name. An empty list finds nothing, as does a list whose every branch finds nothing by its own
narrowing, and neither calls the embedder or the store. The legs are the store's query and lexicalSearch,
never its hybridSearch; on a store without lexicalSearch, a hybrid search is answered by the dense leg alone.
folderId?
optionalfolderId:string
Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:87
Only the sources filed in this folder.
folderIds?
optionalfolderIds:string[]
Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:92
Only the sources filed in any of these folders; an empty list finds nothing, without a call to the embedder or
the store. With folderId as well, both apply.
kinds?
optionalkinds:string[]
Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:85
Only these kinds of source; an empty list narrows nothing.
match?
optionalmatch:"all"|"any"
Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:108
For the lexical leg, alone or in a hybrid search: every word or any word (default), and whether a stored word may only begin with a query word.
mode?
optionalmode:"hybrid"|"lexical"|"dense"
Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:81
lexical embeds nothing; hybrid fuses both legs where the store can; dense is the embedding alone.
Default
'hybrid'
prefix?
optionalprefix:boolean
Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:109
scope
scope:
LibraryScope
Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:79
sourceIds?
optionalsourceIds:string[]
Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:96
Only these sources; an empty list finds nothing, without a call to the embedder or the store.
tags?
optionaltags:string[]
Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:94
Every one of these tags; an empty list narrows nothing.
text
text:
string
Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:78
topK?
optionaltopK:number
Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:83
The most passages answered.
Default
10