Skip to main content

Backfill from Existing Project Notes

Goal

Seed the knowledge graph from documentation and chat history that already exists, so the graph starts populated rather than empty.

Prerequisites

  • KMGraph initialized (/kmgraph:init)
  • Existing project notes in one or more of: README, CHANGELOG, existing lessons, Claude/Gemini chat history

Steps

Option A — Backfill during init

When running /kmgraph:init, accept the optional backfill prompt:

Would you like to backfill the knowledge graph from existing project context? [y/N]

Select y. The backfill automatically processes:

  • README.md
  • CHANGELOG.md
  • Existing docs/lessons-learned/ entries
  • Existing docs/decisions/ ADRs
  • Chat history exports (if present)

Option B — Backfill after init

/kmgraph:update-graph --auto --sync-all

This processes all existing lessons silently in one pass without per-lesson prompts. Existing lessons and decisions are never modified — only the search index and graph entries are updated.

Option C — Extract from chat history

Export chat history from Claude Code or Gemini CLI first:

/kmgraph:extract-chat

The command locates chat logs, extracts lessons and decisions, and presents them for review before writing. Use --delegate knowledge-extractor for large exports (10+ sessions):

/kmgraph:extract-chat --delegate knowledge-extractor

Verify

/kmgraph:status

The entry count should reflect the backfilled content. Then test search:

/kmgraph:recall "topic from your existing notes"

Next steps