memories.sh logomemories.sh
CLI Reference

memories doctor

Run deterministic health checks and get exact remediation steps.

memories doctor [options]

Run deterministic diagnostic checks across local DB, MCP wiring, project detection, and cloud integration.

Options

OptionDescription
--fixAttempt to fix issues found
--jsonOutput machine-readable report (stable schema)
--local-onlySkip cloud health checks and validate local mode only
--strictExit with code 1 when warnings or failures exist

Checks Performed

  1. Database file — Verifies the database file exists at the expected path
  2. Connection — Tests that the database can be opened and queried
  3. Schema integrity — Runs PRAGMA integrity_check to verify data consistency
  4. FTS index — Checks the full-text search index is operational and that no soft-deleted records have leaked into the FTS index
  5. Write path — Validates insert/update/delete triggers and end-to-end write safety
  6. MCP wiring — Checks MCP is configured for detected tools
  7. Cloud integration — Verifies auth/session/workspace health endpoint connectivity
  8. Git detection — Verifies project detection is working in the current directory
  9. Orphaned memories — Checks for project-scoped memories with no matching project
  10. Soft-deleted records — Reports the count of soft-deleted records

Fix Mode

When --fix is passed, the doctor will:

  • Permanently purge (hard-delete) all soft-deleted records
  • Rebuild the FTS5 full-text search index
memories doctor --fix

Examples

Run diagnostics:

memories doctor

Diagnose and fix:

memories doctor --fix

Machine-readable report for CI/automation:

memories doctor --json --strict

Local-only validation (no login/workspace requirement):

memories doctor --local-only

--json now returns:

  • schemaVersion (current: 1.1)
  • checks[] with stable id, code, category, status, message, remediation
  • nextSteps[] aggregated from non-pass checks (deduplicated, priority ordered)

On this page