Skip to main content
The search module provides server-side access to Replyke’s search and AI capabilities. Use it to build search APIs, power recommendation engines, or answer natural-language questions about your content.

searchContent

Searches entities by full-text query, optionally scoped to a space.
const { data, metadata } = await replyke.search.searchContent({
  query: "getting started guide",
  spaceId: "spc_abc123",
  page: 1,
  limit: 10,
});
query
string
required
The search query string.
spaceId
string
Scope the search to a specific space.
page
number
Page number (1-indexed). Defaults to 1.
limit
number
Results per page. Defaults to 20.
ReturnsPromise<PaginatedResponse<Entity>>

searchUsers

Searches for users by name or username.
const { data, metadata } = await replyke.search.searchUsers({
  query: "alice",
  page: 1,
  limit: 10,
});
query
string
required
The search query string.
page
number
Page number (1-indexed). Defaults to 1.
limit
number
Results per page. Defaults to 20.
ReturnsPromise<PaginatedResponse<User>>

searchSpaces

Searches for spaces by name or description.
const { data, metadata } = await replyke.search.searchSpaces({
  query: "photography",
  page: 1,
  limit: 10,
});
query
string
required
The search query string.
page
number
Page number (1-indexed). Defaults to 1.
limit
number
Results per page. Defaults to 20.
ReturnsPromise<PaginatedResponse<Space>>

askContent

Asks a natural-language question about your content and returns an AI-generated answer with source references.
This feature requires semantic search to be enabled for your project. See the Semantic Search & AI guide for setup instructions.
const { answer, sources } = await replyke.search.askContent({
  question: "What are the best practices for error handling?",
  spaceId: "spc_abc123",
});

// answer: "Based on the content in this space, best practices include..."
// sources: [{ entityId: "ent_xyz", title: "Error Handling Guide" }, ...]
question
string
required
The natural-language question to answer.
spaceId
string
Scope the search to content within a specific space.
ReturnsPromise<{ answer: string; sources?: Array<{ entityId: string; title: string }> }>