Skip to content

update

Replace memory content and selectively update metadata.

Updated View as Markdown

Usage

machine-memory update <id> <content> (--local|--remote)
machine-memory update <id,id,...> --from-file <path> (--local|--remote)
machine-memory update --match "unique topic" <content> (--local|--remote)

Provide either one or more IDs or --match <query>, then provide inline content or --from-file <path>. Updating multiple IDs returns the updated rows, missing IDs, and a count.

Metadata

--tags, --context, --type, --certainty, --updated-by, and --refs replace the corresponding metadata. --expires-after-days <n|null> sets or clears expiry. The content update increments update_count and refreshes updated_at.

--match must resolve to an active memory and cannot be combined with more than one positional content argument.

Embedding budget

Like add, update validates the composed embedding text before writing. If the updated memory (new content plus retained or replaced metadata) would exceed the 512-token limit — or the conservative byte+2 estimate — the update fails with the exact byte or token deficit and no memory is changed. Preflight with --dry-run to print a per-target size report without writing; it exits 1 when any target would be over budget:

machine-memory update 42 "replacement content" --dry-run --remote
# {"command":"update","dry_run":true,"count":1,
#  "targets":[{"id":42,"size":{...}}]}

Output flags: --brief prints {id, status} (plus tokens with --token-report); --json-min/--quiet print {id} for single targets and compact {updated_ids, not_found, count} payloads for batches.

Pass --token-report to include the breakdown on a successful update as tokens (for a single target) or as a tokens array of {id, ...breakdown} entries when updating multiple IDs.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close