Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/avnlp/agentic-med-diag/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through everything needed to get the Agentic Graph RAG pipeline running locally. By the end you will have cloned the repository, installed all Python dependencies with uv, started Neo4j and Milvus in Docker, selected a Graph RAG backend, and executed your first multi-hop clinical query. The whole process takes under ten minutes on a machine with Docker already installed.
The codebase is actively being developed and the full implementation will be released soon. The usage snippet in Step 7 is illustrative of the described architecture and will be updated to reflect the final API once the code ships.
1

Prerequisites

Make sure the following tools are available on your machine before proceeding:
ToolPurposeMinimum Version
PythonRuntime for all pipeline code3.10+
uvFast Python package and project managerlatest
DockerRuns Neo4j and Milvus containers locallyany recent version
GitClones the repositoryany
You will also need access to an LLM API (for example, an OpenAI API key) to power the reasoning steps inside the pipeline.
2

Clone the Repository

Clone the project from GitHub and change into its directory:
git clone https://github.com/avnlp/agentic-med-diag.git
cd agentic-med-diag
3

Install Dependencies

This project uses uv for dependency management. If you do not have uv installed yet, install it first, then let it sync the project’s locked dependencies:
pip install uv
uv sync
uv sync reads the project’s lockfile and installs all dependencies into a project-local virtual environment — no manual venv creation is required.
4

Start Neo4j

Neo4j stores the entity/relationship knowledge graph built from your medical documents. Start a local instance with Docker:
docker run --name neo4j \
  -p 7474:7474 -p 7687:7687 \
  -e NEO4J_AUTH=neo4j/password \
  neo4j:latest
Once the container is running, the Neo4j Browser is available at http://localhost:7474. The Bolt connection used by the pipeline listens on port 7687.
5

Start Milvus

Milvus stores dense vector embeddings for the semantic retrieval channel. Start a standalone Milvus instance with Docker:
docker run -d --name milvus-standalone \
  -p 19530:19530 -p 9091:9091 \
  milvusdb/milvus:latest \
  milvus run standalone
The Milvus gRPC endpoint used by the pipeline listens on port 19530.
6

Choose a Backend

The pipeline supports four Graph RAG backends, each with a different graph construction and retrieval strategy:
BackendRetrieval modeBest for
LightRAGHybrid (KG traversal + dense vector)General-purpose, balanced depth and speed
MiniRAGLight (nearest-neighbourhood only)Resource-constrained environments
PathRAGHybrid (two-tier hierarchy, path-based)Questions requiring multi-hop chain-of-evidence
HyperGraphRAGHybrid (hyperedge traversal + dense vector)Group interactions among multiple medical concepts
For this quickstart, use LightRAG — it is the most general-purpose backend and requires no additional configuration beyond what you have already set up.
7

Run a Query

Once the code is released, you will be able to run a multi-hop medical query through the pipeline. The following snippet illustrates the intended usage based on the described architecture:
# Illustrative usage — reflects the described architecture.
# The final API will be published with the code release.

from agentic_med_diag import AgenticMedDiagPipeline

# Initialise the pipeline with the LightRAG backend
pipeline = AgenticMedDiagPipeline(
    backend="lightrag",       # one of: lightrag, minirag, pathrag, hypergraphrag
    neo4j_uri="bolt://localhost:7687",
    neo4j_username="neo4j",
    neo4j_password="password",
    milvus_host="localhost",
    milvus_port=19530,
)

# Submit a complex clinical question
question = (
    "What are the contraindications for metformin in a patient "
    "with type 2 diabetes, chronic kidney disease stage 3, "
    "and elevated serum lactate?"
)

result = pipeline.query(question)
print(result.answer)
The pipeline will decompose the question into sub-queries, run parallel semantic and relational retrieval hops, and synthesize a final grounded answer.

Next Steps

Now that your environment is running, explore the deeper concepts behind the system:
  • Architecture — understand the LangGraph state machine, the fan-out/fan-in pattern, and how the dual retrieval channels are orchestrated.
  • Backends Overview — compare LightRAG, MiniRAG, PathRAG, and HyperGraphRAG in detail, including their indexing strategies, retrieval modes, and context-filter logic.

Build docs developers (and LLMs) love