optimize_scan
Scan memories to plan curation: view snippets, dedup hints, domain clusters, and stats. Filter by date, domain, or type to review incremental changes.
Instructions
Dump the memory corpus compactly so you can plan a curation pass.
Step 1 of the "optimize my memories" workflow. Returns every memory's curation-relevant fields, the relation edges among them, and dedup-candidate pairs as a starting hint. Read this, then decide what to compact/reword/retag/redomain/set_confidence/archive/link/merge/ distill and stage it with optimize_stage.
The listing is slim on purpose so a few-hundred-memory store fits one
response: content is a ~120-char snippet plus content_len (tags cut
at ~100 with tags_len); empty/default fields are omitted (incl.
confidence 'unverified' -- stats keeps the aggregate); created_at
drops sub-second precision. Pass full=True for whole
bodies, or fetch one with get_memory(uid) when a snippet is not
enough. A page also ends early if its serialized size hits an
internal budget, so one response ALWAYS fits the host's output cap.
truncated: true means the listing stopped before the corpus ended
-- page onward with offset = offset + count (stats.total is the
whole corpus).
On a grown store, prefer INCREMENTAL curation over full-corpus
passes: since limits the scan to memories created or updated
at/after an ISO timestamp or date ('2026-07-01'), so a recurring
"optimize my memories" only reviews the delta since the last run
(optimize_runs shows when that was). Cross-window collisions are
still caught: dedup_hints probe FROM the new memories against the
whole store (a new memory duplicating an old one outside the window
surfaces; old x old pairs are skipped), and domain_hints report any
store-wide domain cluster the delta touches. Combine with
domain/type to curate one slice at a time. Also included:
stats: totals for the whole filtered corpus (by_type, by_confidence, by_domain, empty_domain) -- computed regardless of
limit,domain_hints: clusters of domain-string variants that likely mean the same thing (case/separator drift, ticket-id spellings), with a suggested canonical -- ready-made redomain candidates,
anchors: per memory, the verifiable references found in its FULL content (URLs, file paths, table/field identifiers, constants), space-joined -- the things to go check against live facts.
Before proposing any change, CHECK IT AGAINST LIVE FACTS -- do not rewrite or archive something that was true then but stale now, and do not "correct" something that is still true:
cross-check newer memories already in this corpus (supersession / contradiction),
for code/config memories, verify the anchors against the live repo,
for world-facts, web-check current truth. Record what you verified in each suggestion's
verifiedfield -- destructive suggestions (archive, set_confidence=contradicted) are rejected without it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| full | No | ||
| type | No | ||
| limit | No | ||
| since | No | ||
| domain | No | ||
| offset | No | ||
| include_archived | No |