Files
ra-h-os/scripts
“BeeRad”andClaude Opus 4.5 9b2db68751 chore: codebase audit — remove dead code, unused deps, clean configs
Phase 1: Delete 19 dead component/service/tool files (4,200+ lines)
Phase 2: Remove 13 unused npm packages (Radix UI, shadcn utilities, ytdl-core, etc.)
Phase 3: Database schema — drop agent_delegations, add performance indexes
Phase 4: Remove 12 dead types from database.ts/analytics.ts/helpers.ts
Phase 5: Strip shadcn/ui theme from tailwind config
Phase 6: Clean env vars, fix broken imports (LocalKeyGate, MapViewer)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 08:52:15 +11:00
..

RA-H Scripts

Utility scripts for managing the RA-H knowledge management system.

Directory Structure

scripts/
├── database/           # Database management
│   ├── backup.sh      # Create database backups
│   └── restore.sh     # Restore from backups
├── helpers/           # Helper management (CRITICAL - used by API)
│   ├── duplicate-helper.js  # Create new helpers
│   └── delete-helper.js     # Remove helpers
└── migrations/        # Completed one-time migrations
    └── cleanup-dimensions.sql

Database Scripts

Create a Backup

npm run backup
  • Creates timestamped backup in /backups/ folder
  • Example: rah_backup_20250902_102846.sql
  • Includes all nodes, chunks, edges, dimensions

Restore from Backup

npm run restore backups/rah_backup_20250902_102846.sql
  • ⚠️ WARNING: Replaces entire database
  • Requires confirmation before proceeding
  • Shows verification after restore

List Backups

ls -lt backups/

Helper Scripts

⚠️ CRITICAL: These scripts are used by the API at runtime. DO NOT modify or delete.

Create New Helper

Called automatically by the API when creating helpers through the UI.

node scripts/helpers/duplicate-helper.js "HelperName"

Delete Helper

Called automatically by the API when deleting helpers through the UI.

node scripts/helpers/delete-helper.js "helper-id"

What Gets Backed Up

  • All nodes (42,000+ knowledge items)
  • Content chunks and embeddings
  • Node connections/edges
  • Dimensions and metadata
  • Database schema and indexes

Notes

  • Backups typically ~250MB for 40k+ nodes
  • Store backups safely - they contain your entire knowledge base
  • Helper scripts are integrated with the application - modify with caution