unstale

npm / @mastra/memory

@mastra/memory

What changed in @mastra/memory 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.

2 breaking8 new APIs and options6 behavior and defaults10 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

@mastra/memory 126 changes

Breaking changes 2

  • A multiplier blockAfter now scales a per-thread messageTokens override instead of the instance threshold.

    1.37.1release notes

  • Merges are rejected with HTTP 400 when the storage adapter does not support atomic merges, rather than silently replacing the record.

    1.37.0release notes

New APIs and options 8

  • Set observationalMemory.observation.observeOnContextOverflow to false to turn off automatic recovery from context overflow.

    1.38.0release notes

  • Pass force: true to observe pending messages regardless of the threshold for that call only.

    1.38.0release notes

  • getStatus() now returns observationBlockAfter and inAsyncObservationBand to expose the observation blocking threshold and async observation band.

    1.37.1release notes

  • Lets applications override the model selected by automatic model resolution for a provider.

    1.37.0release notes

  • Adds a method to merge partial working-memory updates from application code; PostgreSQL performs deep merges in a row-locked transaction when scope is resource.

    1.37.0release notes

  • Previews the model ID that automatic model selection would pick, for uses such as settings UIs.

    1.37.0release notes

  • Turns the automatically picked model ID into a model, allowing auto resolution to use application credentials and routing.

    1.37.0release notes

  • Accepts mode: 'merge' for HTTP working-memory updates, merging partial updates rather than replacing the record.

    1.37.0release notes

Behavior and default changes 6

  • When a provider rejects a request for exceeding its context window, Observational Memory observes pending messages and retries once with smaller context. Requires a compatible @mastra/core version.

    1.38.0release notes

  • With async buffering, unobserved messages can grow beyond messageTokens before a step blocks; the default is 1.2, and setting it to 1 preserves synchronous observation at the threshold.

    1.37.1release notes

  • The token budget now limits previous observations on every observation path; zero omits them, and the default false sends the full previous observations.

    1.37.1release notes

  • Buffering, activation, observation, reflection, and config-override writes for a thread or resource run one at a time within a process; due reflections take priority, and stuck writes stop blocking later writes after 60 seconds.

    1.37.1release notes

  • Default Reflector instructions now preserve concrete facts, changes of mind, and explicit statements of not knowing, refusing, or never having done something; custom instructions are still appended.

    1.37.1release notes

  • The model, observation.model, and reflection.model defaults change to 'auto'. Observer and Reflector models resolve independently from the agent's main model on every call; set a concrete model ID to keep a fixed model.

    1.37.0release notes

Fixes and other changes 10

  • Long numbers are now counted accurately, so memory and token limits trigger at the right time. Estimates saved on existing messages are recalculated.

    1.38.0release notes

  • The end marker is written to the message carrying the cycle's start marker, preventing it from disappearing on save or overwriting the agent's streamed response.

    1.37.1release notes

  • Observer, reflector and fallback model lists no longer cause type checking complexity to grow with the number of model IDs.

    1.37.1release notes

  • Concurrent buffering, activation, observation, and reflection no longer lose or duplicate context across processes and durable agent steps; stale work after memory clearing or thread deletion is discarded.

    1.37.1release notes

  • Observations are kept in event order so outdated state is not recorded as newer than later user instructions.

    1.37.1release notes

  • Live scorers now receive every response message across suspend and resume segments under the original runId, including tool calls removed from agent context by observational memory.

    1.37.1release notes

  • Semantic recall no longer misses a turn's new user message when background buffering picks it up on the first step.

    1.37.1release notes

  • An empty working-memory result no longer replaces stored working memory; Mastra retries extraction while preserving other extracted values such as the thread title.

    1.37.1release notes

  • When an observational memory error stops a run, the user message and tool results from completed steps are saved first.

    1.37.0release notes

  • Persistence and idle buffering now use the terminal message list accepted by the processor pipeline rather than the list captured by the observation turn.

    1.37.0release notes