RepairConcepts
Repairs graph corruption by replacing `[[WikiLink]]` variants like [[tools]] → [[tool]] with canonical form in source markdown files. **DANGER: Permanently modifies files.**
Repairs graph corruption by replacing [[WikiLink]] variants like [[tools]] → [[tool]] with canonical form in source markdown files. DANGER: Permanently modifies files.
Parameters
conceptsToReplace(string, required): Comma/semicolon-separated variants. Example:"tools,Tools,TOOLS"canonicalConcept(string, required): Canonical form. Empty string removes WikiLinks. Example:"tool"folder(string, optional): Subfolder under memory root. Default: all memorydryRun(bool, optional): Preview changes without applying. Always start with true. Default:truecreateWikiLinks(bool, optional): Convert plain text to[[WikiLinks]]instead of replacing existing. Default:falseminSemanticSimilarity(double, optional): Similarity threshold (0.0-1.0) for semantic validation. Default:0.7. Set0.0to skip.
Returns
Usage Patterns
Standard Workflow (Always Start Here)
- Analyze: Run
AnalyzeConceptCorruptionto identify variants - Dry run: Run with
dryRun=true - Review: Check semantic validation and proposed changes
- Apply: Run with
dryRun=false - Sync: Run
Syncto rebuild graph
Examples
Semantic Validation
Generates embeddings for canonical + variants, calculates cosine similarity. Blocks if any variant < threshold.
Ranges: 0.9-1.0 (safe), 0.7-0.9 (review), 0.5-0.7 (caution), < 0.5 (blocked)
Example failure: coding-agent: 0.623 → blocked (< 0.7 threshold)
Safe vs Dangerous Patterns
SAFE (Always Allowed)
- Plurals:
[[tools]]→[[tool]] - Case:
[[mcp]], [[Mcp]]→[[MCP]] - Typos:
[[knowlege]]→[[knowledge]]
DANGEROUS (Never Do This)
- Class names → generic:
[[VectorTools]]→[[tool]](destroys meaning) - Specific → generic:
[[coding-agent]]→[[agent]](loses specificity) - File paths → concepts:
[[GraphTools.cs]]→[[tool]](file ≠ concept) - Compounds → base:
[[knowledge-graph]]→[[graph]](loses qualifier)
WikiLink Removal (Dangerous)
Empty canonicalConcept removes [[brackets]], breaking graph connections:
Integration
- AnalyzeConceptCorruption: ALWAYS run first to understand variants
- Sync: ALWAYS run after repairs to rebuild graph
- SearchMemories: Find files using concepts before consolidating
- BuildContext: Explore relationships to understand impact
- Visualize: Verify repairs in concept graph
Constraints
- Permanent modification: Changes source files, not just database
- Semantic validation: Default threshold 0.7 prevents unsafe merges
- Always dry run first: Default is
dryRun=truefor safety - Sync required: Graph won't update until Sync runs