Conceptsv3 featuresTasks and events

Tasks and events

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

Tasks

A task tracks intent, progress and outcome. It does not decay with time: it moves through a state machine.

State machine

TASK_TRANSITIONS in packages/core/src/cognitive/tasks.ts:

FromTo
pendingin_progress, cancelled
in_progressblocked, completed, delegated, cancelled
blockedin_progress, cancelled
delegatedcompleted, cancelled
completednone
cancellednone

An illegal transition answers 409.

Routes

POST   /tasks                 Create
GET    /tasks                 List; filter with status, assignedTo, parentTaskId
GET    /tasks/{id}
PATCH  /tasks/{id}            Update fields or status
DELETE /tasks/{id}            Close it
POST   /tasks/{id}/delegate   { "assignedTo": "..." }
curl -X POST http://localhost:3939/tasks \
  -H "Authorization: Bearer mns_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Verify docking after firmware 4.2.1",
    "assignedTo": "agent_fleet",
    "priority": "high",
    "dueAt": "2026-11-20T12:00:00Z"
  }'

title and assignedTo are required. priority is critical, high, medium (the default) or low.

On completion

curl -X PATCH http://localhost:3939/tasks/TASK_ID \
  -H "Authorization: Bearer mns_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "status": "completed",
    "outcome": "Docking passed on all 40 robots after restoring the 4.1 offset.",
    "lessonsLearned": "After a firmware update, compare the docking offset with the previous version."
  }'

When a task moves to completed, the server emits task.completed on the event bus and to webhooks. It also tries to extract memories from the task: lessonsLearned becomes a strategy and outcome becomes a fact. This step is best effort: a failure does not fail the update, and the code comments record that linking a derived memory back to its task is rejected by a database constraint today. Do not rely on the full chain being written.

Delegation

POST /tasks/{id}/delegate assigns the task to another agent and answers 409 when the task cannot be delegated from its current state. An agent policy can restrict who an agent may delegate to, or require approval.

Stale tasks

A daily job (mnemo.task.stale, 08:00 UTC) puts on the review queue the tasks in a non-terminal state that have been inactive for more than 14 days. It does not archive them.

Events

An event records that something happened. It is append-only: it has no updatedAt, and DELETE /events/{id} answers 409 with the code event_immutable. To retract what an event says, forget the facts derived from it.

POST   /events                      Record
GET    /events                      List; filter with type, source, after, before
GET    /events/{id}
POST   /events/{id}/annotations     Add a note
PATCH  /events/{id}/sensitivity     Raise its sensitivity (it cannot be lowered)
curl -X POST http://localhost:3939/events \
  -H "Authorization: Bearer mns_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "type": "external",
    "name": "firmware.released",
    "description": "Firmware 4.2.1 shipped to the Larkspur Robotics warehouse fleet.",
    "occurredAt": "2026-11-18T16:00:00Z",
    "source": "release-pipeline",
    "metadata": { "version": "4.2.1" }
  }'

type is system, external, user, agent or scheduled. type, name, description, occurredAt and source are required.

A plugin can react to events with the onEventRecorded hook. See Plugins.

Not in default recall

Tasks and events are indexed, but POST /recall returns them only when you pass kinds, for example "kinds": ["task", "event"].

See also

  • MCP memory_task: actions create, get, list, patch, archive, delegate and complete
  • MCP memory_event: actions create, get, list, archive, annotate and sensitivity. archive reports archived: false, because events are immutable