GenAI and GraphRAG

vector search

Finding the records whose vectors lie closest to a query vector.

Example

Snow White, and the three films whose plots sit nearest to it.

cypher
MATCH (snowWhite:Movie {title: 'Snow White'})
MATCH (movie:Movie)
  SEARCH movie IN (
    VECTOR INDEX moviePlots
    FOR snowWhite.embedding
    LIMIT 4
  ) SCORE AS similarityScore
RETURN movie.title AS title, similarityScore

FOR identifies the vector to search by. The database returns the four embedding vectors lying closest to Snow White. similarityScore shows how close each one is.

Lessons that use this term

The lesson and course links below open in a new tab.

No published lesson uses this term yet.

All glossary terms