# Knowledge graph relation typing

> Knowledge graph relation typing is an open-source agent skill for knowledge and memory. Type knowledge graph relations against a fixed schema and flag conflicting facts. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/mrmps/classifier-dev/tree/main/skills/knowledge-graph-relation-typing
- **Repository:** https://github.com/mrmps/classifier-dev
- **GitHub stars:** 440
- **License:** MIT
- **Skill name:** knowledge-graph-relation-typing
- **Collection:** https://github.com/mrmps/classifier-dev
- **Categories:** [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory)
- **Listing updated:** 2026-12-04

## About

This skill guides an agent through labelling candidate subject, sentence, object triples with one relation from a fixed schema, using a batched classification service that needs no API key. Each label comes with a confidence score, and the skill sets gating thresholds so that only high-confidence edges are written to the graph, while mid-confidence edges go to a review queue and low-confidence ones are dropped.

The same approach is applied to contradiction checking: pairs of facts that share a subject and relation are compared and labelled as consistent, contradictory, or about different things. The skill explains how schema size and label wording affect confidence, recommends writing relation names as plain sentences, and covers a proposition-based method for cases where subject and object direction matters.

The skill expects the agent to already have extracted entities and their source sentences, since it only classifies and does not find entities or discover new relation types. It is written around a classifier.dev endpoint and calls are made from Python code the agent writes.

## When your agent uses it

> Type candidate (subject, sentence, object) triples against a fixed relation schema and flag triples that contradict each other, batched, with a calibrated confidence per edge so only confident edges are written. Use when building a knowledge graph, entity table or fact store from text. Triggers on "type these relations", "what relation is this", "build a knowledge graph", "do these facts conflict", "check these triples".

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/mrmps/classifier-dev/tree/HEAD/skills/knowledge-graph-relation-typing)
- [License: MIT](https://github.com/mrmps/classifier-dev/tree/HEAD/skills/knowledge-graph-relation-typing)

## Features

- **Batched relation typing:** Classifies many subject, sentence, object triples against a fixed relation schema in one request.
- **Confidence-gated writes:** Sets thresholds so only confident edges enter the graph and uncertain ones are queued or dropped.
- **Contradiction detection:** Compares fact pairs sharing a subject and relation and labels them consistent, contradictory or unrelated.
- **Schema design guidance:** Explains how label count and near-synonyms affect confidence, and how to phrase labels as sentences.
- **Direction-aware propositions:** Frames candidates as statements to test whether a sentence states a relation in a specific direction.

## Good for

- Type the relations between entities extracted from a batch of news articles
- Check whether two stored facts about a company conflict with each other
- Build a knowledge graph of people, organisations and locations from text
- Decide which extracted relations are confident enough to store in a fact table
- Flag contradictory founding dates or headquarters locations in a fact store

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/knowledge-graph-relation-typing` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/knowledge-graph-relation-typing &&
cp -R "$tmp/skills/knowledge-graph-relation-typing" ~/.claude/skills/knowledge-graph-relation-typing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/knowledge-graph-relation-typing` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/knowledge-graph-relation-typing` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/knowledge-graph-relation-typing &&
cp -R "$tmp/skills/knowledge-graph-relation-typing" ~/.agents/skills/knowledge-graph-relation-typing &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/knowledge-graph-relation-typing` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/knowledge-graph-relation-typing` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/knowledge-graph-relation-typing &&
cp -R "$tmp/skills/knowledge-graph-relation-typing" ~/.cursor/skills/knowledge-graph-relation-typing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/knowledge-graph-relation-typing` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/mrmps/classifier-dev.git --path skills/knowledge-graph-relation-typing
```

Or copy the folder to `~/.gemini/skills/knowledge-graph-relation-typing` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/knowledge-graph-relation-typing`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/knowledge-graph-relation-typing &&
cp -R "$tmp/skills/knowledge-graph-relation-typing" ~/.copilot/skills/knowledge-graph-relation-typing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/knowledge-graph-relation-typing` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/mrmps/classifier-dev.git
```

Then copy `classifier-dev/skills/knowledge-graph-relation-typing` into your agent's skills folder as `knowledge-graph-relation-typing`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When should the skill be used?

It triggers when building a knowledge graph, entity table or fact store from text, or when asked to type relations, identify a relation, or check whether facts or triples conflict.

### Does Knowledge graph relation typing find entities in text?

No. The skill states that entity finding is extraction, not classification, and that the service returns labels only, so spans and sentences must come from the agent's own extraction.

### Can Knowledge graph relation typing discover relations that are not in the schema?

No. Every input is placed on one of the labels the user defines, so relations missing from the schema cannot be found directly, though the skill suggests treating frequent mid-confidence results as a sign of missing labels.

### Is an API key required?

The skill says the classifier.dev service is keyless.

### How do I install Knowledge graph relation typing in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/knowledge-graph-relation-typing to use it in all your projects, or to .claude/skills/knowledge-graph-relation-typing in one project.

### Does Knowledge graph relation typing run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Knowledge graph relation typing?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Knowledge graph relation typing?

The closest alternatives to Knowledge graph relation typing are Graph the network, Mini context graph, Kmg knowledge graph usage, Kb query and Wiki graph.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Graph the network](https://ai-powered.com/skills/graph-the-network): Graph the network is an open-source agent skill for knowledge and memory.
- [Mini context graph](https://ai-powered.com/skills/mini-context-graph): Mini context graph is an open-source agent skill for knowledge and memory.
- [Kmg knowledge graph usage](https://ai-powered.com/skills/kmg-knowledge-graph-usage): Kmg knowledge graph usage is an open-source agent skill for knowledge and memory.
- [Kb query](https://ai-powered.com/skills/kb-query): Kb query is an open-source agent skill for knowledge and memory.
- [Wiki graph](https://ai-powered.com/skills/wiki-graph): Wiki graph is an open-source agent skill for knowledge and memory.
- [Ljg map](https://ai-powered.com/skills/ljg-map): Ljg map is an open-source agent skill for knowledge and memory.
- [Kb qc loop](https://ai-powered.com/skills/kb-qc-loop): Kb qc loop is an open-source agent skill for knowledge and memory.
- [Connect](https://ai-powered.com/skills/connect-onebrain-ai): Connect is an open-source agent skill for knowledge and memory.

---
Source: https://ai-powered.com/skills/knowledge-graph-relation-typing
