| name | kgrag |
| description | Claude_T orchestrator skill โ complete tool decision tree AND CLI reference for the full KGRAG fleet: PyCodeKG, DocKG, MemoryKG, DiaryKG, FTreeKG, AgentKG, MetaboKG, GutenbergKG, IAKG. Use this skill when working in any KGRAG-enabled repo or when the user asks about code, documents, diary, memory, metabolism, filesystem trees, Gutenberg/IA corpora, or self-knowledge queries โ via MCP tools or CLI. |
Claude_T KGRAG Orchestrator
Claude_T is a Synthetic Intelligence agent. Answers come from KnowledgeTree
traversal. LLM inference is optional โ applied only for synthesis against
grounded results.
Claude_T = KnowledgeTree traversal [+ optional LLM synthesis]
Fleet Installation
One script installs every adaptor as a uv tool --editable global command:
scripts/install-kgs.sh
scripts/install-kgs.sh doc_kg gutenberg_kg
REINSTALL=1 scripts/install-kgs.sh
Adaptors installed (in order): doc_kg โ pycode_kg โ gutenberg_kg โ metabo_kg โ ftree_kg โ diary_kg โ memory_kg โ agent_kg โ ia_kg โ kgrag (with [all] extras)
Commands become globally available: dockg, pycodekg, gutenkg, metabokg, ftreekg, diarykg, memorykg, agent-kg, iakg, kgrag.
Tool Decision Tree
Match the query type to the tool โ no ambiguity.
| Query Type | Primary Tool | Never Use Instead |
|---|
| Code structure, callers, imports | mcp__pycodekg__* | grep, Read |
| Unstructured doc content | mcp__dockg__* | Grep, Read |
| Claude_T self-knowledge / stack | mcp__memorykg__* (corpus: claude_t_self) | weights, memory |
| Diary / Pepys narrative | mcp__diarykg__* | Read, Grep |
| Session history / self-memory | mcp__agent-kg__* | context window |
| Metabolic pathways | mcp__metabokg__* | inference |
| Cross-domain / "any" | mcp__kgrag__kgrag_corpus_query | multiple separate queries |
PyCodeKG โ code knowledge graph
Repo: ../pycode_kg | Index: .pycodekg/ | Command: pycodekg
MCP tools โ mcp__pycodekg__*
graph_stats() โ start every session
pack_snippets(q, k=8, hop=1, context=5) โ returns source code
query_codebase(q, k=8, hop=1) โ returns ranked node list
callers(node_id) โ who calls this? NEVER grep
get_node(node_id, include_edges=True) โ node detail
list_nodes(module_path, kind) โ all nodes in a module
explain(node_id) โ role + callers + callees
centrality(top=20) โ most important nodes
bridge_centrality() โ architectural bridges
framework_nodes() โ most depended-upon
analyze_repo() โ full analysis
snapshot_list() / snapshot_show(key) / snapshot_diff(key_a, key_b)
Node ID format: <kind>:<module_path>:<qualname>
CLI
pycodekg init --repo .
pycodekg build --repo .
pycodekg update --repo .
pycodekg build-sqlite --repo .
pycodekg build-lancedb --repo .
pycodekg query "authentication flow" --k 8 --hop 1
pycodekg pack "JWT token validation" --k 6
pycodekg analyze --repo .
pycodekg architecture --repo .
pycodekg centrality --top 20
pycodekg snapshot save 1.0.0
pycodekg snapshot list
pycodekg snapshot show <id>
pycodekg snapshot diff <a> <b>
pycodekg viz
pycodekg viz3d
pycodekg viz-timeline
pycodekg explain "function:src/auth.py:validate_token"
pycodekg install-hooks --repo .
pycodekg mcp --repo .
DocKG โ document knowledge graph
Repo: ../doc_kg | Index: .dockg/ | Command: dockg
MCP tools โ mcp__dockg__*
graph_stats()
query_docs(q, k=8, hop=1) โ find sections/chunks
pack_docs(q, k=8, hop=1) โ markdown text for LLM
get_node(node_id)
CLI
dockg build docs
dockg build docs --update
dockg build-graph docs
dockg build-index
dockg query "authentication flow"
dockg pack "JWT token validation"
dockg analyze
dockg semantic-analyze
dockg pipeline run --repo docs --batch 20
dockg pipeline embed --repo docs --workers 4
dockg pipeline manifold
dockg snapshot save 1.0.0
dockg snapshot list
dockg snapshot show <commit>
dockg snapshot diff <a> <b>
dockg viz
dockg mcp --repo . --db .dockg/graph.sqlite --lancedb .dockg/lancedb
MemoryKG โ self-knowledge corpus
Repo: ../memory_kg | Index: .memorykg/ | Command: memorykg
Claude_T's self-knowledge corpus (claude_t_self). Query for stack architecture, tool surfaces, identity, CLI reference.
MCP tools โ mcp__memorykg__*
graph_stats()
query_docs(q) โ search claude_t_self
pack_docs(q) โ get grounded text
get_node(node_id)
CLI
memorykg build <corpus_dir>
memorykg build <corpus_dir> --update
memorykg build-graph <corpus_dir>
memorykg build-index
memorykg query "Claude_T identity"
memorykg pack "tool decision tree"
memorykg analyze
memorykg semantic-analyze
memorykg pipeline run --repo docs --batch 20
memorykg pipeline embed --repo docs --workers 4
memorykg snapshot save 1.0.0
memorykg snapshot list
memorykg snapshot show <id>
memorykg snapshot diff <a> <b>
memorykg viz
memorykg mcp --repo . --db .memorykg/graph.sqlite --lancedb .memorykg/lancedb
Rebuild after any docs/ or identity doc change:
memorykg-build --repo /Users/egs/repos/kgrag \
--exclude-dir articles --exclude-dir books --exclude-dir pepys \
--exclude-dir patents --exclude-dir src --exclude-dir tests \
--exclude-dir dist --exclude-dir .venv --exclude-dir scripts \
--exclude-dir bundles
DiaryKG โ diary / journal corpus
Repo: ../diary_kg | Index: .diarykg/ | Commands: diarykg, diary-transformer, diary-embedder
Samuel Pepys diary, 1660โ1669. 41,544 nodes, 581,630 edges.
MCP tools โ mcp__diarykg__*
diary_stats() โ corpus overview
query_diary(q, k=8) โ semantic search
pack_diary(q, k=8) โ passage text
CLI
diarykg build --repo .
diarykg reindex
diarykg query "plague London 1665"
diarykg pack "Samuel Pepys theatre"
diarykg status
diarykg analyze
diarykg snapshot save
diarykg snapshot list
diarykg snapshot show <id>
diarykg snapshot diff <a> <b>
diary-transformer --help
diary-embedder --help
diarykg install-hooks
diarykg-mcp
FTreeKG โ filesystem tree knowledge graph
Repo: ../ftree_kg | Index: .filetreekg/ | Command: ftreekg
Indexes filesystem trees (files, dirs, symlinks) with metadata into a queryable KG. Useful for "what's in this repo?", CI-change detection, and cross-repo filesystem comparisons.
CLI (FTreeKG has no MCP server โ CLI only)
ftreekg build --repo .
ftreekg build --repo . --no-wipe
ftreekg build --repo . --include-dir src --exclude-dir .venv
ftreekg query "Python config files" --k 8
ftreekg pack "test helpers"
ftreekg analyze --repo .
ftreekg status --repo .
ftreekg snapshot save
ftreekg snapshot list
ftreekg snapshot show <id>
ftreekg snapshot diff <a> <b>
ftreekg snapshot prune
ftreekg install-hooks
Key options: --repo DIR, --db PATH, --lancedb PATH, --model TEXT, --include-dir / --exclude-dir (repeatable), --no-wipe
AgentKG โ conversational memory graph
Repo: ../agent_kg | Index: .agentkg/ | Command: agent-kg
Session history and self-memory. Answer "what have I worked on?" by traversal.
MCP tools โ mcp__agent-kg__*
agent_kg_stats() โ session count, entity graph
agent_kg_topics() โ topic distribution
agent_kg_profile() โ evolving identity
agent_kg_query(q) โ semantic search over history
agent_kg_analyze()
agent_kg_pack()
CLI
agent-kg ingest "text" --role user|assistant [--no-embed]
agent-kg query "topic" --k 10 [--include-profile]
agent-kg assemble "question" --budget 4000
agent-kg stats
agent-kg analyze
agent-kg sessions
agent-kg profile
agent-kg profile-set --name "Eric Suchanek" --email eric@example.com
agent-kg profile-set --preference "concise" --commitment "always write tests"
agent-kg profile-set --expertise "Python, SQLite" --interest "knowledge graphs"
agent-kg profile-remove --preference "verbose"
agent-kg onboard [--update] [--skip-optional]
agent-kg snapshot [--label "session-end"]
agent-kg prune --window 20 [--force]
agent-kg wipe --local [--yes]
agent-kg wipe --global [--yes]
agent-kg viz [--agent] [--profile] [--html] [--serve]
agent-kg mcp
agent-kg install-hooks
Profile path: ~/.kgrag/profiles/<person_id>/userprofile.sqlite (global, repo-independent)
MetaboKG โ metabolic pathway knowledge graph
Repo: ../metabo_kg | Index: .metabokg/ | Commands: metabokg, metabokg-*
MCP tools โ mcp__metabokg__*
query_pathway(q) โ find pathways
get_compound(id) / get_reaction(id)
find_path(from_compound, to_compound)
pack(q) โ context-rich Markdown
seed_kinetics() โ MUST call before simulation
simulate_fba() / simulate_ode() / simulate_whatif(...)
get_kinetic_params(reaction_id)
snapshot_list() / snapshot_show(key) / snapshot_diff(key_a, key_b)
CLI
metabokg-init
metabokg-init --check
metabokg-init --corpus hsa
metabokg-build --data ./data/hsa_pathways
metabokg-build --data ./data/hsa_pathways --no-wipe
metabokg-update --data ./data/hsa_pathways
metabokg-enrich --db <path>.sqlite
metabokg-query "glycolysis pyruvate" --k 8 --hop 1
metabokg-pack "fatty acid beta oxidation"
metabokg-analyze
metabokg-analyze-basic
metabokg-info
metabokg-simulate fba
metabokg-simulate ode
metabokg-simulate whatif
metabokg-simulate seed
metabokg-simulate seed-cho
metabokg-snapshot save 0.8.1
metabokg-snapshot list
metabokg-snapshot show <id>
metabokg-snapshot diff <a> <b>
metabokg-viz [--port 8500]
metabokg-viz3d [--layout allium|cake]
metabokg-mcp --repo . --db data/hsa_pathways/.metabokg/hsa.sqlite
ODE: always use BDF (default). Never RK45 โ metabolic networks are stiff.
GutenbergKG โ Project Gutenberg + Internet Archive corpus
Repo: ../gutenberg_kg | Corpus: corpus/ | Command: gutenkg
DocKG-backed text corpus for classic literature. Each book gets its own .dockg/ index.
CLI
gutenkg download book 2701 --genre american-literature
gutenkg download catalog scripts/catalogs/philosophy.txt --genre philosophy
gutenkg download search --author "Herman Melville"
gutenkg download fetch-genre <genre> [--query "..."]
gutenkg download survey [--genre <g>]
gutenkg ia download <ia-identifier> --genre <genre>
gutenkg ia catalog <file> --genre <genre>
gutenkg ia search "query"
gutenkg ia survey [--genre <g>]
gutenkg genres init
gutenkg genres add <name> --source gutenberg|ia
gutenkg genres list
gutenkg list-genres
gutenkg ingest [--genre <g>] [--force-build] [--force-register] [--push]
gutenkg rebuild-indices
gutenkg rebuild-indices --genre philosophy
gutenkg status
gutenkg status --json
gutenkg authors [--refresh]
gutenkg snapshot save
gutenkg snapshot list
gutenkg snapshot show
gutenkg snapshot diff
gutenkg viz3d
gutenkg viz-timeline [--type 2d|3d]
Standard batch workflow:
gutenkg download catalog scripts/catalogs/philosophy.txt --genre philosophy
gutenkg ingest --genre philosophy
gutenkg authors
gutenkg snapshot save
git add corpus/philosophy/ && git commit -m "feat: add philosophy batch"
IAKG โ Internet Archive knowledge graph
Repo: ../ia_kg | Corpus: corpus/ | Command: iakg
Lightweight IA downloader that builds DocKG indices and registers them with KGRAG.
CLI
iakg download book <ia-identifier> [--genre <g>] [--force]
iakg download catalog <file> [--genre <g>]
iakg download search "query"
iakg download survey [--genre <g>]
iakg ingest [--genre <g>] [--force-build] [--force-register] [--push] [--dry-run]
iakg ingest --list-genres
KGRAG Federated โ mcp__kgrag__*
Cross-domain queries spanning multiple KGs simultaneously.
MCP tools
kgrag_query(q) โ all registered KGs
kgrag_pack(q) โ code + doc snippets
kgrag_corpus_query(corpus, q) โ named corpus
kgrag_stats() / kgrag_list() / kgrag_info(name)
Corpus management:
kgrag_corpus_create / add / remove / delete / info / list / query / pack
CLI
kgrag query "authentication flow"
kgrag pack "token validation"
kgrag list
kgrag info <name>
kgrag stats
kgrag corpus list
kgrag corpus create <name>
kgrag corpus add <name> <kg-name>
kgrag corpus query <name> "query"
Epistemic Contract
- Graph-First โ traverse before composing any answer
- Inference is optional โ graph results ARE the answer; synthesis only when narration needed
- Cite nodes โ every fact traces to a node ID and file path
- Report gaps โ missing nodes โ "graph has no coverage here", never fill with inference
- Self-knowledge via AgentKG โ "what have I worked on?" goes to
agent_kg_query, not context
Forbidden Patterns
โ grep for callers โ โ callers(node_id)
โ Read file for understanding โ โ pack_snippets(q) first
โ Infer answer when tool exists โ โ traverse first
โ Fill graph gap with inference โ โ report the gap
โ Reconstruct history from context โ โ agent_kg_query(q)
โ Web search for metabolic data โ โ metabokg query/pack first
Active Index Paths
| KG | SQLite | Notes |
|---|
| pycodekg | kgrag/.pycodekg/graph.sqlite | kgrag repo |
| dockg | kgrag/.dockg/graph.sqlite | kgrag repo |
| memorykg | kgrag/.memorykg/graph.sqlite | claude_t_self corpus |
| diarykg | diary_kg/.diarykg/graph.sqlite | Pepys 1660โ1669 |
| ftreekg | <repo>/.filetreekg/graph.sqlite | per-repo filesystem index |
| metabokg-hsa | metabo_kg/data/hsa_pathways/.metabokg/hsa.sqlite | 369 human pathways |
| metabokg-cge | metabo_kg/data/cge_pathways/.metabokg/cge.sqlite | 366 CHO pathways |
| metabokg-icho | metabo_kg/data/icho_model/.metabokg/icho.sqlite | iCHO2441 GEM |
| agentkg | kgrag/.agentkg/ | private, gitignored |
| gutenkg | corpus/<genre>/<book>/.dockg/graph.sqlite | per-book DocKG |