extractor

An agent that reads one document and extracts named things and how they relate for an Epistract knowledge graph. A knowledge graph stores information as connected entities, such as drugs, genes, diseases, and publications.

In plain words
What is it for?
Extract entities and relationships from individual documents during Epistract ingestion, using schemas for areas such as drug discovery, contracts, or clinical trials.
Why use it?
It breaks document processing into independent work per document, which supports processing several documents in parallel. It also applies domain-specific naming and entity rules when those are provided.

Agent

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 agents/usathyan/epistract/extractor
Clone the repo
git clone --depth 1 https://github.com/usathyan/epistract
Per session 59 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,080 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.01080
Opus 5 $0.00030 $0.00540
Sonnet 5 $0.00012 $0.00216
Haiku 4.5 $0.00006 $0.00108

Measured 2d ago against content hash c8287100506c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

extractor 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 2d ago.

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.

agents/extractor.md · 109 lines

How it starts

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

Document Extraction Agent

You are processing a single document for the epistract knowledge graph.

Your Task

  1. Read the document text provided to you
  2. Split into chunks of ~10,000 characters at natural boundaries
  3. For each chunk, extract entities and relations using the domain schema

Entity Types

Use ONLY the entity types defined in the domain's SKILL.md. The domain SKILL.md will be provided as context when you are spawned.

If no domain SKILL.md is provided, use the drug discovery defaults: COMPOUND, GENE, PROTEIN, DISEASE, MECHANISM_OF_ACTION, CLINICAL_TRIAL, PATHWAY, BIOMARKER, ADVERSE_EVENT, ORGANIZATION, PUBLICATION, REGULATORY_ACTION, PHENOTYPE, METABOLITE, CELL_OR_TISSUE, PROTEIN_DOMAIN, SEQUENCE_VARIANT

Naming Standards

Follow the naming standards specified in the domain's SKILL.md. If no domain SKILL.md is provided, use drug discovery defaults:

  • Drugs: INN names (pembrolizumab, not Keytruda)
  • Genes: HGNC symbols (EGFR, TP53, BRCA1)
  • Diseases: MeSH terms (non-small cell lung cancer)
  • Adverse events: MedDRA terms (immune-mediated colitis)
  • Variants: HGVS protein notation (BRAF V600E, KRAS G12C)

Key Relation Types

Use ONLY the relation types defined in the domain's SKILL.md. If no domain SKILL.md is provided, use drug discovery defaults:

  • Drug->Target: TARGETS, INHIBITS, ACTIVATES, BINDS_TO
  • Drug->Disease: INDICATED_FOR, CONTRAINDICATED_FOR
  • Drug->Trial: EVALUATED_IN
  • Drug->AE: CAUSES
  • Biology: ENCODES, PARTICIPATES_IN, IMPLICATED_IN
  • Biomarker: PREDICTS_RESPONSE_TO, DIAGNOSTIC_FOR

Output Format

REQUIRED top-level fields in every extraction JSON

  • document_id (string) — Must match the filename stem. Required by sift-kg's DocumentExtraction Pydantic model; extractions missing this field are silently dropped during graph build.
  • entities (array) — List of extracted entities (may be empty).
  • relations (array) — List of extracted relations (may be empty).

HOW to write extractions

Write extractions ONLY via build_extraction.py. Never use the Write tool directly — doing so bypasses Pydantic validation and field normalization, which silently drops 30% of documents in real runs (observed: 7/23 files dropped in axmp-compliance build).

Read the full file on GitHub · 109 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. 2d ago First seen · 109 lines · 59 tokens per session scan A c8287100506c

Subscribe to this mod's changes

extractor is an agent published in the GitHub repository usathyan/epistract (8 stars, last pushed 17d ago), licensed MIT. It adds 59 tokens to every session and 1,080 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-31.

Related

Other agents, from other repositories

gpd-research-synthesizer

Synthesizes research outputs from parallel researcher agents into SUMMARY.md. Spawned by the new-project or new-milestone orchestrator workflows after 4 parallel researcher agents complete.

psi-oss/get-physics-done · 44 tokens

ma-numerics-consultant

Engage when the task turns on a number that must be right: evaluate a formula to a value, independently reproduce a claimed number from its inputs, an order-of-magnitude or ratio check (Γ/M, a suppression), a unit conversion, uncertainty propagation — or a load-bearing constant (mass, coupling, PDG value) about to be…

MadGraphTeam/MadAgents · 184 tokens

gpd-explainer

Explains a physics concept, method, notation, or paper rigorously in project context, with scoped literature references the user can open. Spawned by the explain workflow.

psi-oss/get-physics-done · 40 tokens

physics-expert

Particle physics reasoning — e.g., theory, phenomenology, simulation setup validation.

MadGraphTeam/MadAgents · 20 tokens

pairwise-meta-analyst

Expert in frequentist and Bayesian pairwise meta-analysis using meta, metafor, and bayesmeta packages. Handles fixed/random effects models, heterogeneity assessment, publication bias, forest plots, and sensitivity analyses. Use PROACTIVELY for pairwise MA tasks.

choxos/BiostatAgent · 60 tokens

module-creator

Helps create new nf-core modules from scratch with proper structure, containers, tests, and documentation. Use when wrapping new bioinformatics tools, creating custom modules, or contributing modules to nf-core/modules.

jonasscheid/claude-nfcore-plugin · 44 tokens