MicrobiomeKG¶
A microbiome knowledge graph on kglite, with the evidence model as the point: every association edge carries its study design, direction, sample sizes and citing paper, and the measured negatives — “tested and nothing happened” — are kept as their own relationships rather than folded away.
Install the package from PyPI:
python -m pip install microbiomekg
Prepare, fetch and build over one data directory:
import microbiomekg as mkg
data = "./my-data"
mkg.prepare(data) # create input directories and print what each file needs
mkg.fetch(data, missing=True) # fetch missing automatic inputs, then report again
result = mkg.build(data) # build from what is present; no file saved by default
microbiomekg status --data ./my-data --create
microbiomekg fetch --data ./my-data --missing
microbiomekg build --data ./my-data
microbiomekg serve --graph graph/microbiomekg.kgl # the MCP server, read-only
No data and no built graph ships: 26% of evidence-bearing edges have no redistribution permission, so what ships is the pipeline.
Guides
- Getting started
- Use cases and pitfalls — the user contract
- Queries by task — one statement per endpoint group
- The graph model
- 1. Node types
- 2. Edge types and the evidence contract
- 3. Taxon reconciliation
- 4. The ontology declaration
- 5. Storage: microbial scope, default (in-memory)
- 6. Text search (BM25,
build_text_index) - 6b. Semantic name lookup — opt-in (
--with-vectors, character n-grams,text_score) - 7. Demo queries
- 8. Building it, and what the blueprint could not express
- Sources
- Summary
- Redistribution: what blocks shipping a built graph
- 1. NCBI Taxonomy
- 2. BugSigDB
- 3. Disbiome
- 4. HMDB
- 5. CARD
- 6. Reactome
- 7. KEGG
- 8. ChEMBL
- 9. gutMDisorder
- 10. PubMed / PubChem
- 11. MONDO (disease id hub) — added by the coordinator, 2026-09-02
- 12. MiMeDB
- 13. NJC19
- 14. MASI
- 15. Maier 2018 — the drug screen, and the source that actually closed D8
- 16. Zimmermann 2019 — the metabolism screen, and the source that closed D8
- 17. Reference sets — scored against, never loaded
- How
scripts/fetch.pybehaves
- Evaluation — does the graph serve the user stories?
- Benchmarks — what the graph reproduces, and against what
Design notes