Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vector search #1005

Draft
wants to merge 1 commit into
base: memgraph-2-21
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pages/querying/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"expressions": "Expressions",
"schema": "Schema",
"text-search": "Text search",
"vector-search": "Vector search",
"time-to-live": "Time to live",
"query-plan": "Query plan",
"exploring-datasets": "Exploring datasets"
Expand Down
67 changes: 67 additions & 0 deletions pages/querying/vector-search.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: Vector search
description: Learn how to use vector search and manage vector indices in Memgraph.
---

import { Callout } from 'nextra/components'

# Vector search

TODO(gitbuda): Explain why and what?

## Create vector indices

Vector indices are created with the `CREATE VECTOR INDEX` command. You need to give
a name to the new index and specify which label and property it should apply to.

```cypher
CREATE VECTOR INDEX vectorIndexName ON :Label(property) OPTIONS { config };
```

If you attempt to create an index with an existing name, the statement will fail.

## TODO(gitbuda): What is indexed and how?

## Show vector indices

To list all vector indices in Memgraph, use the `SHOW INDEX INFO`
[statement](/fundamentals/indexes#show-created-indexes).

## TODO(gitbuda): Query vector indices

```
CALL vector_search.query_nodes('vectorIndexName', 10, [1.0, 2.0, ...])
YIELD node, score
RETURN node, score;
```

## TODO(gitbuda): Import hints

## Drop vector indices

Vector indices are dropped with the `DROP VECTOR INDEX` command. You need to give
the name of the index to be deleted.

This statement drops the vector index named `vectorIndexName`:

```cypher
DROP VECTOR INDEX vectorIndexName;
```

If one attempts to delete an index with the same name twice, the statement will
fail.

## Compatibility

Vector search supports usage modalities that are available in Memgraph. Refer
to the table below for an overview:

| Feature | Support |
|-------------------------|-----------|
| Multitenancy | todo |
| Durability | todo |
| Storage modes | todo |
| Replication | todo |
| Concurrent transactions | todo |

## TODO(gitbuda): In-memory vs On-disk + memory vs time