| name | reindex |
| description | Update the knowledge graph with new or changed markdown files. Re-ingests documents, extracts from new chunks, and resolves new duplicates. Use when the user has added, edited, or removed markdown files and wants the graph updated. |
Reindex Knowledge Graph
Overview
This skill incrementally updates an existing knowledge graph when documents have changed. Only new or modified files are processed.
Tools
Use the kgmd MCP server tools: ingest_documents, get_chunks_for_extraction, store_extractions, get_resolution_candidates, apply_merges.
Workflow
Step 1: Re-ingest
Call ingest_documents(). It automatically:
- Skips unchanged files (hash match)
- Re-chunks modified files
- Adds new files
Report: how many documents were new, updated, or skipped.
Step 2: Extract from new chunks
If new chunks were created:
- Call
get_chunks_for_extraction(batch_size=10)
- Extract entities and relations from each chunk
- Call
store_extractions() with results
- Repeat until all new chunks are processed
Step 3: Resolve new duplicates
- Call
get_resolution_candidates() — new entities may duplicate existing ones
- Review and confirm merges
- Call
apply_merges()
Step 4: Report
Summarize what changed:
- Documents added/updated
- New entities and relations
- Merges applied