Skip to main content
The search module runs semantic (vector) search over your project’s content and powers a streaming, RAG-style question-answering endpoint.
These features require semantic search to be enabled for your project. See the Semantic Search & AI guide for setup.
The three search* functions return raw arrays of similarity-ranked results (not a PaginatedResponse); each element is { similarity, record }. askContent is different — it streams its answer (see below).

searchContent

Semantic search over content — entities, comments, and chat messages.
string
required
The search query string.
("entity" | "comment" | "message")[]
Which content types to search. Defaults to all.
string
Scope the search to a specific space.
string
Scope the search to a specific conversation.
number
Maximum number of results to return.
string
Opts each result record’s author into a spaceReputation number. Accepts a space <uuid>, "none" (the project-general bucket), or "context" (the space derived from the request context). The empty string and the legacy general / null aliases are rejected. See Reputation.
boolean
Only honored alongside an explicit space <uuid>. When true, spaceReputation is the subtree sum — the named space plus all of its descendants.
ReturnsPromise<ContentSearchResult[]>, where each element is { sourceType: "entity" | "comment" | "message"; similarity: number; record: Entity | Comment | ChatMessage }.

searchUsers

Semantic search over the project’s users.
string
required
The search query string.
number
Maximum number of results to return.
ReturnsPromise<UserSearchResult[]>, where each element is { similarity: number; record: User }.

searchSpaces

Semantic search over the project’s spaces.
string
required
The search query string.
number
Maximum number of results to return.
ReturnsPromise<SpaceSearchResult[]>, where each element is { similarity: number; record: Space }.

askContent

Asks a natural-language question over your content and streams the answer back as it is generated. Unlike every other SDK function, askContent is an async generator over Server-Sent Events — you for await over it rather than awaiting a single result.
askContent streams via fetch rather than axios, so it does not get the automatic token-refresh-on-403 retry that other calls have. In SDK-managed mode, make sure a fresh access token is in place before starting a long stream.
string
required
The natural-language question to answer.
("entity" | "comment" | "message")[]
Which content types to draw from. Defaults to all.
string
Scope the answer to content within a specific space.
string
Scope the answer to a specific conversation.
number
Maximum number of sources to draw from.
string
Opts each cited source record’s author into a spaceReputation number. Accepts a space <uuid>, "none" (the project-general bucket), or "context" (the space derived from the request context). The empty string and the legacy general / null aliases are rejected. See Reputation.
boolean
Only honored alongside an explicit space <uuid>. When true, spaceReputation is the subtree sum — the named space plus all of its descendants.
AbortSignal
Aborts the in-flight stream (e.g. when the user navigates away). You can also stop consuming by breaking out of the for await loop.
ReturnsAsyncGenerator<AskContentEvent, void, unknown>. Each yielded event is one of:
Completion and errors are signalled in-band as done / error events — the generator itself returns void and does not throw on a server-reported error.