# An open-source knowledge graph-powered RAG system that combines a 7.1M-node Neo4j graph (35M relationships, 12M EXTRACTED\_FROM edges) with UMLS clinical reasoning path traversal for precise retrieval over medical and scientific literature

**URL:** <https://community.neo4j.com/t/an-open-source-knowledge-graph-powered-rag-system-that-combines-a-7-1m-node-neo4j-graph-35m-relationships-12m-extracted-from-edges-with-umls-clinical-reasoning-path-traversal-for-precise-retrieval-over-medical-and-scientific-literature/77989>\
**Category:** Projects & Collaboration\
**Tags:** projects, knowledge-graph, llm, vector-search, graphrag\
**Created:** [May 18, 2026, 6:38pm UTC](https://community.neo4j.com/t/an-open-source-knowledge-graph-powered-rag-system-that-combines-a-7-1m-node-neo4j-graph-35m-relationships-12m-extracted-from-edges-with-umls-clinical-reasoning-path-traversal-for-precise-retrieval-over-medical-and-scientific-literature/77989 "2026-05-18T18:38:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeujaiwu](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/jeujaiwu/32/35970_2.png) [@jeujaiwu](https://community.neo4j.com/u/jeujaiwu)\
**Post date:** [May 18, 2026, 6:38pm UTC](https://community.neo4j.com/t/an-open-source-knowledge-graph-powered-rag-system-that-combines-a-7-1m-node-neo4j-graph-35m-relationships-12m-extracted-from-edges-with-umls-clinical-reasoning-path-traversal-for-precise-retrieval-over-medical-and-scientific-literature/77989/1 "2026-05-18T18:38:50Z")

</div>

I built an open-source knowledge graph-powered RAG system for medical and scientific literature. The retrieval pipeline runs on a Neo4j graph with 7.1M nodes, 35M relationships, and 12M EXTRACTED\_FROM edges connecting concepts back to their source document chunks.

The core insight: pure vector semantic search degrades as you add documents. Upload a 10,000-page medical textbook and previously retrievable content falls below the similarity threshold because the embedding index shifts. The knowledge graph is immune to this — concept-to-chunk pointers are structural, not probabilistic.

The retrieval runs four concurrent Cypher traversal strategies per concept pair, ordered by clinical specificity: UMLS 1-hop (via SAME\_AS bridges to 1.6M UMLS concepts), UMLS 2-hop (intermediate clinical reasoning paths), direct inter-concept edges, and shared EXTRACTED\_FROM chunk co-occurrence. A 35-relationship-type whitelist filters out noise from the 13.9M available UMLS edges. All four strategies run via asyncio.gather so latency is bounded by the slowest query, not the sum.

Stack: Neo4j + Milvus + Python/FastAPI, with Ollama for local bridge generation and vision OCR. All Dockerized, runs fully locally.

Full write-up: [https://dev.to/peter\_wu\_8ad6dcfb10c6f20d/how-i-built-a-rag-system-with-a-7-million-node-knowledge-graph-and-why-vector-search-alone-isnt-4f3e](https://dev.to/peter_wu_8ad6dcfb10c6f20d/how-i-built-a-rag-system-with-a-7-million-node-knowledge-graph-and-why-vector-search-alone-isnt-4f3e)

Repo: [GitHub - jeujai/Librarian · GitHub](https://github.com/jeujai/Librarian)
