-
Notifications
You must be signed in to change notification settings - Fork 54
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
Document vector similarity functions #913
Document vector similarity functions #913
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
| `vector.similarity.euclidean(a, NULL)` returns `NULL`. | ||
| Both vectors must be of the same dimension. | ||
| Both vectors must be {link-vector-indexes}#indexes-vector-similarity-euclidean[*valid*] with respect to Euclidean similarity. | ||
| The implementation is exactly identical to that of the `latest` available vector index provider (currently `vector-2.0`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we avoid saying words like "currently" in the docs :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @nilsceberg, looks good overall! I have added some release version information, and also have a few editorial suggestions. Let me know what you think :)
These vector similarity functions are identical to those used by Neo4j's {link-vector-indexes}[vector search indexes]. | ||
|
||
Consider for example _k_-nearest neighbor queries, which return the _k_ entities with highest similarity scores based on comparing their associated vectors with a query vector. | ||
Such queries can be run against vector indexes to quickly get an approximate result. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it is clear what "approximate result" means here?
Such queries can be run against vector indexes to quickly get an approximate result. | |
Such queries can be run against vector indexes to return an approximate similarity score. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair. I wanted to avoid restating too much from the vector index documentation, but I'll see if I can clarify this bit.
It's not the score that's approximate; it's whether or not the true nearest neighbours are included in the result set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not assume that people have read that page, so a bit more might be necessary here (maybe something like "return an approximate result indicating whether or not the true nearest neighbors are included in the results".
Consider for example _k_-nearest neighbor queries, which return the _k_ entities with highest similarity scores based on comparing their associated vectors with a query vector. | ||
Such queries can be run against vector indexes to quickly get an approximate result. | ||
However, they can also be expressed as an exhaustive search using similarity functions directly. | ||
While this is typically significantly slower than using an index, it is exact and does not require an existing index. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this is typically significantly slower than using an index, it is exact and does not require an existing index. | |
While vector functions are typically slower than using an index, they are exact and do not require an existing index. |
Co-authored-by: Jens Pryce-Åklundh <[email protected]>
Thanks @JPryce-Aklundh, great suggestions - I'll revisit the part you had questions on. |
@JPryce-Aklundh What do you think about something like this? |
Great @nilsceberg - thanks! We just need to add the page-role indicating 5.18 on the full vector functions page. Are you OK with me fixing that? |
@JPryce-Aklundh Please do, thanks! :) |
You had already added it @nilsceberg :) so I will merge this 👍 |
Thanks for the documentation updates. The preview documentation has now been torn down - reopening this PR will republish it. |
No description provided.