neo4j-contrib / neomodel

An Object Graph Mapper (OGM) for the Neo4j graph database.
https://neomodel.readthedocs.io
MIT License
939 stars 231 forks source link

Support for Vector indexes #756

Closed mariusconjeaud closed 2 months ago

mariusconjeaud commented 11 months ago

Neo4j added a new type of index in version 5.11 : Vector index

It comes with a set of commands to query it.

But it is still in beta mode, so the set of commands are subject to change, so I suggest we hold off a bit before adding support for this new index type ; but happy to debate.

CyrusOfEden commented 8 months ago

I might just take a stab at this over the holidays. Any tips?

mariusconjeaud commented 8 months ago

So, the _install_node / _install_relationship are the ones where the magic happens (if a node has an index property, it will create an index.

A few tricks here though :

An underlying question is that we should provide a way to make neomodel query using vector indexes, since it's a specific syntax in Cypher (something like CALL db.index.vector.queryNodes) and returns a list of elements with a similarity score. So that would require a separate method I guess ?