mimir_maintenance
Perform database maintenance: deduplicate entities, detect orphan entries, vacuum to reclaim disk space, and reindex FTS5. Preview changes with dry_run mode.
Instructions
Database maintenance operations: deduplicate entities with identical (category, key), detect orphan journal entries and links, vacuum (reclaim disk space), reindex FTS5. Set dry_run=true to preview. Use 'all' to run everything.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Run all maintenance operations (dedup, orphans, vacuum, reindex) | |
| dedup | No | Find duplicate (category, key) entities and archive the oldest | |
| vacuum | No | Run SQLite VACUUM to reclaim disk space | |
| dry_run | No | If true, preview changes without writing | |
| orphans | No | Detect journal entries and links pointing to non-existent entities | |
| reindex | No | Rebuild the FTS5 search index from entities table |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| errors | No | Errors encountered during maintenance | |
| dry_run | No | ||
| dedup_archived | No | Number of duplicate entities archived | |
| orphan_links_found | No | Orphan links detected | |
| reindex_rows_affected | No | Rows reindexed into FTS5 | |
| vacuum_reclaimed_bytes | No | Disk space reclaimed by VACUUM | |
| orphan_journal_entries_found | No | Orphan journal entries detected |