Admin CLI
pgm-admin runs maintenance tasks that require direct administrative access.
What this page covers
Section titled “What this page covers”Key lifecycle, schema-safe maintenance, memory grooming, and operational reprocessing commands.
Core workflow
Section titled “Core workflow”- Use repo wrapper when available:
./bin/pgm-admin key create --name local --scopes read,write,delete./bin/pgm-admin stats- Manage keys and visibility:
key create,key list,key revoke
- Reprocess embeddings/extraction:
reembed,reextract,improve-graph
- Validate and prune graph quality:
prune-edges --below <threshold>validate-edges
- Groom memory:
memory groomfor session-context preview, promotion, or archive workflowsmemory groom-durablefor durable-memory review labelsmemory apply-durable-groomingfor applying durable-memory review labels
- Run direct SQL/maintenance checks:
pgm-admin sql "SELECT ...".
Durable memory grooming
Section titled “Durable memory grooming”./bin/pgm-admin memory groom-durable --dry-run --older-than 30d./bin/pgm-admin memory groom-durable --mode mark --yes --older-than 30dOptions 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.
Apply durable grooming
Section titled “Apply durable grooming”./bin/pgm-admin memory apply-durable-grooming --dry-run./bin/pgm-admin memory apply-durable-grooming --yesApply 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 execwhen container is updocker compose run --rmas fallback.
--dry-runis available on most destructive commands.memory groom-durable --mode markrequires--yesand an extraction LLM configuration.memory apply-durable-grooming --yesis the step that rewrites or archives marked durable memories; review labels alone do not mutate durable memory.reextractresets extraction queue state without touching unrelated rows.