Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Semantic search

Semantic search finds knowledge-base chunks whose meaning is closest to your query β€” not just keyword matches. Use search before composing a custom prompt, or rely on useKnowledgeBase: true in sendAI for automatic retrieval.

Method

search({
  senderId: string,
  query: string,
  limit?: number,
  minSimilarity?: number,    // 0.0 – 1.0
  filterbySource?: string,   // matches metadata.source
})
Parameter
Description

query

Natural-language question or keywords

limit

Max results (default server-side)

minSimilarity

Drop hits below this score

filterbySource

Filter by metadata.source from addDocument

Use transport: "http". search returns ranked hits directly from the async call.

search uses the vector store and embedding model on notifier.serverConfig. Pass vectorStore or embedding on the call to override that for one query. Keyword and hybrid search run on Postgres.

β†’ Vector stores and embeddings

Search vs useKnowledgeBase

Approach
Control
Complexity

search then sendAI

You choose which chunks to inject

Higher β€” custom prompts

useKnowledgeBase: true

Platform retrieves automatically

Lower β€” see Chat-style messages

Tuning tips

Goal
Suggestion

Fewer false positives

Raise minSimilarity (e.g. 0.7)

Broader recall

Lower minSimilarity (e.g. 0.3)

Scoped search

Set filterbySource matching metadata.source

Debug empty results

Verify documents exist via listDocuments

Language guides

Language
Guide

JavaScript / TypeScript

Dart / Flutter

Python

Next steps

Last updated