Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
k-dense-ai avatar

Primekg

  • 871 installs
  • 32.7k repo stars
  • Updated August 3, 2026
  • k-dense-ai/scientific-agent-skills

PrimeKG is an agent skill that queries the Precision Medicine Knowledge Graph integrating 20+ biomedical databases with 100,000+ nodes and 4 million edges for developers building AI-powered drug-discovery and biomedical

About

PrimeKG is an agent skill for the Precision Medicine Knowledge Graph originally from Harvard MIMS (skill metadata version 1.0) that unifies over 20 primary databases and scientific literature into one biomedical graph. The graph contains over 100,000 nodes and 4 million edges across 29 relationship types, including drug-target, disease-gene, and phenotype-disease associations. Developers reach for PrimeKG when agent or backend workflows need to search genes, proteins, drugs, diseases, and phenotypes or traverse multiscale biological relationships during precision-medicine research. Key capabilities include node search, relationship lookup, and structured queries across integrated biomedical entities.

  • Query a knowledge graph with over 100000 nodes and 4 million edges
  • Search nodes for genes, proteins, drugs, diseases and phenotypes
  • Retrieve direct neighbors and clinical evidence associations
  • Analyze local disease context and identify drug-disease paths for repurposing
  • Programmatic access via query_primekg.py with local kg.csv storage

Primekg by the numbers

  • 871 all-time installs (skills.sh)
  • +39 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #1,262 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/k-dense-ai/scientific-agent-skills --skill primekg

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs871
repo stars32.7k
Last updatedAugust 3, 2026
Repositoryk-dense-ai/scientific-agent-skills

How do you query a biomedical knowledge graph for drug targets?

Query a biomedical knowledge graph for genes, drugs, diseases and phenotypes during AI-powered research and drug discovery workflows.

Who is it for?

Developers building biomedical research or drug-discovery agents who need programmatic access to an integrated precision-medicine knowledge graph.

Skip if: Developers who only need general web search or non-biomedical knowledge bases without structured drug-target or disease-gene graph data.

When should I use this skill?

The user needs to search genes, drugs, diseases, phenotypes, or traverse biomedical relationships in the PrimeKG knowledge graph.

What you get

Knowledge-graph node matches, relationship paths, and structured query results for genes, drugs, diseases, and phenotypes.

  • graph node results
  • relationship path outputs
  • structured biomedical query responses

By the numbers

  • 100,000+ nodes and 4 million edges across 29 relationship types
  • Integrates 20+ primary biomedical databases
  • Skill metadata version 1.0 from K-Dense Inc.

Files

SKILL.mdMarkdownGitHub ↗

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: /mnt/c/Users/eamon/Documents/Data/PrimeKG/kg.csv
  • Total nodes: ~129,000
  • Total edges: ~4,000,000
  • Database: CSV-based, optimized for pandas querying.

Related skills

FAQ

How large is the PrimeKG knowledge graph?

PrimeKG contains over 100,000 nodes and 4 million edges across 29 relationship types. The graph integrates more than 20 primary biomedical databases and literature sources for multiscale precision-medicine queries.

What entities can PrimeKG search?

PrimeKG supports searching nodes and relationships for genes, proteins, drugs, diseases, phenotypes, and related biomedical entities. Relationship types include drug-target, disease-gene, and phenotype-disease associations.

AI & Agent Buildingresearchautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.