Skip to main content
Glama

memory_upsert

Destructive

Write or update an Aelios long-term memory immediately by fact_key: existing keys are overwritten; new keys create memories, and authored facts stay protected.

Instructions

Write a refined memory immediately (no waiting for the nightly dream), keyed by fact_key. If an active memory with the same fact_key exists, its content and fields are overwritten in place and the old text is not kept; otherwise a new memory is created. To keep the old version as history, use memory_supersede. Pass authored_by (with the default source) to mark the memory as hand-authored: it ranks above distilled memories and the automatic pipeline cannot overwrite it. Returns { data: { id, created } }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagsNoFree-form labels.
typeNoOne of fact, event, preference, relationship, boundary, habit, decision, note. Other values become fact (default).
sourceNoWho is writing. Leave unset (defaults to 'mcp'). authored_by is only stored when source is mcp, manual, api or remember_now.
contentYesThe memory text, one self-contained statement.
fact_keyYesStable key for this fact, e.g. 'user:favorite_coffee'. Reusing a key updates that memory. Facts about the outside world rather than the user use the prefix 'world_fact:'.
namespaceNoMemory space to use. Defaults to 'default'. Ignored when the API key is bound to a fixed namespace.
confidenceNo0 to 1, how sure you are it is true. Defaults to 0.8.
importanceNo0 to 1, how much this matters. Defaults to 0.6.
authored_byNoE-axis signature; only honored on hand sources (mcp/manual/api/remember_now)
valid_as_ofNoWhen the fact became true (ISO date or datetime). Used as the event date in recall.
response_tendencyNoE-axis: how to respond when this memory fires

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv0.1.2
    • changedInput schema / properties / authored_by / description
      Previous value: -"E-axis signature; only honored on hand sources (mcp/manual/api)"New value: +"E-axis signature; only honored on hand sources (mcp/manual/api/remember_now)"
    • addedInput schema / properties / confidence / description
      Added value: +"0 to 1, how sure you are it is true. Defaults to 0.8."
    • addedInput schema / properties / content / description
      Added value: +"The memory text, one self-contained statement."
    • addedInput schema / properties / fact_key / description
      Added value: +"Stable key for this fact, e.g. 'user:favorite_coffee'. Reusing a key updates that memory. Facts about the outside world rather than the user use the prefix 'world_fact:'."
    • addedInput schema / properties / importance / description
      Added value: +"0 to 1, how much this matters. Defaults to 0.6."
    • addedInput schema / properties / namespace / description
      Added value: +"Memory space to use. Defaults to 'default'. Ignored when the API key is bound to a fixed namespace."
    • addedInput schema / properties / source / description
      Added value: +"Who is writing. Leave unset (defaults to 'mcp'). authored_by is only stored when source is mcp, manual, api or remember_now."
    • addedInput schema / properties / tags / description
      Added value: +"Free-form labels."
    • addedInput schema / properties / type / description
      Added value: +"One of fact, event, preference, relationship, boundary, habit, decision, note. Other values become fact (default)."
    • addedInput schema / properties / valid_as_of / description
      Added value: +"When the fact became true (ISO date or datetime). Used as the event date in recall."
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the destructiveHint annotation by stating exactly what is lost ('the old text is not kept'), that matching fact_key overwrites fields in place, and that hand-authored memories outrank distilled ones and resist pipeline overwrites. It even discloses the return shape.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and the key consequence, and each subsequent sentence carries distinct information (supersede alternative, authored_by behavior, return value). The '(no waiting for the nightly dream)' aside is slightly informal but still informative.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter mutation tool with no output schema, the description covers the destructive semantics, the key alternative, the special-parameter behavior, and the response shape. Nothing essential for correct invocation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is already 100%, so baseline is 3, but the description adds real meaning for authored_by (ranking behavior, pipeline protection) and clarifies the fact_key overwrite contract that the schema only hints at.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Write a refined memory'), its keying mechanism (fact_key), and its timing semantics versus the nightly distillation pipeline. It is clearly distinguishable from siblings like memory_supersede and memory_ingest.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes the agent: 'To keep the old version as history, use memory_supersede,' and explains the authored_by path for hand-authored memories. It gives a clear context and one named alternative, though it doesn't contrast against memory_ingest or spell out when not to write at all.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.