create_vector_index
Set up an HNSW vector index for fast similarity search on graph nodes. Requires label, property, dimensions, and metric to index existing and future vectors.
Instructions
Create an HNSW vector index for fast similarity search.
Call this once before using vector_search on a label + property pair. If nodes with the given label already have vector values in the property, they are indexed immediately; future nodes are indexed on insertion.
Args: label: Node label to index (e.g. "Document"). property: Property containing embedding vectors (e.g. "embedding"). dimensions: Vector dimensionality (e.g. 1536 for OpenAI, 384 for MiniLM). If None the engine infers it from existing data. metric: Distance metric — "cosine" (default), "euclidean", "dot_product", or "manhattan". m: HNSW links per node (default 16 inside the engine). Higher values give better recall but use more memory. ef_construction: HNSW construction beam width (default 128 inside the engine). Higher values build a higher-quality index but take longer.
Returns: Confirmation string on success, or an error message.
Example call: create_vector_index("Document", "embedding", 1536, "cosine", m=32, ef_construction=200)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | Yes | ||
| property | Yes | ||
| dimensions | No | ||
| metric | No | cosine | |
| m | No | ||
| ef_construction | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |