Skip to content

Guide · Agent skill

How to use the PrimeKG knowledge graph lookup agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The primekg skill lets an AI agent look up genes, drugs, diseases and phenotypes in a local copy of the PrimeKG knowledge graph and report the recorded links between them. It is aimed at researchers, students and data users who need results they can trace back to their source. After this guide you will know how to install the skill, get the required CSV file, ask for lookups in plain language and read the results with their relation labels and provenance.

PrimeKG Knowledge Graph LookupK-Dense-AI/scientific-agent-skills · MIT

Quick start

  1. 1Download the skill. Download the skill ZIP from this page and unzip it so the folder contains SKILL.md, scripts and references.
  2. 2Place the skill folder. Move the folder into ~/.claude/skills/ for personal use or .claude/skills/ inside a project, or upload it under Settings → Capabilities → Skills in the Claude apps.
  3. 3Install the requirements. Make sure Python 3.11 or newer and pandas are available, and that you have several GB of free RAM.
  4. 4Download and verify kg.csv. Download the PrimeKG kg.csv file, check its checksum, and set PRIMEKG_DATA to its path.
  5. 5Ask a natural request. Ask the agent about a gene, drug, disease or phenotype in PrimeKG, then choose the correct candidate when it lists matches.

What the primekg skill makes the agent do

PrimeKG is a knowledge graph that links typed biomedical entities such as genes, drugs, diseases and phenotypes. The skill gives the agent a helper script that searches this graph in a downloaded CSV file and reports the associations it records.

The agent can resolve an entity name to a node, list its direct associations, summarise a disease's genes, drugs and phenotypes, and find simple one- or two-hop paths between two nodes. Results keep the relation labels, IDs and data provenance attached, and the skill warns that a path supports a hypothesis only.

  • Find candidate nodes by name and choose the intended one
  • List direct associations for a gene, drug, disease or phenotype
  • Get a disease summary with associated genes, drugs, phenotypes and related diseases
  • Find one- and two-hop association paths between two nodes

How do you install the primekg skill?

Download the skill ZIP from the skill page on this site and unzip it. The skill folder should contain SKILL.md, scripts/query_primekg.py and references/data-contract.md.

Put the folder in one of these locations, depending on how you want to use it. A personal install goes in ~/.claude/skills/. A project install goes in the .claude/skills/ folder of that project. You can also upload the skill in the Claude apps under Settings → Capabilities → Skills.

  • Personal: ~/.claude/skills/
  • Project: .claude/skills/ inside your project folder
  • Claude apps: Settings → Capabilities → Skills, then upload the skill

How do you get the PrimeKG data file?

The helper does not query the internet for graph data. It reads a PrimeKG kg.csv file on your own machine, which is about 982 MB. Check that you have that much free disk space and several GB of free RAM before you start, because the helper loads the whole file for each query.

The source gives this download command as an illustration. It saves the file to kg.csv in the current folder and sets the PRIMEKG_DATA variable to its path. The helper reads PRIMEKG_DATA when it is imported. If the variable is not set, it looks for data/PrimeKG/kg.csv.

Before using the file, verify its checksum against the MD5 value listed in the skill's data reference, and record the DOI, file name, file ID and retrieval date with your results.

curl --fail --location --output kg.csv \n 'https://dataverse.harvard.edu/api/access/datafile/6180620'\nexport PRIMEKG_DATA="$PWD/kg.csv"

How do you trigger the skill with natural requests?

Ask for PrimeKG by name or describe a biological lookup. The skill is meant for requests about PrimeKG reproducibility, biological association lookup and hypothesis generation that needs traceable relations and sources. Name the entity type when you can, because the graph separates genes, drugs, diseases and phenotypes.

Expect the agent to show candidate matches before it runs a traversal, so you can choose the intended disease or drug yourself.

  • Using PrimeKG, what genes are associated with Alzheimer disease?
  • Which drugs have a recorded indication for this disease in PrimeKG?
  • Find two-hop paths between this drug and this phenotype in the PrimeKG graph.
  • Summarise the associated genes, drugs and phenotypes for this disease, with relation labels.

How do you read the results?

Each association carries a relation label. Read the label exactly, because it determines what the link means. For example, indication is a recorded drug-disease indication, while contraindication is a recorded contraindication and should never be counted as treatment support.

Phenotype links keep their sign. A disease_phenotype_negative record means the phenotype is recorded as absent, and a missing edge means unknown, not negative. Paths are undirected and show how the query walked the graph, which is not evidence of cause.

  • indication: recorded drug-disease indication
  • contraindication: recorded contraindication, not treatment support
  • off-label use: kept separate from indication and contraindication
  • disease_protein: disease-associated gene or protein
  • disease_phenotype_positive and disease_phenotype_negative: recorded presence or absence
  • effect/phenotype: the node type for phenotypes

What are the safety notes and limits?

The skill runs Python scripts and reads your local CSV. Network access is used only to fetch the public dataset file or its metadata. Query results are not clinical advice: the graph records associations, not treatment efficacy, prescribing decisions or diagnoses, and the skill states this.

The skill's listing shows an MIT licence, but the SKILL.md file in the source lists the license as Unknown, so check the repository before relying on a licence. The PrimeKG dataset record declares CC0 1.0, and its construction code is MIT. These are separate from the skill's own licence.

  • Requires Python 3.11+ and pandas
  • Needs a downloaded PrimeKG CSV and several GB of free RAM
  • Do not use results for clinical or prescribing decisions
  • The helper does not retrieve clinical text, publications, confidence scores or current approval status

What tips help you get reliable results?

Search is literal and case insensitive, and returns at most 20 matches unless you ask for all of them. Keep IDs as strings, including numeric-looking ones. Do not invent identifiers from labels, because drug nodes use DrugBank IDs and diseases use MONDO IDs.

If you query many times or have limited RAM, the source recommends building an indexed local store from the pinned file. Only PrimeKG CSVs are supported. Upstream PrimeKG now recommends OptimusKG for new work.

  • Record the DOI, file name, file ID, checksum and retrieval date with every result
  • Pick the intended node from the candidate list before tracing associations
  • Treat a path as a hypothesis to check against the original sources

What people use it for

  • Reproducing an analysis that uses a specific PrimeKG release and recording its provenance
  • Exploring how diseases, genes and drugs are linked in a knowledge graph as a student
  • Generating hypotheses from two-hop paths that you then check against original sources
  • Summarising recorded indications, contraindications and phenotypes for a disease in one lookup

Frequently asked questions

How do I install the primekg skill?

Download the skill ZIP from this page and unzip it into ~/.claude/skills/ for personal use or into .claude/skills/ in a project. You can also upload it in the Claude apps under Settings → Capabilities → Skills.

What do I need to run the primekg skill?

You need Python 3.11 or newer, pandas, a downloaded PrimeKG kg.csv file of about 982 MB, and several GB of free RAM. The helper loads the whole file for each query.

Is the primekg skill free to use?

The skill listing shows an MIT licence, but its SKILL.md lists the license as Unknown, so check the repository. The PrimeKG dataset record declares CC0 1.0, which is separate from the skill licence.

Is there an alternative to PrimeKG for new work?

Upstream PrimeKG now recommends OptimusKG for new work. This skill supports only PrimeKG CSVs and is not an OptimusKG client.

Why does the skill ask me to choose a disease from a list?

Search is literal and can match several entries, so the skill returns candidates instead of picking one silently. Ambiguous names return an error and candidates, which you should review before tracing associations.

Can I use primekg results for medical decisions?

No. The graph records associations, not treatment efficacy, prescribing recommendations or diagnoses. A path supports a research hypothesis only and needs independent verification.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

The primekg skill suits researchers reproducing PrimeKG analyses, students exploring biomedical links, and data users who need traceable relations and sources. It is a poor fit for clinical or prescribing decisions, for machines with limited RAM, and for anyone who wants the newer OptimusKG graph.

Download the skill