GenAI and GraphRAG

GraphRAG

Retrieval-augmented generation whose context comes from a knowledge graph, so the model can follow the relationships between facts.

Example

A plot search finds a film. The graph around that film holds its cast and its genres.

cypher
MATCH (movie:Movie)
  SEARCH movie IN (
    VECTOR INDEX moviePlots
    FOR $queryVector
    LIMIT 4
  ) SCORE AS similarityScore
RETURN
  movie.title AS title, movie.plot AS plot, similarityScore,
  collect { MATCH (movie)-[:IN_GENRE]->(g) RETURN g.name } AS genres,
  collect { MATCH (movie)<-[:ACTED_IN]-(a) RETURN a.name } AS actors

The search finds four films by plot alone. Following [:IN_GENRE] and [:ACTED_IN] out from each one adds its genres and its cast. The model receives all of it.

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