Skip to main content

Overview

Embeds the query and performs cosine similarity search against indexed code chunks, returning the most semantically relevant snippets with file paths and line numbers. If the codebase is not yet indexed, it will be indexed automatically first.

Parameters

Example

Returns:

Notes

  • Queries are limited to 500 characters
  • Results include file path, line range, similarity score, and the code snippet
  • Auto-indexes on first call if no index exists for the given path
  • min_score is clamped to [0.0, 1.0]. The default of 0.35 removes noisy low-confidence matches without affecting relevant results
  • Use hybrid_search when you also want graph-structural context in the results