doctor
Verify that MemoGrafter, its configuration, PostgreSQL schema, pgvector, and optional recall cache are ready.
Purpose
Run Doctor after migration or whenever an environment stops behaving as expected. It performs read-only diagnostics and does not modify your configuration, database, or cache.
Doctor does not require the normal initialization gate before starting. Missing configuration is reported as a required failure while independent checks continue where possible.
Run Doctor
npx memo-grafter doctorChecks performed
DATABASE_URL are available.mg_migrations exists and records the current MemoGrafter migration version.cache.connectionString.Database resolution order
Doctor resolves the database exactly as migration does. The first available value wins:
--db command-line option..env file or DATABASE_URL environment variable.src/memo-grafter/mg.config.ts.mg.config.ts.Override the database
Use --db to diagnose a specific database without changing project configuration. Doctor uses the supplied connection string but never prints it in the report.
npx memo-grafter doctor --db postgres://postgres:postgres@localhost:5432/memo_grafterDependency-aware checks
Checks run in dependency order. If PostgreSQL cannot be reached, Doctor reports that required failure and marks pgvector, migration, and schema checks as skipped instead of producing misleading secondary failures.
passed: the check completed successfully.failed: a required readiness check did not pass.warning: an optional integration is unavailable or degraded.skipped: a prerequisite was unavailable or the optional feature is not configured.Optional Redis behavior
Redis is optional in the current Doctor implementation. PostgreSQL-backed recall remains available when an optional recall cache cannot be reached.
cache.connectionString passes its Redis PING check.REDIS_URL alone is not active recall-cache configuration and does not trigger the Redis check.Exit codes
Doctor stores checks internally as structured passed, failed, warning, or skipped results so future output modes can reuse the same diagnostics.
0: all required checks passed.1: one or more required checks failed.2: invalid command usage, such as an unknown option or --db without a value.1.Troubleshooting
npx memo-grafter migrate before diagnosing a new database..env file and configuration files are available from the current working directory.npx memo-grafter doctor --help to inspect options supported by the installed package version.