Agentic Medical Diagnosis System With Hierarchical Knowledge Graphs Built on Neo4j
I've built Agentic GraphRAG for Medical Diagnosis (https://github.com/avnlp/agentic-med-diag), an end-to-end system combining a schema-driven Neo4j knowledge graph with LangGraph orchestration, multi-strategy vector search, hybrid retrieval (dense + BM25), and an agentic plan–research–verify loop for evidence-grounded clinical QA.
Neo4j architecture:
- Typed property graph with 5 node labels (Document, Chunk, Entity, Community, CommunityReport) and 7 edge types
- Schema-driven entity and relation extraction with union/intersection/max-score combination strategies
- Deterministic SemHash/MinHash pre-filter + clustering for two-stage entity resolution
- Hierarchical Leiden community detection (Graspologic + Neo4j GDS backends)
Knowledge Graph Construction
- Schema-driven extraction with 13 entity types and 25 clinically-grounded relation types
- Three-extractor fusion (GLiNER, GLiREL, LLM) with configurable merge strategies
- Deterministic + LLM-powered entity resolution for deduplication
Layered Retrieval Architecture
- Four vector collections (entity, relation, chunk, community report)
- Multiple atomic methods: hybrid search, fulltext, BFS graph traversal, and text-to-Cypher graph querying
- Pluggable rerankers (RRF, cross-encoder, MMR)
- Data-driven recipes for composing retrieval strategies
Agentic Plan–Research–Verify Loop
- Planner decomposes clinical questions into focused sub-questions
- Parallel researchers execute multi-strategy retrieval with citations
- Verifier assesses coverage and gates synthesis on sufficiency
- Gracefully converges on missing information across iterations
The stack is battle-tested: Neo4j + Weaviate/Qdrant for storage, LangGraph for orchestration, DeepAgents for multi-agent coordination, and BAML for type-safe LLM schema injection. Tested on MedQA, MedXpertQA, MedCaseReasoning, and MMLU-Pro benchmarks.