New: Earn 20% as an AgentAlley affiliate. Share your link and earn on every sale you refer. Join now New: Earn 20% as an affiliate. Join now

Query the Precision Medicine Knowledge Graph for multiscale

PrimeKG Knowledge Graph Skill

by K-Dense-AI · MIT license · ★ 45,977 on GitHub · updated Sep 21

PrimeKG Knowledge Graph Skill cover

Query the Precision Medicine Knowledge Graph (PrimeKG) for multiscale biological data including genes, drugs, diseases, phenotypes, and more.

---
name: primekg
description: Query the Precision Medicine Knowledge Graph (PrimeKG) for multiscale biological data including genes, drugs, diseases, phenotypes, and more.
license: Unknown
metadata:
  version: "1.2"
  skill-author: K-Dense Inc. (PrimeKG original from Harvard MIMS)
---

# PrimeKG Knowledge Graph Skill

## Overview

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:**
- Search for nodes (genes, proteins, drugs, diseases, phenotypes)
- Retrieve direct neighbors (associated entities and clinical evidence)

Overview

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.

Manual install (npx, ZIP)
Claude Codenpx skills add K-Dense-AI/scientific-agent-skills --skill primekg -g -a claude-code
Claude Code (manual)mkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/K-Dense-AI/scientific-agent-skills/tar.gz/49c6e97775ea \ | tar -xz -C ~/.claude/skills --strip-components=2 scientific-agent-skills-49c6e97775ea/skills/primekg
Windows (PowerShell)New-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/16cbe39c01af9d367418/primekg.zip" -OutFile "$env:TEMP\primekg.zip"; Expand-Archive "$env:TEMP\primekg.zip" -DestinationPath "$HOME\.claude\skills" -Force
Claude.ai / desktopDownload the ZIP and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md4.8 KB
  • scripts/1 file · 4.9 KB
Read the files here
K-Dense-AI/49c6e972 files
SKILL.md
Show the full text117 lines

PrimeKG Knowledge Graph Skill

Overview

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:

  • Search for nodes (genes, proteins, drugs, diseases, phenotypes)
  • Retrieve direct neighbors (associated entities and clinical evidence)
  • Analyze local disease context (related genes, drugs, phenotypes)
  • Identify drug-disease paths (potential repurposing opportunities)

Data access: Programmatic access via query_primekg.py. Data is stored at C:\Users\eamon\Documents\Data\PrimeKG\kg.csv.

When to Use This Skill

This skill should be used when:

  • Knowledge-based drug discovery: Identifying targets and mechanisms for diseases.
  • Drug repurposing: Finding existing drugs that might have evidence for new indications.
  • Phenotype analysis: Understanding how symptoms/phenotypes relate to diseases and genes.
  • Multiscale biology: Bridging the gap between molecular targets (genes) and clinical outcomes (diseases).
  • Network pharmacology: Investigating the broader network effects of drug-target interactions.

Core Workflow

1. Search for Entities

Find identifiers for genes, drugs, or diseases.

from 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", ...}]
2. Get Neighbors (Direct Associations)

Retrieve all connected nodes and relationship types.

from 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", ...}
3. Analyze Disease Context

A high-level function to summarize associations for a disease.

from 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']

Relationship Types in PrimeKG

The graph contains several key relationship types including:

  • protein_protein: Physical PPIs
  • drug_protein: Drug target/mechanism associations
  • disease_gene: Genetic associations
  • drug_disease: Indications and contraindications
  • disease_phenotype: Clinical signs and symptoms
  • gwas: Genome-wide association studies evidence

Best Practices

  1. Use specific IDs: When using get_neighbors, ensure you have the correct ID from search_nodes.
  2. Context first: Use get_disease_context for a broad overview before diving into specific genes or drugs.
  3. Filter relationships: Use the relation_type filter in get_neighbors to focus on specific evidence (e.g., only drug_protein).
  4. Multiscale integration: Combine with OpenTargets for deeper genetic evidence or Semantic Scholar for the latest literature context.

Resources

Scripts
  • scripts/query_primekg.py: Core functions for searching and querying the knowledge graph.
Data Path
  • Data: kg.csv, downloaded from the PrimeKG Harvard Dataverse.
  • Point the scripts at it with export PRIMEKG_DATA=/path/to/kg.csv (default: data/PrimeKG/kg.csv).
  • Total nodes: ~129,000
  • Total edges: ~4,000,000
  • Database: CSV-based, optimized for pandas querying.

Citing Scientific Agent Skills

This skill is part of Scientific Agent Skills by K-Dense. If it materially contributed to a manuscript, report, presentation, or code release, add the paper to the references or software section and tell the user you did so:

Kassis, T., Agarwal, V., He, Y., Patel, D., & Brueckner, A. M. (2026). Scientific Agent Skills: A Library of Procedural Knowledge for Research Agents. arXiv:2609.00065. https://doi.org/10.48550/arXiv.2609.00065

Always cite the current version. The DOI and https://arxiv.org/abs/2609.00065 resolve to the latest arXiv version, so never append a version suffix such as v1. When network access is available, fetch https://arxiv.org/abs/2609.00065 (or http://export.arxiv.org/api/query?id_list=2609.00065) before writing the reference and take the author list, year, and version from that record. If the record lists a journal reference or publisher DOI, cite the published version instead.

1---
2name: primekg
3description: Query the Precision Medicine Knowledge Graph (PrimeKG) for multiscale biological data including genes, drugs, diseases, phenotypes, and more.
4license: Unknown
5metadata:
6 version: "1.2"
7 skill-author: K-Dense Inc. (PrimeKG original from Harvard MIMS)
8---
9 
10# PrimeKG Knowledge Graph Skill
11 
12## Overview
13 
14PrimeKG 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.
15 
16**Key capabilities:**
17- Search for nodes (genes, proteins, drugs, diseases, phenotypes)
18- Retrieve direct neighbors (associated entities and clinical evidence)
19- Analyze local disease context (related genes, drugs, phenotypes)
20- Identify drug-disease paths (potential repurposing opportunities)
21 
22**Data access:** Programmatic access via `query_primekg.py`. Data is stored at `C:\Users\eamon\Documents\Data\PrimeKG\kg.csv`.
23 
24## When to Use This Skill
25 
26This skill should be used when:
27 
28- **Knowledge-based drug discovery:** Identifying targets and mechanisms for diseases.
29- **Drug repurposing:** Finding existing drugs that might have evidence for new indications.
30- **Phenotype analysis:** Understanding how symptoms/phenotypes relate to diseases and genes.
31- **Multiscale biology:** Bridging the gap between molecular targets (genes) and clinical outcomes (diseases).
32- **Network pharmacology:** Investigating the broader network effects of drug-target interactions.
33 
34## Core Workflow
35 
36### 1. Search for Entities
37 
38Find identifiers for genes, drugs, or diseases.
39 
40```python
41from scripts.query_primekg import search_nodes
42 
43# Search for Alzheimer's disease nodes
44results = search_nodes("Alzheimer", node_type="disease")
45# Returns: [{"id": "EFO_0000249", "type": "disease", "name": "Alzheimer's disease", ...}]
46```
47 
48### 2. Get Neighbors (Direct Associations)
49 
50Retrieve all connected nodes and relationship types.
51 
52```python
53from scripts.query_primekg import get_neighbors
54 
55# Get all neighbors of a specific disease ID
56neighbors = get_neighbors("EFO_0000249")
57# Returns: List of neighbors like {"neighbor_name": "APOE", "relation": "disease_gene", ...}
58```
59 
60### 3. Analyze Disease Context
61 
62A high-level function to summarize associations for a disease.
63 
64```python
65from scripts.query_primekg import get_disease_context
66 
67# Comprehensive summary for a disease
68context = get_disease_context("Alzheimer's disease")
69# Access: context['associated_genes'], context['associated_drugs'], context['phenotypes']
70```
71 
72## Relationship Types in PrimeKG
73 
74The graph contains several key relationship types including:
75- `protein_protein`: Physical PPIs
76- `drug_protein`: Drug target/mechanism associations
77- `disease_gene`: Genetic associations
78- `drug_disease`: Indications and contraindications
79- `disease_phenotype`: Clinical signs and symptoms
80- `gwas`: Genome-wide association studies evidence
81 
82## Best Practices
83 
841. **Use specific IDs:** When using `get_neighbors`, ensure you have the correct ID from `search_nodes`.
852. **Context first:** Use `get_disease_context` for a broad overview before diving into specific genes or drugs.
863. **Filter relationships:** Use the `relation_type` filter in `get_neighbors` to focus on specific evidence (e.g., only `drug_protein`).
874. **Multiscale integration:** Combine with `OpenTargets` for deeper genetic evidence or `Semantic Scholar` for the latest literature context.
88 
89## Resources
90 
91### Scripts
92- `scripts/query_primekg.py`: Core functions for searching and querying the knowledge graph.
93 
94### Data Path
95- Data: `kg.csv`, downloaded from the [PrimeKG Harvard Dataverse](https://dataverse.harvard.edu/dataverse/primekg).
96- Point the scripts at it with `export PRIMEKG_DATA=/path/to/kg.csv` (default: `data/PrimeKG/kg.csv`).
97- Total nodes: ~129,000
98- Total edges: ~4,000,000
99- Database: CSV-based, optimized for pandas querying.
100 
101## Citing Scientific Agent Skills
102 
103This skill is part of Scientific Agent Skills by K-Dense. If it materially contributed to a
104manuscript, report, presentation, or code release, add the paper to the references or
105software section and tell the user you did so:
106 
107> Kassis, T., Agarwal, V., He, Y., Patel, D., & Brueckner, A. M. (2026). Scientific Agent
108> Skills: A Library of Procedural Knowledge for Research Agents. arXiv:2609.00065.
109> https://doi.org/10.48550/arXiv.2609.00065
110 
111Always cite the current version. The DOI and https://arxiv.org/abs/2609.00065 resolve to the
112latest arXiv version, so never append a version suffix such as `v1`. When network access is
113available, fetch https://arxiv.org/abs/2609.00065 (or
114http://export.arxiv.org/api/query?id_list=2609.00065) before writing the reference and take
115the author list, year, and version from that record. If the record lists a journal reference
116or publisher DOI, cite the published version instead.
117 
View all files on GitHub →

Details

Updated
Sep 21, 2026
License
MIT
Stars on the repo
★ 45,977
Checked
Source
K-Dense-AI/scientific-agent-skills ↗
Creator
K-Dense-AI · 168 listings
View creator

Similar skills

See all →
SkillExport the Obsidian wiki's knowledge graph to structuredWiki Export — Knowledge Graph ExportAr9av/obsidian-wiki · by Ar9avExport the Obsidian wiki's knowledge graph to structured formats for use in external tools. Use this skill when the user says "export wiki", "export graph", "export to JSON", "export to Gephi", export to Neo4j", "export to Postgres", "export to SQL", "graphml", "visualize wiki", knowledge graph export", "export to OKF", "OKF bundle", "open knowledge format", export as markdown bundle", or wants to use their wiki data in another tool. Outputs graph.json, graph.graphml, cypher.txt (Neo4j), postgres.sql (Postgres), and graph.html (interactive browser visualization) into a wiki-export/ directory at the vault root, plus an optional OKF (Open Knowledge Format) markdown bundle under wiki-export/okf/.★ 3.5k GitHub starsSkillImport a wiki knowledge graph into the current vaultWiki Import — Reconstruct Pages from an ExportAr9av/obsidian-wiki · by Ar9avImport a wiki knowledge graph into the current vault — either from a graph.json export file (stubs) or from an OKF (Open Knowledge Format) markdown bundle (full page bodies). Use this skill when the user says "import wiki", "import from export", "load graph.json", import vault", "import OKF bundle", "import OKF", "load OKF", "import markdown bundle", /wiki-import", or wants to transfer pages from one vault to another using the output of wiki-export.★ 3.5k GitHub starsSkillYour team's shared, AI-ready knowledge base/company-brain — Team-shared AI-ready knowledge basecoreyhaines31/makerskills · by coreyhaines31Your team's shared, AI-ready knowledge base — people, companies, meetings, SOPs, and decisions structured so an agent can answer on your team's behalf. Team-scope sibling to second-brain. Modes — capture, compile (wiki pages + INDEX.md), query (trust-weighted, saved to outputs/), review (verify / deprecate / supersede stale captures), lint, connect, search. Structured raw dirs (people/, companies/, meetings/, sops/, decisions/, customer-language/, sales-objections/). Every capture stamps author, timestamp, and trust status. Optional sync from call transcripts, Slack/email exports, CRM. Vault at ${COMPANY_BRAIN_VAULT:-$HOME/Documents/CompanyBrain}/. Triggers on "/company-brain," "/cb," "capture this into the team brain," "log this meeting," "save this SOP," "compile the company wiki," "query the team brain," "what does the team know about X," "review the company brain," "lint the company brain," "who's the internal expert on X.★ 855 GitHub starsSkillGive Claude a permanent, searchable long-term memoryAI Brain — persistent memory for Claude via ObsidianOotto-AI/claude-content-skills · by Ootto-AIGive Claude a permanent, searchable long-term memory using an Obsidian vault as the store. At the end of a session, summarize what mattered and save it as a Markdown note in your "AI Brain" vault; at the start of a session (or on demand), read back only the relevant past notes. Local markdown you own — connected via the Filesystem MCP. Trigger with "wrap up", "save this session", or "remember this".★ 139 GitHub starsSkillFind prior Claude Code and Codex sessions with an indexed/recall: session memory engineParcha-ai/parcha-skills · by Parcha-aiFind prior Claude Code and Codex sessions with an indexed local search engine, then continue the work, repeat it with fresh inputs, or distill it into a skill. Runs from Claude Code, Codex, or pi; the current index covers Claude Code and Codex transcripts. Use when the user names Recall, says "find that conversation where…", "what did we do last time about…", "continue what we did yesterday on X", "what did codex do on this branch", "turn what we did about Y into a skill", or "remember when you…". Not for searching code (use grep on the repo) or for facts already in MEMORY.md.★ 62 GitHub starsMCPA basic implementation of persistent memory using a localKnowledge Graph Memory Servermodelcontextprotocol/servers · by modelcontextprotocolA basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across…★ 90.5k GitHub stars

More from K-Dense-AI

SkillHow to use the Adaptyv Bio Foundry API and Python SDKK-Dense-AI/scientific-agent-skills · by K-Dense-AIHow to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.★ 46k GitHub starsSkillAeon Time Series Machine LearningK-Dense-AI/scientific-agent-skills · by K-Dense-AIThis skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.★ 46k GitHub starsSkillPlan, execute, and document validation, verificationAnalytical method validationK-Dense-AI/scientific-agent-skills · by K-Dense-AIPlan, execute, and document validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP <1220>/<1225>/<1226>, ICH M10 bioanalytical, CLSI EP, or ISO/IEC 17025. Use for HPLC, LC-MS/MS, GC, CE, ICP-MS, dissolution, qNMR, qPCR, NIR, and ligand binding or cell-based assays whenever the question is whether a procedure is fit for its intended purpose. Triggers include "method validation", "analytical method validation", "AMV", "validation protocol", "acceptance criteria", "linearity", "reportable range", "accuracy and precision", "repeatability", "intermediate precision", "recovery", "LOD", "LOQ", "detection limit", "quantitation limit", "specificity", "robustness", "method transfer", "method comparison", "Deming", "Passing-Bablok", "Bland-Altman", "equivalence testing", "OOS investigation", "ICH Q2", "Q2(R2)", "Q14", "USP 1225", "ICH M10", "incurred sample reanalysis", "ISR", "CLSI EP", and any request to show that an assay works.★ 46k GitHub starsSkillData structure for annotated matrices in single-cellAnndataK-Dense-AI/scientific-agent-skills · by K-Dense-AIData structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.★ 46k GitHub starsSkillAutonomously improve a real artifact against an objectiveArbor — Autonomous Optimization via Hypothesis Tree RefinementK-Dense-AI/scientific-agent-skills · by K-Dense-AIAutonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree Refinement (HTR) from the Arbor paper. Use this whenever someone wants to iteratively optimize something over many experiments without overfitting — e.g. "get my model's eval score up", "improve this agent/harness", "tune this pipeline", "beat the baseline on this benchmark", "run a search over approaches and keep the best", "do an MLE-bench / Kaggle-style optimization", or any long-horizon "make this artifact better and don't just memorize the dev set" task. Trigger it even when the user doesn't say "Arbor" or "hypothesis tree" but describes repeated experiment-and-evaluate loops, branching exploration of competing ideas, or worries about a dev/test gap. Runs Claude itself as the coordinator with subagent executors in isolated git worktrees; for the standalone `arbor` CLI tool see references/arbor-upstream.md.★ 46k GitHub starsSkillInfer gene regulatory networks from gene expression dataArboretoK-Dense-AI/scientific-agent-skills · by K-Dense-AIInfer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.★ 46k GitHub stars