Reference
Remy Reference/agent/dataSources.search
?

dataSources.search

Searches a corpus in plain language, using hybrid retrieval and reranking, and returns each result with a citation.
DataSource.search(query, options?) → { results, mode?, latencyMs }

Searches the corpus and returns passages ranked by relevance, each with a citation to its source region; retrieval is hybrid by default (semantic plus exact keyword, so part numbers, error codes, and proper nouns still land), and the candidates are then reranked by a cross-encoder. It is deterministic for a fixed corpus and configuration, so an eval set built on it stays meaningful, and it returns a mode object alongside results describing what actually ran, the first thing to check when a result does not match the options you passed. Searching a corpus that does not exist yet returns no results rather than throwing.

Parameters
query
string
RequiredA plain-language question, or an identifier like an error code when using lexical mode.
options
SearchOptions
topK, filter, mode, maxPerDocument, rerank, hybrid, highlight, explain, and expand. Defaults come from the corpus.
Search with a metadata filter
const { results } = await Policies.search('early termination clause', {
  topK: 5,
  filter: { metadata: { department: 'legal' } },
});
for (const hit of results) {
  console.log(hit.score, hit.citation.url); // { score, text, citation }
}