Skip to main content

Multi-KG Workflows

Goal

Capture and retrieve knowledge across multiple knowledge graphs — a project-local KG for project-specific decisions, a personal KG for reusable patterns across all projects, and optionally a cowork KG for team-shared knowledge.

KG Types

TypeStorage locationShared with
project-localdocs/ (in the project repo)Anyone with repo access
personal~/.kmgraph/Only the individual (synced via personal git remote)
coworkConfigurable shared pathTeam (synced via shared git remote)
customAny pathConfigured per instance

Prerequisites

  • KMGraph initialized (/kmgraph:init)
  • Git configured (recommended for sync)

Steps

View active knowledge graphs

/kmgraph:list

Shows all configured KGs and which is currently active.

Switch the active KG

/kmgraph:switch personal
/kmgraph:switch project-local
/kmgraph:switch cowork

All capture and recall commands operate on the active KG.

Initialize a personal KG

/kmgraph:init-personal-kg

Creates ~/.kmgraph/ and registers it. Use this for patterns that apply across all projects.

Configure a cowork KG

Edit ~/.claude/kg-config.json:

{
"graphs": {
"cowork": {
"type": "cowork",
"path": "/path/to/shared/kg",
"gitStrategy": "commit"
}
}
}

Then switch to it: /kmgraph:switch cowork

Configure git strategy per KG

gitStrategy controls what happens to entries after capture:

ValueBehavior
commitAuto-commits each new entry
stageStages entry but does not commit
ignoreCreates the file but does not touch git

Set per-KG in kg-config.json under the graphs[name] block.

Capture to a specific KG without switching

/kmgraph:capture-lesson --targetKg personal
/kmgraph:capture-lesson --targetKg project-local

Search across all KGs

/kmgraph:recall --all "search terms"

Verify

/kmgraph:status

Shows which KG is active and its entry count. Run /kmgraph:list to verify all KGs are registered.

Next steps