epistract-ask

A command for asking natural-language questions about a contract knowledge graph: a structured map of extracted contract facts and their relationships. It can return citations, cost details, and risk analysis.

In plain words
What is it for?
Use it to ask questions about trials, compounds, findings, or other extracted contract knowledge, while specifying a custom extraction-output directory when needed.
Why use it?
It lets users query extracted contract information without manually searching the underlying graph data.

Command

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/ask
Clone the repo
git clone --depth 1 https://github.com/usathyan/epistract
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 984 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.00025 $0.00984
Opus 5 $0.00013 $0.00492
Sonnet 5 $0.00005 $0.00197
Haiku 4.5 $0.00003 $0.00098

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

Security

Grade A, and why

epistract-ask 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.

commands/ask.md · 98 lines

How it starts

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

Answer a natural language question about the contract knowledge graph using the Sample Contract Analyst persona.

Arguments:

  • First argument: the question (required)
  • --output-dir or second positional: path to extraction output directory (default: ./epistract-output)

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:ask <question> [options]

Required:
  <question>    Natural language question about the knowledge graph (enclose in quotes)

Options:
  --output-dir <dir>    Path to extraction output containing graph_data.json  (default: ./epistract-output)

Examples:
  /epistract:ask "What trials involve remdesivir?"
  /epistract:ask "Summarize key findings" --output-dir ./my-output
  /epistract:ask "Which compounds target KRAS G12C?" --output-dir ./drug-output

Arguments:

  • First argument: the question (required)
  • --output-dir or second positional: path to extraction output directory (default: ./epistract-output)

Step 1: Resolve output directory

Step 1: Resolve output directory

OUTPUT_DIR="${2:-./epistract-output}"

If --output-dir is provided as a flag, use that value instead.

Check that the directory exists and contains graph_data.json:

test -f "$OUTPUT_DIR/graph_data.json" || echo "ERROR: No graph_data.json found in $OUTPUT_DIR. Run extraction first."

Step 2: Load knowledge graph data

Read the following files from the output directory using the Read tool:

  • $OUTPUT_DIR/graph_data.json — full entity/relationship graph
  • $OUTPUT_DIR/claims_layer.json — conflicts, gaps, risks, cross-references (if exists)
  • $OUTPUT_DIR/communities.json — entity community groupings (if exists)

Also read all .txt files from $OUTPUT_DIR/ingested/ — these are the source contract texts.

Step 3: Adopt the Sample Contract Analyst persona

You are now the Sample Contract Analyst — a senior contract analysis specialist who has thoroughly reviewed all vendor contracts for the Sample 2026 event at the Pennsylvania Convention Center (September 4-6, 2026).

Read the full file on GitHub · 98 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 · 98 lines · 25 tokens per session scan A 8f047a6daae7

Subscribe to this mod's changes

epistract-ask is a command published in the GitHub repository usathyan/epistract (8 stars, last pushed 17d ago), licensed MIT. It adds 25 tokens to every session and 984 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.