Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Query the Precision Medicine Knowledge Graph (PrimeKG) for multiscale biological data including genes, drugs, diseases, phenotypes, and more.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | -9% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 18% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 61% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -29% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -12% | 0% |
PrimeKG is a precision medicine knowledge graph that integrates over 20 primary databases and high-quality scientific literature into a single resource. It contains over 100,000 nodes and 4 million edges across 29 relationship types, including drug-target, disease-gene, and phenotype-disease associations.
Key capabilities:
Data access: Programmatic access via query_primekg.py. Data is stored at C:\Users\eamon\Documents\Data\PrimeKG\kg.csv.
This skill should be used when:
Find identifiers for genes, drugs, or diseases.
pythonfrom scripts.query_primekg import search_nodes # Search for Alzheimer's disease nodes results = search_nodes("Alzheimer", node_type="disease") # Returns: [{"id": "EFO_0000249", "type": "disease", "name": "Alzheimer's disease", ...}]
Retrieve all connected nodes and relationship types.
pythonfrom scripts.query_primekg import get_neighbors # Get all neighbors of a specific disease ID neighbors = get_neighbors("EFO_0000249") # Returns: List of neighbors like {"neighbor_name": "APOE", "relation": "disease_gene", ...}
A high-level function to summarize associations for a disease.
pythonfrom scripts.query_primekg import get_disease_context # Comprehensive summary for a disease context = get_disease_context("Alzheimer's disease") # Access: context['associated_genes'], context['associated_drugs'], context['phenotypes']
The graph contains several key relationship types including:
protein_protein: Physical PPIsdrug_protein: Drug target/mechanism associationsdisease_gene: Genetic associationsdrug_disease: Indications and contraindicationsdisease_phenotype: Clinical signs and symptomsgwas: Genome-wide association studies evidenceget_neighbors, ensure you have the correct ID from search_nodes.get_disease_context for a broad overview before diving into specific genes or drugs.relation_type filter in get_neighbors to focus on specific evidence (e.g., only drug_protein).OpenTargets for deeper genetic evidence or Semantic Scholar for the latest literature context.scripts/query_primekg.py: Core functions for searching and querying the knowledge graph.kg.csv, downloaded from the PrimeKG Harvard Dataverse.export PRIMEKG_DATA=/path/to/kg.csv (default: data/PrimeKG/kg.csv).Other measured skills in the registry, with their headline benchmark lift.