Conceptsv3 featuresProcedural memory

Procedural memory

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

Facts and decisions store what an agent knows. Procedural memory stores how it acts.

Three procedural kinds

KindWhat it holdsRoutesMCP tool
strategyA trigger → action rule, with optional context/strategiesmemory_strategy
workflowA multi-step process with ordered steps/workflowsmemory_workflow
skillA stored prompt template for a repeatable task/skillsmemory_skill

All three are searched by default recall. Their worth evidence decays with a 173-day half-life when unused, the slowest of any kind. A strategy is rated with POST /strategies/{id}/rate and a body of {"outcome": "success"} or {"outcome": "failure"}.

Prompt evolution

The second half of procedural memory is a loop that proposes changes to an agent’s system prompt from how its sessions went (packages/core/src/cognitive/procedural.ts):

  1. Budget gate. If the workspace’s monthly LLM spend is below skipIfBudgetBelow, the pass is skipped, so an inactive workspace does not trigger LLM calls.
  2. Collect the last topK scored sessions for the agent and split them: high (score above 0.8) and low (score below 0.4).
  3. One LLM call describes what separates the two groups and proposes a change to the prompt.
  4. Validate the proposal against a token budget.
  5. Store it as a candidate prompt version.
  6. A/B test over ten sessions, then activate the candidate or roll it back.

Session scores come from POST /session/{id}/feedback.

curl -X POST http://localhost:3939/procedural/optimize \
  -H "Authorization: Bearer mns_live_..." \
  -H "Content-Type: application/json" \
  -d '{"agentId": "agent_support"}'
FieldDefaultMeaning
agentIdRequired. The agent whose prompt to evolve
topK20Sessions to read
highThreshold0.8Minimum score for the high group
lowThreshold0.4Maximum score for the low group
skipIfBudgetBelow0.01Monthly spend, in USD, below which the pass is skipped

The response says what happened:

{
  "outcome": "created",
  "promptVersionId": "...",
  "transitionResult": { "action": "noop", "reason": "..." }
}

outcome is created or skipped, with a reason when skipped. transitionResult.action is activated, rolled_back or noop. The route answers 503 when no LLM is configured. A weekly job (mnemo.procedural.evaluate, Mondays at 03:00 UTC) runs the same evaluation.

Reading prompt versions

GET /procedural/prompt/:agent      The active or candidate version, or null
GET /procedural/versions/:agent    Every version, newest first

A version carries id, agentId, status, promptText, diffFromPrevious, algorithm, trajectoriesUsed, avgScoreBefore, avgScoreAfter, activatedAt and createdAt.

Mnemosyne stores and versions the prompt. Your agent decides whether to load the active version into its system prompt.

See also