Knowledge Graph-based RAG

Learn how to retrieve context from a knowledge graph in Neo4j based on user queries and generate responses using the retrieved information.

KG-based retrieval-augmented generation (RAG) process

The KG-based retrieval-augmented generation (RAG) process begins when a user submits a query through the chatbot. The query text is first processed by an LLM to extract relevant entities. These entities are then used to query the Neo4j knowledge graph using a Cypher query to match entities, retrieving the associated relationship tuples. The original query is augmented by combining it with the extracted entities and relationships. This augmented query, containing the user’s input and the retrieved context, is passed to the LLM to generate a final response, as illustrated in the following slide deck:

Get hands-on with 1400+ tech skills courses.