Skip to main content
Version: latest

agrag.retrieval.methods.vector.vector_search

vector_search(query:str, *, embedder:Embedder, graph_store:GraphStore, labels:Sequence[str], limit:int, filters:SearchFilters | None, query_vector:Sequence[float] | None = None, tracer:Tracer | None = None) -> list[VectorHit]

Embed query and run GraphStore's native vector search for each label.

One native vector index exists per label, so a search over several labels is several searches. The results are merged and ranked by score.

The vector query excludes records an in-flight Cutover Job wrote, so a caller never receives an uncommitted job's node or vector.

Parameters:

  • query (str) – The natural-language query text to embed.
  • embedder (Embedder) – Produces the query's dense vector.
  • graph_store (GraphStore) – Runs the native vector search.
  • labels (Sequence[str]) – The node labels to search, each backed by its own vector index.
  • limit (int) – Maximum hits to return.
  • filters (SearchFilters | None) – Constraints applied as node property filters. Labels choose the searched indexes, so they are not sent as property filters.
  • query_vector (Sequence[float] | None) – Precomputed query embedding. None embeds query.
  • tracer (Tracer | None) – Opens the search span. None opens no recorded span.

Returns:

Raises:

  • ValueError – No labels were given to search.