epistract-ingest

epistract-ingest is a command for coding agents from usathyan/epistract. It costs 17 tokens per session (2,552 once invoked), scanned A, original, MIT.

A document-processing command that reads research files and builds a knowledge graph, which maps entities and their relationships.

In plain words
What is it for?
Use it to process PDFs, Word files, web pages, text, and many other formats for drug-discovery, contract, or clinical-trial projects, with optional validation and external enrichment.
Why use it?
It turns scattered documents into structured data that can be searched and inspected as connected information.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the epistract plugin — 5 skills, 22 commands, 3 agents shipped together

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 commands/usathyan/epistract/ingest
Clone the repo
git clone --depth 1 https://github.com/usathyan/epistract

Or install epistract, the plugin that ships this one along with the rest of its 5 skills, 22 commands, 3 agents.

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 epistract-ingest

README.md
[![agentmods](https://agentmods.dev/badge/commands/usathyan/epistract/ingest.svg)](https://agentmods.dev/commands/usathyan/epistract/ingest)
Your own site
<a href="https://agentmods.dev/commands/usathyan/epistract/ingest"><img src="https://agentmods.dev/badge/commands/usathyan/epistract/ingest.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,552 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.00017 $0.02552
Opus 5 $0.00009 $0.01276
Sonnet 5 $0.00003 $0.00510
Haiku 4.5 $0.00002 $0.00255

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

Security

Grade A, and why

epistract-ingest 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 4d 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.

commands/ingest.md · 187 lines

How it starts

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

Epistract Document Ingestion Pipeline

You are running the epistract drug discovery knowledge graph pipeline.

Usage Guard

If invoked with no arguments or with --help: Display the following usage block verbatim and stop — do not run any pipeline steps.

Usage: /epistract:ingest <corpus-dir> [options]

Required:
  <corpus-dir>    Directory or file path containing documents to ingest (PDF, DOCX, HTML, TXT, and 75+ formats)

Options:
  --domain <name>           Domain schema to use  (default: drug-discovery; choices: drug-discovery, contracts, clinicaltrials)
  --output <dir>            Output directory       (default: ./epistract-output)
  --validate                Enable molecular validation (auto-enabled if RDKit is installed)
  --view                    Open graph viewer after build (default: true)
  --fail-threshold <float>  Minimum extraction pass rate before graph build (default: 0.95, range: 0.0–1.0)
  --enrich                  Enrich graph via external APIs after build — clinicaltrials domain only
                            (Trial nodes → ClinicalTrials.gov v2; Compound nodes → PubChem PUG REST)

Examples:
  /epistract:ingest ./my-papers
  /epistract:ingest ./papers --domain clinicaltrials --enrich
  /epistract:ingest ./papers --domain contracts --output ./out --fail-threshold 0.9

Arguments

  • path (required): Directory or file path containing documents
  • --output (optional): Output directory (default: ./epistract-output)
  • --domain (optional): Domain name for extraction (default: drug-discovery). Choices: drug-discovery, contracts, clinicaltrials. Aliases (contract, clinicaltrial, clinical_trials) resolve automatically.
  • --validate (optional): Enable molecular validation (default: true if rdkit installed)
  • --view (optional): Open viewer after build (default: true)
  • --fail-threshold <float> (optional): Minimum post-normalization pass rate required before graph build (default: 0.95, range: [0.0, 1.0]). Pipeline aborts with a clear error if the pass rate falls below this threshold.
  • --enrich (optional flag): When present AND --domain is clinicaltrials (or aliases clinicaltrial / clinical_trials), triggers post-build enrichment against ClinicalTrials.gov v2 and PubChem PUG REST APIs. Trial nodes with NCT IDs get trial metadata; Compound nodes get molecular data. Non-blocking: API failures log counts but do not abort the pipeline.

Read the full file on GitHub · 187 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. 4d ago First seen · 187 lines · 17 tokens per session scan A 901592fb4bd6

Subscribe to this mod's changes

epistract-ingest is a command published in the GitHub repository usathyan/epistract (8 stars, last pushed 19d ago), licensed MIT. It adds 17 tokens to every session and 2,552 once invoked, about $0.0001 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.