Core SDK
Search
Full-text and hybrid semantic message search via REST.
Search
Search room history with GET /search/messages (FTS5-backed). When semantic search is enabled for your tenant, use hybrid mode for embedding + keyword results.
const { results } = await client.searchMessages("deployment rollback", {
roomId: "engineering",
limit: 20,
mode: "hybrid", // "fts" | "semantic" | "hybrid"
});
for (const hit of results) {
console.log(hit.snippet, hit.roomId, hit.createdAt);
}Semantic search (hybrid)
Per-tenant toggle in the dashboard at Settings → Search (/settings/search).
| Step | Action |
|---|---|
| 1 | Worker: SEMANTIC_SEARCH_ENABLED=true + embeddings provider (AI_EMBEDDINGS_*) |
| 2 | Apply migration 0164_semantic_search_settings.sql |
| 3 | Dashboard: enable semantic search → Run backfill |
| 4 | Search on /search or the room Search panel in chat |
SDK helpers:
await client.getSemanticSearchSettings();
await client.backfillMessageEmbeddings({ roomId: "general" });
const { results } = await client.searchMessagesSemantic("onboarding flow", { roomId: "support" });Query parameters
| Param | Description |
|---|---|
q | Search string (required) |
roomId | Limit to one room |
from / to | ISO date range |
limit | Max hits (default 20, max 50) |
Requires member JWT with access to the scoped rooms.
UI pattern
Debounce input, show snippets from hit.snippet, deep-link to /rooms/{roomId}?message={id} in your app router.
See API Reference → Search.