Mastra
TypeScript framework for production agents.
TypeScript-native framework for building production agent applications with workflows, RAG, evals, and observability built in. Gaining strong traction with TypeScript-first engineering teams.
Beta
Status
SDK / Library
Pattern
Node.js / TypeScript
Runtime
Not yet published
SDK version
Readiness
What “Beta” means for Mastra
The integration path is built and tested. Real customers can attach now, but expect minor breaking changes until the 1.0 contract freeze.
How it attaches
SDK / Library.
Install the @trustvice/actor-mastra package and call witness.attach() once during agent initialisation.
Install the Trustvice adapter package from npm, PyPI, or cargo and call witness.attach(agent) in your application.
npm install @trustvice/actor-mastra
- 1
Install the adapter
Add @trustvice/actor-mastra to your project from npm.
- 2
Issue a workspace API key
Generate a twk_-prefixed key in the dashboard under Settings → API Keys, scoped to the workspace and environment this agent's data should land in.
- 3
Attach the witness
Call witness.attach(agent) once when you initialise your Mastra agent. The adapter registers the framework callbacks, handles retries, and performs the workspace handshake.
- 4
Verify
Trigger one agent run. The dashboard's Witness page shows the canonical record within ~1 second of the agent emitting it.
npm install @trustvice/actor-mastra
Coverage
2 event types captured.
agent.invocationEvery top-level agent run — the input, the resolved output, timing, and token usage.
tool.callEach tool / function the agent invokes, with arguments and the returned result.
The full pattern guide
SDK / Library — end to end.
Every framework on this pattern shares the same platform-side spine, endpoints, and gotchas. The pattern guide covers them in full.
Read the SDK / Library guideNeed help landing Mastra?
Talk to the integration team.
We help you land the integration end to end — including the parts that live in your environment.
Request integration helpDeclare the rules. Have every run checked.
Agents, evidence, governance, commerce and disclosure are all in Trustvice 360. Sign up free and open every suite from one dashboard.