Skip to content

Memory Graph Extraction And Grooming Controls

June 17, 2026

Postgram’s memory workflow now makes a sharper distinction between semantic recall, graph extraction, and operator review. Memory entities still get embedded for search, but they no longer feed graph/entity extraction unless an operator explicitly opts them in.

The same release window also adds an admin-only durable-memory grooming path. Operators can first review long-lived durable_memory rows and write labels into metadata, then explicitly apply those labels to rewrite noisy memories or archive obsolete ones.

Postgram PR #73 adds memory extraction controls:

  • EXTRACTION_MEMORY_MODE defaults to embed_only.
  • extract_durable opts durable memories into graph extraction.
  • extract_all opts both durable memory and session context into graph extraction.
  • Already-pending memory extraction rows are cleared when the current mode disallows them.
  • memory_role filtering is available in entity list/search surfaces so operators can distinguish durable_memory from session_context.

Postgram PR #74 adds durable memory review labels:

  • pgm-admin memory groom-durable --dry-run previews eligible durable memories.
  • pgm-admin memory groom-durable --mode mark --yes writes metadata.durable_grooming.
  • Review labels are keep, needs_grooming, archive, and superseded.
  • Mark mode preserves memory content, status, visibility, owner, tags, and edges. It is a review label, not an automatic cleanup action.

Postgram PR #75 adds durable grooming apply workflows:

  • pgm-admin memory apply-durable-grooming --dry-run previews what would be rewritten, archived, or skipped.
  • pgm-admin memory apply-durable-grooming --yes applies the default auto mode.
  • auto rewrites needs_grooming rows and archives archive or superseded rows.
  • --mode rewrite limits the batch to needs_grooming; --mode archive limits it to archive and superseded.
  • Rewrites use stored suggested_content when available, otherwise the configured extraction LLM. They clear stale chunks and requeue embedding enrichment.

The default is intentionally quiet:

Terminal window
EXTRACTION_MEMORY_MODE=embed_only

Use explicit opt-in when memory-derived graph edges are useful for your deployment:

Terminal window
EXTRACTION_MEMORY_MODE=extract_durable
# or
EXTRACTION_MEMORY_MODE=extract_all

Run durable grooming as a review workflow:

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

Dry-run previews candidates. Mark mode classifies them with the extraction LLM and stores the outcome under metadata.durable_grooming.

Then apply reviewed labels explicitly:

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

Use --mode rewrite, --mode archive, --status, --topic, --tag, --visibility, or --limit to narrow the batch before applying it.

Session context and durable memory are valuable recall material, but agent summaries can make noisy graph edges when treated like source documents. The new default keeps memories discoverable through semantic search while leaving the knowledge graph focused on source knowledge unless an operator opts in.

Durable grooming gives operators a safe two-step path over accumulated long-term memory. Review labels flag stale execution detail or superseded memories. Apply mode then turns those labels into explicit rewrites or archives only after a dry-run and --yes.