extract

A semantic text-extraction pipeline that identifies named entities, relationships, events, references, and subject–relation–object facts in a file or selected text.

In plain words
What is it for?
It helps extract and review entities, relationships, events, coreferences, triplets, and validation warnings from a file, inline text, or the active editor document.
Why use it?
It turns unstructured text into organized results and validates those results, while clearing earlier cached data to avoid mixing runs.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/semantica-agi/semantica/extract
Any agent
npx skills add semantica-agi/semantica --skill extract
Clone the repo
git clone --depth 1 https://github.com/semantica-agi/semantica

Made for: Claude Code, Codex.

Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 588 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00059 $0.00588
Opus 5 $0.00030 $0.00294
Sonnet 5 $0.00012 $0.00118
Haiku 4.5 $0.00006 $0.00059

Measured yesterday against content hash 7d99eb08c9b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

extract 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 yesterday.

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.

plugins/skills/extract/SKILL.md · 94 lines

How it starts

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

/semantica:extract

Run the full extraction pipeline. Usage: /semantica:extract [file_path | "inline text"]

$ARGUMENTS = file path, inline text in quotes, or blank (uses active editor file).


Steps

1. Resolve the source.

  • If $ARGUMENTS is a readable file path → text = open(path).read()
  • If it's quoted inline text → use directly
  • If blank → use the active editor file

2. Clear the result cache to prevent cross-invocation pollution:

from semantica.semantic_extract.cache import _result_cache
_result_cache.clear()

3. Run the full pipeline:

from semantica.semantic_extract import (
    NamedEntityRecognizer,
    RelationExtractor,
    EventDetector,
    CoreferenceResolver,
    TripletExtractor,
    ExtractionValidator,
)

# Named Entity Recognition
ner = NamedEntityRecognizer()
entities = ner.extract(text)

# Relation Extraction
rel = RelationExtractor()
relations = rel.extract(text)

# Event Detection
evt = EventDetector()
events = evt.extract(text)

# Coreference Resolution — resolve pronouns/aliases before extraction
coref = CoreferenceResolver()
resolved_text = coref.resolve(text)

# Triplet Extraction (subject–predicate–object)
triplet = TripletExtractor()
triplets = triplet.extract(resolved_text)

# Validate quality
validator = ExtractionValidator()
issues = validator.validate(entities, relations)

4. Report validator warnings above results:

⚠ ExtractionValidator: <warning message>

5. Return results as Markdown tables:

Entities (N total)

Label Type Confidence Span

Relations (M total)

Source Relation Type Target Confidence

Events (K total)

Label Type Participants Confidence

Triplets (J total)

Subject Predicate Object Confidence

6. Summary line:

Extracted: N entities, M relations, K events, J triplets — from <source>

Read the full file on GitHub · 94 lines

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. yesterday First seen · 94 lines · 59 tokens per session scan A 7d99eb08c9b6

Subscribe to this mod's changes

extract is a skill published in the GitHub repository semantica-agi/semantica (11,359 stars, last pushed yesterday), licensed MIT. It adds 59 tokens to every session and 588 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories