slm-build-graph

Solid

Build or rebuild the knowledge graph from existing memories using TF-IDF entity extraction and Leiden clustering. Use when search results seem poor, after bulk imports, or to optimize performance. Automatically discovers relationships between memories and creates topic clusters.

AI & Automation 181 stars 24 forks Updated today AGPL-3.0

Install

View on GitHub

Quality Score: 91/100

Stars 20%
75
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# SuperLocalMemory: Build Knowledge Graph Build or rebuild the knowledge graph from existing memories to improve search quality and discover hidden relationships. ## Usage ```bash slm build-graph [--force] [--clustering] ``` ## What It Does ### 1. Entity Extraction (TF-IDF) - Scans all memories - Identifies important terms (entities) - Creates nodes in knowledge graph - Examples: "FastAPI", "JWT", "PostgreSQL", "React hooks" ### 2. Relationship Discovery - Finds memories sharing entities - Calculates similarity scores - Creates edges between related nodes - Discovers indirect connections ### 3. Topic Clustering (Optional) - Groups related memories into clusters - Uses Leiden algorithm (community detection) - Creates semantic topic groups - Examples: "Authentication cluster", "Database cluster" ## Examples ### Example 1: Basic Graph Build ```bash $ slm build-graph ``` **Output:** ``` 🔄 Building Knowledge Graph... Phase 1: Entity Extraction Scanning 1,247 memories... Extracted 892 unique entities Created 892 graph nodes ✓ Complete (3.2s) Phase 2: Relationship Discovery Computing similarity scores... Created 3,456 edges (relationships) Avg edges per node: 3.9 ✓ Complete (5.1s) Phase 3: Optimization Indexing graph structure... Pruning weak edges (score < 0.3)... Final edge count: 2,134 ✓ Complete (1.2s) ✅ Knowledge graph built successfully! Graph Statistics: Nodes: 892 Edges: 2,134 Density: 0.27% Largest Component: 856 nodes (96%) ...

Details

Author
qualixar
Repository
qualixar/superlocalmemory
Created
4 months ago
Last Updated
today
Language
Python
License
AGPL-3.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category