kg-extraction-approach-selector

kg-extraction-approach-selector is a skill for Claude Code, Codex from AnthonyAlcaraz/agentic-graph-rag-skills. It costs 199 tokens per session (2,403 once invoked), scanned A, original, MIT.

A selector that chooses how to extract facts and relationships from a source for a knowledge graph, which is a structured network of connected information. It compares database integration, language-model extraction, and document-processing approaches.

In plain words
What is it for?
Use it to select an approach based on whether the source is structured, needs incremental updates, requires document-wide context, or demands predictable results.
Why use it?
It prevents the same extraction method from being forced onto databases, documents, and free text when those sources need different treatment.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to select an approach based on whether the source is structured, needs incremental updates, requires document-wide context, or demands predictable results.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/anthonyalcaraz/agentic-graph-rag-skills/kg-extraction-approach-selector
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add AnthonyAlcaraz/agentic-graph-rag-skills --skill kg-extraction-approach-selector
Clone the repo
git clone --depth 1 https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kg-extraction-approach-selector

README.md
[![agentmods](https://agentmods.dev/badge/skills/anthonyalcaraz/agentic-graph-rag-skills/kg-extraction-approach-selector/github.svg)](https://agentmods.dev/skills/anthonyalcaraz/agentic-graph-rag-skills/kg-extraction-approach-selector)
Your own site
<a href="https://agentmods.dev/skills/anthonyalcaraz/agentic-graph-rag-skills/kg-extraction-approach-selector"><img src="https://agentmods.dev/badge/skills/anthonyalcaraz/agentic-graph-rag-skills/kg-extraction-approach-selector/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kg-extraction-approach-selector

Your own site · 80×15
<a href="https://agentmods.dev/skills/anthonyalcaraz/agentic-graph-rag-skills/kg-extraction-approach-selector"><img src="https://agentmods.dev/badge/skills/anthonyalcaraz/agentic-graph-rag-skills/kg-extraction-approach-selector.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 199 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,403 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00199 $0.02403
Opus 5 $0.00100 $0.01202
Sonnet 5 $0.00040 $0.00481
Haiku 4.5 $0.00020 $0.00240

Measured 12d ago against content hash d8d50cd81f75, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

kg-extraction-approach-selector scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (cli.py, lib.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/knowledge-representation/kg-extraction-approach-selector/SKILL.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.

KG Extraction Approach Selector

Overview

An agent's knowledge comes from heterogeneous sources — relational databases, documents, free text — and each source shape demands a different extraction strategy. The chapter's rule: the source and the reasoning need pick the approach, not the other way round. Forcing one extractor onto every source is the failure this skill exists to prevent.

Four approaches, each with a characteristic profile:

  • Structured database integration: the source already has a schema, so materialize it into nodes and edges (batch, CDC stream, or virtual graph views). Deterministic and high-precision — no LLM variance to validate. Only applicable when the source is genuinely structured.
  • LLM-based extraction: prompt an LLM for ontology-constrained subject-predicate-object triples from free text. Simplest to stand up and flexible across topics, but non-deterministic; validate against the ontology and route low-confidence extractions to human review.
  • iText2KG (incremental): extract entities and relations section-by-section and disambiguate each against the prior set. A growing corpus is extended without re-processing what is already ingested, and no domain-specific schema is required.
  • RAKG (document-level): gather every text segment where an entity appears plus related subgraphs before generating relations. Whole-document context and hallucination filtering push relationship fidelity high, at the cost of retrieval infrastructure.

The selector scores each approach across the five features weighted by the caller's source profile. A structured source is a categorical fact (you cannot LLM-extract triples from a relational table), so it hard-routes to materialization; everything else is decided by the weighted scores — an unstructured + growing corpus routes to iText2KG, unstructured + whole-document context routes to RAKG, and a one-shot unstructured pass routes to plain LLM extraction.

The incremental_cost helper makes the iText2KG advantage concrete. Adding 50 documents to a 5000-document corpus: iText2KG processes 50; a full-rebuild approach re-processes all 5000. The savings_vs_rebuild field is the re-extraction a batch pipeline pays on every update.

Read the full file on GitHub · 162 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 162 lines · 199 tokens per session scan A d8d50cd81f75

Subscribe to this mod's changes

kg-extraction-approach-selector is a skill published in the GitHub repository AnthonyAlcaraz/agentic-graph-rag-skills (10 stars, last pushed 2mo ago), licensed MIT. It adds 199 tokens to every session and 2,403 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

graphify

Use for any question about a codebase, its architecture, file relationships, or project content — especially when graphify-out/ exists, where the question should be treated as a graphify query first. Turns any input (code, docs, papers, images, videos) into a persistent knowledge graph with god nodes, community…

Graphify-Labs/graphify · 76 tokens

library

Sync agent memory files to a Cortex knowledge graph for enhanced retrieval, hybrid search (vector + keyword + graph), AI-powered Q&A with agentic deep research, and knowledge graph exploration.

mocaOS/cortex-app · 39 tokens

semantic-web

Design Semantic Web structures, Ontologies, and Meta-knowledge graphs.

andreibesleaga/GABBE · 16 tokens

cupynumeric-migration-readiness

Pre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment…

NVIDIA/skills · 173 tokens

deepstream-sop

Use this skill when building, deploying, evaluating, debugging, or measuring latency for the DeepStream SOP Inference Microservice — a GPU-accelerated FastAPI service that detects whether operators perform assembly-line steps in order via event boundary detection (GEBD) plus VLM classification. Trigger even if the…

NVIDIA/skills · 219 tokens

nemo-mbridge-perf-expert-parallel-overlap

Validate and use MoE expert-parallel communication overlap in Megatron-Bridge, including overlapmoeexpertparallelcomm, delaywgradcompute, and flex dispatcher backends such as DeepEP and HybridEP.

NVIDIA/skills · 56 tokens