Integrations

Persistent Memory for Mastra - Unison Integration

Give Mastra agents persistent team memory with the Unison TypeScript SDK: recall into instructions, ingest on completion.

unison-mastra

Learn how to give Mastra agents persistent team memory with Unison.

Official adapter

The fastest path is @unisonlabs/mastra — attach Unison as a Mastra Agent memory provider; it injects recalled brain context before each turn and persists after:

npm i @unisonlabs/mastra @mastra/core
import { Agent } from '@mastra/core/agent';
import { UnisonMastraMemory } from '@unisonlabs/mastra';

const agent = new Agent({
  name: 'assistant',
  instructions: '…',
  model,
  memory: new UnisonMastraMemory({ token: process.env.UNISON_TOKEN }),
});

Also exported: UnisonMemory (a standalone facade with recall()/persist()) and UnisonMemoryProcessor for the processor pattern. Mastra's own memory handles the live thread; Unison persists what the whole team's agents learned across projects and machines. For multi-user products, use a brain:act-as service key with per-user actors (details).

On this page