kg-ingest

kg-ingest is a command for coding agents from Ethics03/kgskill. It costs 18 tokens per session (706 once invoked), scanned A, original, MIT.

A command that adds a source document to a Knowledge Graph, a connected collection of information. It reads files or web pages, extracts important entities and ideas, and creates or updates wiki pages.

In plain words
What is it for?
Use it to ingest papers, articles, interviews, talks, notes, or web pages and capture their takeaways, entities, concepts, contradictions, and relationships.
Why use it?
Turning documents into linked notes by hand is slow and can miss relationships or conflicts with existing information. This command organizes the source into the project’s knowledge base.

Command

Part of the mykg plugin — 3 skills, 6 commands 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/ethics03/kgskill/kg-ingest
Clone the repo
git clone --depth 1 https://github.com/Ethics03/kgskill

Or install mykg, the plugin that ships this one along with the rest of its 3 skills, 6 commands.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/ethics03/kgskill/kg-ingest.svg)](https://agentmods.dev/commands/ethics03/kgskill/kg-ingest)
Your own site
<a href="https://agentmods.dev/commands/ethics03/kgskill/kg-ingest"><img src="https://agentmods.dev/badge/commands/ethics03/kgskill/kg-ingest.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 706 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.00018 $0.00706
Opus 5 $0.00009 $0.00353
Sonnet 5 $0.00004 $0.00141
Haiku 4.5 $0.00002 $0.00071

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

Security

Grade A, and why

kg-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/kg-ingest.md · 88 lines

What it actually says

Ingest the provided source into the Knowledge Graph and integrate its knowledge into the wiki.

Steps

1. Resolve KG path

Check in order: $MYKG_PATH env var → ~/.config/mykg/config~/.mykgrc → common locations (~/MyKG, ~/Dev/Obsidian/MyKG). If not found, tell the user to run /kg-setup first.

2. Read the source

  • If a file path: read it directly. Copy it to raw/ under the appropriate subdirectory (papers/ for PDFs, articles/ for markdown/text, transcripts/ for interviews/talks, notes/ for everything else). Preserve the original filename.
  • If a URL: use the defuddle skill if available, otherwise WebFetch. Save the result as markdown to raw/articles/<slug>.md where <slug> is a kebab-case version of the page title (e.g. attention-is-all-you-need.md). Write the source URL as the first line: > Source: <url>

3. Extract knowledge

Read the source and identify:

  • Key takeaways and main contribution
  • Entities — people, orgs, tools, places mentioned
  • Concepts — ideas, topics, themes introduced
  • Contradictions — anything that conflicts with existing wiki pages
  • Relationships — how entities and concepts connect

4. Create source summary

Write wiki/<source-slug>.md:

# <Source Title>

## Source
- Type: Article / Paper / Transcript / Notes
- Date: YYYY-MM-DD
- Location: [[raw/<filename>]]

## Summary
<Key takeaways in 2-3 paragraphs>

## Entities Mentioned
- [[entities/X]] - brief context

## Concepts
- [[concepts/Y]] - brief context

## Key Quotes
> Notable quote

## Relation to Other Sources
- Agrees with [[Source B]] on X
- Contradicts [[Source C]] on Y

## Open Questions
- Question that emerged from reading

5. Create or update entity pages

For each entity, create or update wiki/entities/<entity>.md with: overview, key facts, relationships, mentions, sources.

6. Create or update concept pages

For each concept, create or update wiki/concepts/<concept>.md with: definition, key points, related concepts, applications, sources.

7. Flag contradictions

If the source conflicts with existing wiki content, note it inline on the relevant page and surface it clearly to the user.

8. Update index.md

Add any new pages to the appropriate tables (Entities, Concepts, Source Summaries).

9. Append to log.md

## [YYYY-MM-DD] ingest | <Source Title>
- Added: [[wiki/<source-slug>]]
- Added: [[entities/X]], [[concepts/Y]]
- Updated: [[concepts/Z]]
- Contradiction: [[wiki/A]] vs [[wiki/B]]

10. Report

Summarize what was created/updated: source summary, entity pages, concept pages, contradictions noted.

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 · 88 lines · 18 tokens per session scan A 58a810782ece

Subscribe to this mod's changes

kg-ingest is a command published in the GitHub repository Ethics03/kgskill (3 stars, last pushed 5mo ago), licensed MIT. It adds 18 tokens to every session and 706 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.