Skip to content
SK
All projects
DeliveredRAGEnterprise AIClient work

Clinical Knowledge Graph RAG

A clinical Q&A retrieval system that moved from hybrid-search RAG to Graph RAG once relationship modeling became the real bottleneck.

Context
Avira Digital Technologies — BMS client
Period
2025 — 2026
My role
ML Associate — built and evaluated the initial RAG pipeline, contributed to the Graph RAG redesign and the natural-language-to-query translation layers.

The problem

Researchers needed to ask free-text questions across clinical trial, drug and disease data — but the answers depend on many-to-many drug–disease–dosage relationships that chunk-based retrieval flattens and loses.

Why it needed solving

A conventional RAG pipeline retrieves passages that look similar to the question. That works for definitional lookups and fails for relationship questions, where the answer is not contained in any single chunk but in how entities connect. Establishing that limit empirically was what justified the redesign.

The approach

Build the conventional pipeline first, evaluate it honestly, identify exactly where it broke, then model the domain as a graph and translate natural-language questions directly into graph queries.

Architecture

  • Ingestion — clinical trial, drug and disease sources, chunked with metadata tagging so retrieval can filter as well as match.
  • Retrieval v1 — hybrid retrieval combining semantic vector search with BM25 lexical search.
  • Knowledge graph — entities and relationships modeled in Neo4j, capturing drug–disease–dosage links explicitly rather than implicitly.
  • Scale evaluation — AWS Neptune assessed as an alternative for larger-scale ingestion.
  • Query translation — agent-based layers converting free-text clinical questions into Cypher (Neo4j) and Gremlin (Neptune).
  • Serving — a research-facing Q&A chatbot over the retrieval layer.

Implementation

  • Built the metadata-tagged chunking strategy so retrieval could constrain by trial, drug or disease rather than relying on embedding similarity alone.
  • Combined semantic and BM25 retrieval to cover both paraphrased and exact-term clinical queries.
  • Evaluated the pipeline against relationship-heavy questions and documented where it could not represent many-to-many links.
  • Modeled entities and relationships in Neo4j and contributed to the Graph RAG redesign built on that model.
  • Built natural-language-to-Cypher and natural-language-to-Gremlin translation workflows so researchers never write query syntax.
  • Iterated on embedding and metadata strategies to improve entity-relationship linking.

AI/ML components

Hybrid retrieval — dense vector search + BM25

Metadata-aware chunking and filtered retrieval

Graph RAG over a Neo4j clinical knowledge graph

Agent-based natural-language-to-Cypher translation

Agent-based natural-language-to-Gremlin translation

Retrieval evaluation across pipeline variants

Challenges & how they were handled

Chunk-based retrieval cannot represent many-to-many drug–disease–dosage relationships — the information exists between records, not inside one.

Modeled those relationships explicitly as graph edges in Neo4j so a relationship question becomes a traversal instead of a similarity search.

Clinical researchers ask questions in natural language; graphs answer in Cypher and Gremlin.

Agent-based translation layers for both query languages, bridging free text and graph traversal.

Neo4j suited the modeling work, but larger-scale ingestion raised different constraints.

Evaluated AWS Neptune against the same workload to understand the scaling trade-off before committing.

Results

Findings informed the team's subsequent RAG architecture decisions

Architecture outcome

What comes next

  • Expand relationship coverage beyond drug–disease–dosage to additional clinical entity types.
  • Formalize retrieval evaluation for graph traversal answers, not just passage relevance.

Related work

ActiveClient work

Athena — Enterprise Agentic AI Platform

Avira Digital Technologies — internal product

Provider-agnostic LLM gateway, MCP tool servers, layered agent memory, guardrails and an LLM-as-judge evaluation harness.

LangChainCrewAILangGraphMCPSSE+7 more
ActiveClient work

Agentic Data Structuring & Query Platform

Avira Digital Technologies — BMS client

An orchestrator/sub-agent pipeline that turns raw multi-source data into tagged, queryable records — and answers questions about it in plain English.

LangGraphMCPTopic ModelingPostgreSQLPython+2 more