Skip to main content
Integrate Mastra with sovseal to build stateful TypeScript agents that recall customer details, previous tool decisions, and workflow context across runs.
Mastra exposes a lightweight createTool API. Wrapping @sovseal/sdk’s store()/recall() in Mastra tools lets models dynamically read from and write to the local ONEBRAIN memory engine during execution — no network round-trip, no encryption key to manage in the tool.

Installation

Install the Mastra core and @sovseal/sdk dependencies:

Tool Definitions

Create your tool files wrapping AgentStateClient.store()/.recall() (src/agent/tools.ts):

Agent Setup

Wire the memory tools into your Mastra agent definition (src/agent/index.ts):
store/recall require the native host launcher at ~/.sovseal/native-host/run.sh. Run npx -y @sovseal/mcp-server once to provision it — see SDK Reference: Overview. If you need full encrypted state checkpointing (audit lineage, point-in-time rollback) rather than semantic recall, use client.snapshot()/client.restore() instead — see the Node SDK reference.