Skip to main content

Interface: LibrarySearch

Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:77

A search.

Properties​

anyOf?​

optional anyOf: 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?​

optional folderId: string

Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:87

Only the sources filed in this folder.


folderIds?​

optional folderIds: 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?​

optional kinds: string[]

Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:85

Only these kinds of source; an empty list narrows nothing.


match?​

optional match: "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?​

optional mode: "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?​

optional prefix: 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?​

optional sourceIds: 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?​

optional tags: 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?​

optional topK: number

Defined in: packages/agentos/src/cognition/library/LibraryIndex.ts:83

The most passages answered.

Default​

10