Skip to main content

Multi-KG Workflows

"I have knowledge that spans multiple projects. How do I manage more than one graph?"

KMGraph supports multiple knowledge graphs — project-local, personal, and cowork — each capturing a different scope of knowledge. KMGraph must be initialized (/kmgraph:init) and git configured before using multiple KGs.

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

View and switch

/kmgraph:list

Shows all configured KGs and which is currently active.

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

All capture and recall commands operate on the active KG.

Run /kmgraph:status to confirm the active KG and entry count, or /kmgraph:list to see all registered KGs.

Set up a personal KG

/kmgraph:init-personal-kg

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

Set up 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

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 without switching

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

Search across all KGs

/kmgraph:recall --all "search terms"