migrate_kg_overhaul
One-time migration for the knowledge graph overhaul.
Nondestructive – safe to run multiple times. Performs:
Creates vector + range indexes for new entity labels (Rule, Directive, Role).
Creates the
pinnedrange index on ALL entity labels (including the 9 pre-existing ones).Backfills
pinned = falseon every existing entity that lacks the property (WHERE e.pinned IS NULL).
Usage:
python migrate_kg_overhaul.py [--redis-url redis://localhost:6379/0]
Reads $REDIS_URL by default.