This repository now implements an end-to-end ARG detection pipeline with retrieval and reasoning:
- Modular alignment backend (
modules/alignment/) - CARD retrieval module (
modules/retrieval/) - Prompt engineering module (
modules/prompt_engineering/) - LLM reasoning and validation (
modules/llm_reasoning/) - Report generation (
modules/report_generation/) - End-to-end orchestration (
modules/pipeline/) - FastAPI upload/process/status/results API (
api/) - Framework-free frontend dashboard (
frontend/)
config/settings.py
modules/alignment/{base.py, parser.py, diamond_runner.py, blast_runner.py}
api/{main.py, models.py, job_store.py, routes/{upload.py, process.py, results.py}}
frontend/{index.html, app.js, api.js, styles.css}
- Python 3.10+
- DIAMOND executable available either:
- as
diamond.exe(Windows) ordiamond(Linux/macOS) in the project root, or - in system
PATHasdiamond
- as
- A built DIAMOND database, for example
card_db.dmnd
Windows (PowerShell):
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r requirements.txt
copy .env.example .envLinux/macOS (bash/zsh):
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .envStart backend:
uvicorn api.main:app --reloadOpen frontend in browser:
http://127.0.0.1:8000/frontend/index.html
POST /upload- upload.fasta,.fa,.fna,.txtPOST /process/{job_id}- run full RAG pipeline in backgroundGET /status/{job_id}- check job stateGET /results/{job_id}- fetch candidate hits, validation output, and report data
- DIAMOND is the active alignment runner in this implementation.
- If no configured LLM is available, validation gracefully falls back to a heuristic validator.
- To use Gemini reasoning, set
GEMINI_API_KEYand keepLLM_PROVIDER=gemini.
Run the bundled sample benchmark dataset in one command:
python scripts/run_sample_benchmark.pyThis writes metrics to:
outputs/benchmark/sample_metrics.json
To enable automatic benchmark output during pipeline runs, configure in .env:
BENCHMARK_ENABLED=trueBENCHMARK_TRUTH_PATH=data/benchmark/sample_truth.jsonBENCHMARK_OUTPUT_PATH=outputs/benchmark/benchmark_metrics.json
Run all tests:
python -m pytest -qIncluded tests now cover:
- Validator fallback behavior (invalid JSON and timeout)
- Batch validation JSON parsing
- FASTA validation edge cases
- JSON report snapshot drift detection
- API upload/process/status/results end-to-end flow
- Sample benchmark script output generation