Use this file to discover all available pages before exploring further.
Session 22 of Going Meta, broadcast on November 7, 2023, introduces Retrieval Augmented Generation (RAG) with knowledge graphs. Jesus Barrasa picks up the dev.to article graph built in Session 21 and extends it into a full RAG pipeline: a Neo4j vector index retrieves the most relevant chunks, graph traversal enriches the context with structured relationships, and an LLM generates a final answer grounded in both sources.
The session’s key contribution is showing how graph traversal produces not just a list of similar articles, but a textual explanation of the similarity path — ready to inject directly into an LLM prompt as grounded context:
MATCH (a:Article { uri: "https://dev.to/qainsights/performance-testing-neo4j-database-using-bolt-protocol-in-apache-jmeter-1oa9" })-[rt1:refers_to]->(c1)CALL n10s.sim.pathsim.search(c1, 0.2, { simulateRoot: false }) YIELD node AS relatedTopicWITH a, c1, collect(relatedTopic) + [c1] AS topicsUNWIND topics AS c2MATCH (similarArticle:Article)-[rt2:refers_to]->(c2)WITH a.title AS original, similarArticle.title AS similar, [x IN collect(n10s.sim.pathsim.value(c1, c2, { simulateRoot: false })) WHERE x > 0] AS sims, collect( ["the original article mentions explicitly " + nodes(n10s.sim.pathsim.path(c1, c2, { simulateRoot: false }))[0].prefLabel] + [" the recommended article mentions explicitly " + nodes(n10s.sim.pathsim.path(c1, c2, { simulateRoot: false }))[-1].prefLabel] + [r IN relationships(n10s.sim.pathsim.path(c1, c2, { simulateRoot: false })) | startNode(r).prefLabel + " is a type of " + endNode(r).prefLabel] ) AS paths_as_textWHERE sims <> []RETURN original, similar, apoc.coll.avg(sims) AS sim, sims, reduce(result = "", x IN paths_as_text | result + reduce(inner = "", y IN x | inner + "\n" + y))ORDER BY sim DESC LIMIT 4
The paths_as_text output — e.g. “the original article mentions Apache JMeter, the recommended article mentions Gatling, Apache JMeter is a type of Load Testing Tool” — provides a factual, traceable context string you can append to an LLM prompt to prevent hallucination.
Fast and scalable. Retrieves documents by embedding similarity. Works without a knowledge graph but cannot explain why results are relevant.
Graph-Enhanced RAG
Retrieves documents via ontology path traversal. Slower but explainable — the graph can generate a natural-language justification for each recommendation.
Hybrid RAG
Use the vector index for broad candidate retrieval, then re-rank or enrich with graph context. Combines speed with explainability.
Ontology as Knowledge Layer
The SKOS/OWL ontology acts as the structured background knowledge that makes graph-based retrieval work — a key differentiator vs. pure embedding approaches.
The full RAG pipeline (retrieval + LLM call + answer generation) is implemented in the Python notebook accompanying this session, available in the GitHub repository.