memo_save
Persist a fact, decision, or preference as a durable, searchable memory. Optionally decompose content into atomic facts with tags for finer retrieval.
Instructions
Persist content to memo.
Use memo_save for a durable curated fact, decision, or preference; use memo_offload for bulk dumps of working context.
When extract is true (defaults to the MEMO_SAVE_EXTRACT flag, off),
the helper LLM decomposes content into atomic facts and saves each as
its own memory (mem0 ADD-model) instead of one opaque blob; tags
propagate to every fact. Returns an extraction summary
(status, saved ids, saved_titles, counts) rather than a single
record. If nothing extractable is found, the blob is saved verbatim.
Normal saves add action (created, corroborated, or revised) and
index_pending so callers can distinguish evidence from a new record.
scope controls the auto project:<repo> tag for THIS call only:
"global" skips it (the memory lands untagged → the global recall
tier, +0.10 boost everywhere); "project" or None keep the default
auto-detection. An explicit project: tag in tags always wins
either way.
defer_embed mirrors CLI memo save --defer-embed: it persists
markdown + BM25 immediately and marks the semantic vector pending for
memo_reindex. Extraction mode ignores it, matching the CLI.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Tags to attach; lower-cased and de-duplicated. | |
| type | No | Memory type. One of: decision, fact, bug, feedback, preference, note, manual, synthesis, procedure, failure_pattern, reference, temp. | note |
| extra | No | Arbitrary JSON metadata bag stored with the record. Authority-controlled keys (write_policy, visibility, trust_tier, ...) are stripped. | |
| scope | No | 'global' skips the auto project:<repo> tag (global recall tier); 'project' or None keep auto-detection. Other values are rejected. | |
| title | No | Optional title; when omitted it is derived from the first line of content. | |
| content | Yes | Markdown body to persist. Must be non-empty. | |
| extract | No | Decompose content into atomic facts saved individually; None defers to the MEMO_SAVE_EXTRACT flag (off by default). | |
| auto_derive | No | When true, a helper LLM fills missing metadata (title/type/tags); adds ~0.5-2s per save. | |
| defer_embed | No | Persist markdown and the text index immediately, but leave the semantic vector pending for a later memo_reindex call. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||