A clinical RAG pipeline for extracting, indexing, and retrieving evidence from Rwanda healthcare guidelines.
# eFiche Clinical RAG — August Corpus and Retrieval Baseline
Local-first, provenance-preserving clinical guideline ingestion and retrieval for eFiche. The
August scope ends at retrieval and evaluation: it does **not** generate medical advice, ingest
patient records, or implement an LLM/chatbot.
## Requirements
- Python 3.11–3.13 (managed automatically by `uv`)
- `uv`
- Docker with Compose, for Qdrant
- Tesseract only when the configurable fallback OCR path is enabled in a later phase
## Reproducible workflow
```powershell
# Install the locked core/dev environment
uv sync
# Start local Qdrant
docker compose up -d qdrant
# Add approved PDFs without renaming or reorganizing them
# Copy files into data/raw/pdfs/ (nested folders are allowed; PDFs remain immutable)
# Phase 2: discover, hash, identify exact duplicates, and create the corpus register
uv run clinical-rag inventory
# Subsequent independently executable August stages
uv run clinical-rag inspect
uv run clinical-rag parse
uv run clinical-rag chunk
uv run clinical-rag validate
uv run clinical-rag index
uv run clinical-rag retrieve "example clinical question" --strategy hybrid --top-k 5
uv run clinical-rag evaluate
uv run clinical-rag report
# Quality checks
uv run pytest
uv run ruff check .
uv run ruff format --check .
```
Commands beyond `inventory` are intentional CLI placeholders until their named implementation
phase is completed; they report that status and do not pretend to process data.
## Data governance
`data/raw/pdfs/` is an immutable input boundary and is ignored by Git except for `.gitkeep`.
The pipeline recursively discovers case-insensitive `.pdf` extensions but never renames, moves,
modifies, deletes, or uploads source files. Document organization and authority are metadata.
Unknown metadata remains null and is marked `NEEDS_REVIEW`.
Generated datasets are also ignored by default. The corpus register is written to
`data/processed/manifests/corpus_register.csv`; it contains SHA-256 has …