- Semantic search — find content, users, and spaces by meaning, not just keywords
- AI ask — a retrieval-augmented endpoint that synthesizes a streamed answer from your content in response to a natural-language question
Semantic search and AI features require a paid plan. Projects on the free tier cannot use embedding-based endpoints.
What Gets Embedded
Sublay embeds the following content types automatically, with no configuration required beyond enabling the feature:
Embeddings are generated asynchronously after content is created or updated.
Semantic Search
There are three search endpoints, each scoped to a different content domain:Search Content
Searches across entities, comments, and chat messages. You can filter by source type and optionally scope results to a specific space or conversation.- Parameters:
query,sourceTypes(array of"entity" | "comment" | "message"),spaceId(optional),conversationId(optional),limit - Returns: Array of results, each with
sourceType,similarityscore (0–1), and the full hydratedrecord(entity, comment, or message object)
Search Users
Searches user profiles by semantic similarity to the query. Useful for finding users by description, interests, or bio content.- Parameters:
query,limit - Returns: Array of results, each with
similarityscore and the fullrecord(user object)
Search Spaces
Searches spaces by semantic similarity.- Parameters:
query,limit - Returns: Array of results, each with
similarityscore and the fullrecord(space object)
similarity field (cosine similarity, 0–1) alongside the hydrated record, so you can display or filter by relevance score.
AI Ask
The ask endpoint takes a natural-language question, retrieves the most relevant content chunks from your project, and streams a synthesized answer using an LLM — grounded entirely in your content.How It Works
1
Query embedding
The question is embedded into a vector using the same model used for content.
2
Retrieval
The most semantically similar content is retrieved from your project’s embeddings. Results can be scoped to a specific space or conversation.
3
Generation
The retrieved content is used as context for the LLM, which synthesizes an answer grounded in your data. If the context does not contain enough information to answer, the model says so.
4
Streaming response
The answer is streamed back via Server-Sent Events (SSE). After the answer completes, a
sources event delivers the hydrated source records that were used as context.Response Format (SSE)
The ask endpoint responds withContent-Type: text/event-stream. Events are delivered in this order:
Parameters
SDK Integration
The SDK provides hooks for all three search endpoints and the ask endpoint:useSearchContent— search entities, comments, and messagesuseSearchUsers— search user profilesuseSearchSpaces— search spacesuseAskContent— ask a question and receive a streamed answer

