Conceptsv3 featuresSelf-editing memory

Self-editing memory

Beta in docs/STATUS.md. Mnemosyne is alpha, on the 3.6.x line, and the API can still change within 3.x.

An agent can edit what it remembers: fix a statement, reinforce a strategy that worked, weaken a fact that misled it. Every edit goes through a policy.

The call

curl -X POST http://localhost:3939/self/edit \
  -H "Authorization: Bearer mns_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "action": "replace",
    "target": "FACT_ID",
    "content": "The Larkspur Robotics warehouse fleet runs firmware 4.2.1.",
    "reason": "4.2.0 was rolled back and replaced by 4.2.1 on 2026-11-18."
  }'

The key needs the memory:self_edit scope. The body takes action, target, content, reason and, optionally, agentId and sessionId.

ActionEffect
appendAdds content to the target
replaceReplaces the target’s content
strengthenRaises the target’s worth
weakenLowers the target’s worth
linkJoins facts in a hyperedge: target is the anchor fact and content is a comma-separated list of at least two other ids
reflectRuns a reflection cycle

target is a fact id, the word profile, or strategy:{id}.

forget is accepted by the route’s schema but is not supported under the default policy: it answers 422 with the code self_edit_forget_unsupported. To close a fact or a strategy, use memory_forget or DELETE /forget/{kind}/{id}.

The policy

Defaults are DEFAULT_SELF_EDIT_POLICY in packages/core/src/cognitive/self-edit.ts.

SettingDefault
maxEditsPerSession5
maxDeletesPerDay3
maxStrengthensPerDay3
maxWeakensPerDay5
requireReasontrue
editCooldown300 seconds between edits of the same target
allowEditown_facts, own_strategies, own_profile
requireApprovaldelete_fact, edit_entity, change_decision

An edit over a limit is refused as rate-limited. An edit that needs approval is not applied and the response says so: {"applied": false, "approvalRequired": true, ...}.

reason is mandatory and is checked by the policy. It is not written to a durable audit log yet.

Reflection

curl -X POST http://localhost:3939/self/reflect \
  -H "Authorization: Bearer mns_live_..." \
  -H "Content-Type: application/json" \
  -d '{"agentId": "agent_support"}'

A reflection cycle (packages/core/src/cognitive/self-reflect.ts):

  1. Reads the agent’s most recent episodes.
  2. Reads which strategies each episode used and how it ended.
  3. Strengthens the strategies of successful episodes and weakens those of failed ones.
  4. Rewrites the agent profile.
  5. Logs the reflection as an episode.

It also runs on its own after every ten session collapses. GET /self/profile returns the agent profile.

From MCP

memory_self_edit takes action (append, replace, strengthen, weaken, reflect or link), target, content, reason and, optionally, sessionId and idempotencyKey. memory_update is a shortcut for replace on a fact: it takes factId, statement and an optional reason.

See also