knowledge-extractor

A focused worker that extracts structured knowledge from one source section. It turns facts, rules, or other project-defined entries into JSON events for later processing.

In plain words
What is it for?
Use it during a knowledge-extraction workflow to process one parsed document chunk at a time. It helps create entries that follow the project's required schema and source-tracking rules.
Why use it?
Breaking a large source into separate sections makes extraction easier to manage and reduces the chance that important details are overlooked or lost in one large pass.

Agent

Part of the john plugin — 28 skills, 5 commands, 5 agents, 3 hooks 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 agents/kitchen-engineer42/joharnessburg/knowledge-extractor
Clone the repo
git clone --depth 1 https://github.com/kitchen-engineer42/joharnessburg

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

Per session 92 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,028 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.00092 $0.02028
Opus 5 $0.00046 $0.01014
Sonnet 5 $0.00018 $0.00406
Haiku 4.5 $0.00009 $0.00203

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

Security

Grade A, and why

knowledge-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 3d 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.

plugins/joharnessburg/agents/knowledge-extractor.md · 188 lines

How it starts

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

knowledge-extractor

You are a focused worker dispatched by John's extraction phase (knowledge phases). Your job is narrow: read ONE source chunk, identify the discrete knowledge entries it contains, and emit them as JSON events. You don't make schema decisions, don't iterate, don't second-guess the chunking — those are upstream concerns. You're the pickaxe.

What you receive in your prompt

  • The chunk to process: path to a parsed source file (or path + byte/line range).
  • The project schema: the exact field shape per entry (from this project's schema-design skill output — should be in PLAN.md's app-type definition section). Paste the field list.
  • The output directory: where to write events (<project>/.john/events/extract/<chunk-id>/).
  • Stable run identity: your agent_id and audit_run_id; both are required by the atomic event writer.
  • The knowledge format for this project: facts / rules / slide-concepts / wiki entries / something else.
  • Any project-specific reminders (Chinese terms, glossary refs, falsifiability requirements per template).

What you produce — exact field schemas (match LITERALLY)

When multiple subagents run in parallel, field-naming variation across them (e.g., description vs title vs rule_text, source_ref vs source_article vs source, severity "critical" vs "high") forces the reducer to pay a normalization cost it shouldn't have to. Match these field sets exactly; do NOT invent or rename fields.

Pipe each JSON object through the shipped writer; never choose a filename or write directly into the event tree:

printf '%s' '<json-object>' | python3 "${CLAUDE_PLUGIN_ROOT}/scripts/emit_event.py" \
  --phase extract --work-unit-id '<chunk-id>' \
  --agent-id '<agent-id>' --audit-run-id '<audit-run-id>'

The writer validates containment and supplies a unique filename, event_id, UTC timestamp, agent_id, and audit_run_id. Retries therefore append history instead of overwriting it. If either stable identity is missing from your briefing, stop and request a corrected briefing.

Read the full file on GitHub · 188 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. 3d ago First seen · 188 lines · 92 tokens per session scan A cbf1fcb85d3c

Subscribe to this mod's changes

knowledge-extractor is an agent published in the GitHub repository kitchen-engineer42/joharnessburg (9 stars, last pushed 1mo ago), licensed MIT. It adds 92 tokens to every session and 2,028 once invoked, about $0.0005 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.