- Newest
- Most votes
- Most comments
From our example notebook on using Vector Embeddings in Neptune Analytics (https://github.com/aws/graph-notebook/blob/main/src/graph_notebook/notebooks/02-Neptune-Analytics/02-Graph-Algorithms/06-Vector-Similarity-Algorithms.ipynb):
Manage an Embedding
In Neptune Analytics, the embedding for each node is stored as a kind of "hidden" property that is not returned using standard openCypher. To manage these embeddings, we provide several algorithms to perform standard CRUD operations:
-
neptune.algo.vectors.get: This will retrieve and return the specified node's embedding.
-
neptune.algo.vectors.upsert: This will update or insert the provided embedding to the specified node.
-
neptune.algo.vectors.remove: This will remove the specified node's embedding.
These algorithms can be combined with other openCypher clauses to perform more complex patterns, such as upserting a node with an externally generated embedding at the time of creation.
Using our air routes data, let's show how to return the embeddings of both the Seattle and Anchorage airports.
%%oc
MATCH (n)
WHERE n.code in ['SEA', 'ANC']
CALL neptune.algo.vectors.get(n)
YIELD node, embedding
RETURN n.code, embedding
Relevant content
- asked 5 years ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 8 months ago