Skip to content

Admin CLI

pgm-admin runs maintenance tasks that require direct administrative access.

Key lifecycle, schema-safe maintenance, memory grooming, and operational reprocessing commands.

  1. Use repo wrapper when available:
Terminal window
./bin/pgm-admin key create --name local --scopes read,write,delete
./bin/pgm-admin stats
  1. Manage keys and visibility:
  • key create, key list, key revoke
  1. Reprocess embeddings/extraction:
  • reembed, reextract, improve-graph
  1. Validate and prune graph quality:
  • prune-edges --below <threshold>
  • validate-edges
  1. Groom memory:
  • memory groom for session-context preview, promotion, or archive workflows
  • memory groom-durable for durable-memory review labels
  • memory apply-durable-grooming for applying durable-memory review labels
  1. Run direct SQL/maintenance checks:
  • pgm-admin sql "SELECT ...".
Terminal window
./bin/pgm-admin memory groom-durable --dry-run --older-than 30d
./bin/pgm-admin memory groom-durable --mode mark --yes --older-than 30d

Options include --limit, --topic, repeated or comma-separated --tag, --visibility, and --include-reviewed.

Dry-run previews eligible active durable memories. Mark mode writes metadata.durable_grooming with keep, needs_grooming, archive, or superseded. It does not rewrite content, change status, archive rows, or merge duplicates.

Terminal window
./bin/pgm-admin memory apply-durable-grooming --dry-run
./bin/pgm-admin memory apply-durable-grooming --yes

Apply mode defaults to auto: needs_grooming rows are rewritten from stored suggestions or the configured extraction LLM, while archive and superseded rows are archived. Rewrites mark the grooming status back to keep, preserve the previous status in metadata, clear stale chunks, and queue embedding enrichment again.

Use --mode rewrite, --mode archive, --status, --limit, --topic, repeated or comma-separated --tag, and --visibility to narrow the batch.

  • Wrapper behavior:
    • docker exec when container is up
    • docker compose run --rm as fallback.
  • --dry-run is available on most destructive commands.
  • memory groom-durable --mode mark requires --yes and an extraction LLM configuration.
  • memory apply-durable-grooming --yes is the step that rewrites or archives marked durable memories; review labels alone do not mutate durable memory.
  • reextract resets extraction queue state without touching unrelated rows.