Skip to main content
Version: latest

agrag.vectordb.placement.validate_placement

validate_placement(graph_store:GraphStore, *, vector_store:VectorStore | None, dimensions:int, distance:Distance, write:bool, check_embedding:bool = True) -> None

Compare placement, creating it on first open only when write is true.

The store and collection prefix always have to match. Dimensions and distance describe the embedding, so they are compared only when check_embedding is true. A reader that checks the embedding on each search can leave that check to the search.

Parameters:

  • graph_store (GraphStore) – The graph that holds the placement record.
  • vector_store (VectorStore | None) – The external store in use, or None for graph-native indexes.
  • dimensions (int) – The dimensions of the embedding in use.
  • distance (Distance) – The distance metric of the embedding in use.
  • write (bool) – Whether to record the placement when the graph has none.
  • check_embedding (bool) – Whether to compare dimensions and distance.

Raises: