Quickstart & Installation
Relevant source files
The following files were used as context for generating this wiki page:
The Agentic GraphRAG for Medical Diagnosis system is a specialized framework designed to ingest medical literature, construct structured clinical knowledge graphs, and provide agent-based diagnostic reasoning. It integrates local zero-shot extraction (GLiNER/GLiREL), hierarchical community detection, and multi-agent reasoning loops to answer complex medical questions.
Sources: README.md:1-15
The project uses a modern Python stack centered around uv for dependency management and high-performance asynchronous components for graph construction and retrieval.
Sources: CONTRIBUTING.md:10-15, pyproject.toml:7-12
Prerequisites & System Requirements
The system requires specific infrastructure and software versions to operate effectively:
- Python Version: ≥ 3.11
- Dependency Manager: uv
- Infrastructure:
- Graph Database: Neo4j (for knowledge graph storage)
- Vector Store: Qdrant or Weaviate (for semantic search)
- LLM API: OpenAI-compatible endpoint (GPT-5/mini supported)
Sources: CONTRIBUTING.md:10-31, pyproject.toml:11
Installation Steps
1. Environment Setup
Clone the repository and install the uv tool if not already present. Use uv sync to install all project dependencies and development tooling.
git clone https://github.com/avnlp/agentic-med-diag.git
cd agentic-med-diag
pip install uv
make sync
Sources: CONTRIBUTING.md:17-25, README.md:275-280
2. Dependency Configuration
The project defines its core dependencies in pyproject.toml, including libraries for machine learning, graph databases, and LLM orchestration.
| Dependency Type | Key Packages |
|---|---|
| LLM & Agentic | openai, langgraph, baml-py, deepagents |
| Extraction | gliner, glirel |
| Database | neo4j, qdrant-client, weaviate-client |
| Data Processing | pydantic, numpy, scipy, scikit-learn |
| NLP | sentence-transformers, rank-bm25, markitdown |
Sources: pyproject.toml:23-53
3. Environment Variables
Copy the example environment file and configure your credentials for the required services.
cp .env.example .env
Key configuration parameters required in .env:
NEO4J_URI,NEO4J_USER,NEO4J_PASSWORDQDRANT_URLAGENT_BASE_URL,AGENT_API_KEY,AGENT_MODEL
Sources: CONTRIBUTING.md:27-31, README.md:288-297
Development Workflow
The project utilizes a Makefile to streamline common development tasks.
The diagram above illustrates the recommended sequence for environment setup and verification.
Sources: CONTRIBUTING.md:88-100
Key Development Commands
make sync: Syncs the virtual environment usinguv.make lint-all: Runs Ruff for formatting/linting andtyfor type checking.make baml-gen: Regenerates the typed LLM client from.bamlsource files.make test: Runs unit tests (disables network access by default).
Sources: CONTRIBUTING.md:88-100, pyproject.toml:115-125
System Architecture Overview
The installation facilitates two primary data flows: Ingestion and Retrieval.
The system flows from raw text ingestion into a structured graph, which is then queried by a multi-agent reasoning loop.
Sources: README.md:118-124, am_diag/ingestion/extraction_pipeline.py:100-140
Verifying the Installation
After setup, verify the installation by running the ingestion and QA entry points provided as project scripts.
Ingestion CLI
Run the ingestion pipeline to process a medical corpus (e.g., StatPearls):
uv run am-diag-ingest --corpus statpearls --batch-size 50
Sources: README.md:304-306, pyproject.toml:56
QA Runner CLI
Run the question-answering benchmark:
uv run am-diag-qa --datasets medqa --limit 10
Sources: README.md:309-311, pyproject.toml:57
Summary
The installation process sets up a robust environment for medical GraphRAG operations. By utilizing uv for performance and BAML for type-safe LLM interactions, the system ensures a developer-friendly workflow while maintaining the technical rigor required for medical diagnostic reasoning.
Sources: CONTRIBUTING.md:10-15, README.md:11-15