@mastra/mcp-docs-server 1.2.6 → 1.2.7-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/docs/agent-builder/integrations.md +1 -1
- package/.docs/docs/agent-builder/overview.md +4 -3
- package/.docs/docs/agent-builder/skill-registries.md +1 -3
- package/.docs/docs/agent-controller/modes.md +1 -1
- package/.docs/docs/agent-controller/overview.md +4 -3
- package/.docs/docs/agent-controller/session.md +3 -5
- package/.docs/docs/agents/a2a.md +2 -1
- package/.docs/docs/agents/agent-approval.md +2 -2
- package/.docs/docs/agents/code-mode.md +1 -1
- package/.docs/docs/agents/guardrails.md +10 -9
- package/.docs/docs/agents/networks.md +1 -1
- package/.docs/docs/agents/overview.md +5 -5
- package/.docs/docs/agents/skills.md +3 -5
- package/.docs/docs/agents/structured-output.md +1 -1
- package/.docs/docs/agents/supervisor-agents.md +3 -4
- package/.docs/docs/agents/using-tools.md +2 -4
- package/.docs/docs/browser/agent-browser.md +1 -3
- package/.docs/docs/browser/browser-viewer.md +1 -3
- package/.docs/docs/browser/overview.md +2 -1
- package/.docs/docs/browser/recording.md +1 -1
- package/.docs/docs/browser/stagehand.md +1 -1
- package/.docs/docs/capabilities/channels/discord.md +98 -0
- package/.docs/docs/capabilities/channels/other-adapters.md +68 -0
- package/.docs/docs/capabilities/channels/overview.md +255 -0
- package/.docs/docs/capabilities/channels/slack.md +225 -0
- package/.docs/docs/capabilities/channels/teams.md +100 -0
- package/.docs/docs/capabilities/channels/telegram.md +98 -0
- package/.docs/docs/capabilities/channels/whatsapp.md +99 -0
- package/.docs/docs/deployment/mastra-server.md +2 -4
- package/.docs/docs/editor/overview.md +2 -6
- package/.docs/docs/editor/prompts.md +1 -1
- package/.docs/docs/editor/tools.md +1 -3
- package/.docs/docs/evals/built-in-scorers.md +2 -2
- package/.docs/docs/evals/custom-scorers.md +1 -3
- package/.docs/docs/evals/datasets/overview.md +4 -5
- package/.docs/docs/evals/datasets/running-experiments.md +10 -8
- package/.docs/docs/evals/evals-with-memory.md +1 -3
- package/.docs/docs/evals/gates-and-verdicts.md +2 -4
- package/.docs/docs/evals/overview.md +4 -1
- package/.docs/docs/evals/quick-checks.md +3 -5
- package/.docs/docs/getting-started/file-based-agents.md +114 -0
- package/.docs/docs/getting-started/manual-install.md +17 -4
- package/.docs/docs/index.md +1 -1
- package/.docs/docs/long-running-agents/background-tasks.md +3 -3
- package/.docs/docs/long-running-agents/durable-agents.md +5 -7
- package/.docs/docs/long-running-agents/goals.md +5 -7
- package/.docs/docs/long-running-agents/schedules.md +1 -1
- package/.docs/docs/long-running-agents/signal-providers.md +1 -3
- package/.docs/docs/long-running-agents/signals.md +12 -23
- package/.docs/docs/mastra-platform/database.md +2 -2
- package/.docs/docs/mastra-platform/github.md +1 -1
- package/.docs/docs/mastra-platform/observability.md +5 -1
- package/.docs/docs/mcp/mcp-apps.md +3 -3
- package/.docs/docs/mcp/overview.md +6 -10
- package/.docs/docs/memory/memory-processors.md +67 -0
- package/.docs/docs/memory/message-history.md +56 -2
- package/.docs/docs/memory/observational-memory.md +5 -4
- package/.docs/docs/memory/overview.md +8 -6
- package/.docs/docs/memory/semantic-recall.md +36 -2
- package/.docs/docs/memory/working-memory.md +3 -3
- package/.docs/docs/observability/integrations/exporters/mastra-platform.md +1 -3
- package/.docs/docs/observability/integrations/exporters/mastra-storage.md +1 -1
- package/.docs/docs/observability/logging.md +1 -1
- package/.docs/docs/observability/tracing/overview.md +1 -1
- package/.docs/docs/rag/vector-databases.md +7 -2
- package/.docs/docs/server/auth/auth0.md +1 -1
- package/.docs/docs/server/auth/better-auth.md +2 -2
- package/.docs/docs/server/auth/clerk.md +1 -1
- package/.docs/docs/server/auth/firebase.md +1 -1
- package/.docs/docs/server/auth/google.md +3 -3
- package/.docs/docs/server/auth/jwt.md +2 -2
- package/.docs/docs/server/auth/okta.md +2 -2
- package/.docs/docs/server/auth/workos.md +1 -1
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/mastra-server.md +1 -1
- package/.docs/docs/server/pubsub.md +1 -1
- package/.docs/docs/server/request-context.md +4 -4
- package/.docs/docs/server/server-adapters.md +8 -8
- package/.docs/docs/storage/overview.md +214 -0
- package/.docs/docs/studio/auth.md +1 -3
- package/.docs/docs/studio/overview.md +1 -1
- package/.docs/docs/voice/livekit.md +101 -4
- package/.docs/docs/workflows/agents-and-tools.md +3 -5
- package/.docs/docs/workflows/control-flow.md +1 -3
- package/.docs/docs/workflows/overview.md +6 -7
- package/.docs/docs/workflows/snapshots.md +1 -1
- package/.docs/docs/workspace/overview.md +2 -1
- package/.docs/docs/workspace/sandbox.md +2 -0
- package/.docs/guides/build-your-ui/assistant-ui.md +1 -1
- package/.docs/guides/build-your-ui/copilotkit/channels.md +1 -1
- package/.docs/guides/build-your-ui/copilotkit/generative-ui.md +2 -2
- package/.docs/guides/build-your-ui/copilotkit/overview.md +1 -1
- package/.docs/guides/concepts/streaming.md +3 -3
- package/.docs/guides/getting-started/quickstart.md +4 -2
- package/.docs/guides/guide/chef-michel.md +0 -2
- package/.docs/guides/guide/slack-assistant.md +2 -2
- package/.docs/guides/guide/stock-agent.md +0 -2
- package/.docs/models/embeddings.md +119 -0
- package/.docs/models/environment-variables.md +3 -0
- package/.docs/models/gateways/netlify.md +4 -1
- package/.docs/models/gateways/openrouter.md +12 -6
- package/.docs/models/gateways/vercel.md +7 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/crossmodel.md +109 -0
- package/.docs/models/providers/google.md +2 -1
- package/.docs/models/providers/llmgateway.md +184 -181
- package/.docs/models/providers/meta.md +101 -0
- package/.docs/models/providers/nano-gpt.md +2 -2
- package/.docs/models/providers/neon.md +40 -29
- package/.docs/models/providers/openai.md +5 -1
- package/.docs/models/providers/opencode.md +2 -1
- package/.docs/models/providers/poolside.md +6 -5
- package/.docs/models/providers/routing-run.md +20 -34
- package/.docs/models/providers/the-grid-ai.md +3 -3
- package/.docs/models/providers/wandb.md +21 -14
- package/.docs/models/providers/xai.md +2 -1
- package/.docs/models/providers/zenifra.md +73 -0
- package/.docs/models/providers.md +3 -0
- package/.docs/reference/agent-controller/agent-controller-class.md +3 -3
- package/.docs/reference/agent-controller/session.md +4 -4
- package/.docs/reference/agents/agent.md +1 -1
- package/.docs/reference/agents/channels.md +2 -2
- package/.docs/reference/agents/inngest-agent.md +1 -1
- package/.docs/reference/agents/listSkills.md +1 -1
- package/.docs/reference/agents/listSuspendedRuns.md +3 -3
- package/.docs/reference/auth/google.md +5 -5
- package/.docs/reference/channels/channel-provider.md +1 -1
- package/.docs/reference/channels/slack-provider.md +3 -3
- package/.docs/reference/cli/mastra.md +119 -12
- package/.docs/reference/code-sdk/mount-agent-controller.md +76 -0
- package/.docs/reference/coding-agent/create-coding-agent.md +1 -1
- package/.docs/reference/configuration.md +1 -1
- package/.docs/reference/evals/checks.md +4 -4
- package/.docs/reference/evals/create-scorer.md +8 -0
- package/.docs/reference/file-based-agents/config.md +97 -0
- package/.docs/reference/file-based-agents/instructions.md +54 -0
- package/.docs/reference/file-based-agents/memory.md +58 -0
- package/.docs/reference/file-based-agents/observability.md +32 -0
- package/.docs/reference/file-based-agents/processors.md +56 -0
- package/.docs/reference/file-based-agents/server.md +37 -0
- package/.docs/reference/file-based-agents/skills.md +56 -0
- package/.docs/reference/file-based-agents/storage.md +30 -0
- package/.docs/reference/file-based-agents/studio.md +56 -0
- package/.docs/reference/file-based-agents/subagents.md +123 -0
- package/.docs/reference/file-based-agents/tools.md +63 -0
- package/.docs/reference/file-based-agents/workflows.md +52 -0
- package/.docs/reference/file-based-agents/workspace.md +74 -0
- package/.docs/reference/index.md +16 -0
- package/.docs/reference/memory/memory-class.md +1 -1
- package/.docs/reference/memory/observational-memory.md +1 -1
- package/.docs/reference/memory/serialized-memory-config.md +1 -1
- package/.docs/reference/memory/summarizeConversation.md +99 -0
- package/.docs/reference/memory/summarizeThread.md +93 -0
- package/.docs/{docs/getting-started → reference}/project-structure.md +3 -10
- package/.docs/reference/pubsub/lease-provider.md +5 -5
- package/.docs/reference/server/express-adapter.md +1 -3
- package/.docs/reference/server/fastify-adapter.md +1 -3
- package/.docs/reference/server/hono-adapter.md +1 -3
- package/.docs/reference/server/koa-adapter.md +1 -3
- package/.docs/reference/server/nestjs-adapter.md +1 -3
- package/.docs/reference/signals/task-signal-provider.md +1 -1
- package/.docs/reference/storage/clickhouse.md +34 -2
- package/.docs/reference/storage/cloudflare-d1.md +1 -1
- package/.docs/reference/storage/composite.md +64 -6
- package/.docs/reference/storage/convex.md +1 -1
- package/.docs/reference/storage/dynamodb.md +1 -1
- package/.docs/reference/storage/mongodb.md +46 -46
- package/.docs/reference/storage/retention.md +74 -6
- package/.docs/reference/tools/create-tool.md +2 -2
- package/.docs/reference/tools/mcp-client.md +22 -0
- package/.docs/reference/tools/mcp-server.md +161 -4
- package/.docs/reference/vectors/mongodb.md +93 -4
- package/.docs/reference/voice/livekit.md +272 -8
- package/.docs/reference/workspace/agentcore-runtime-sandbox.md +1 -3
- package/.docs/reference/workspace/agentfs-filesystem.md +1 -3
- package/.docs/reference/workspace/apple-container-sandbox.md +6 -8
- package/.docs/reference/workspace/archil-filesystem.md +1 -3
- package/.docs/reference/workspace/azure-blob-filesystem.md +1 -3
- package/.docs/reference/workspace/blaxel-sandbox.md +1 -3
- package/.docs/reference/workspace/daytona-sandbox.md +1 -3
- package/.docs/reference/workspace/docker-sandbox.md +1 -3
- package/.docs/reference/workspace/e2b-sandbox.md +1 -3
- package/.docs/reference/workspace/files-sdk-filesystem.md +1 -3
- package/.docs/reference/workspace/gcs-filesystem.md +1 -3
- package/.docs/reference/workspace/google-drive-filesystem.md +1 -3
- package/.docs/reference/workspace/local-filesystem.md +1 -3
- package/.docs/reference/workspace/local-sandbox.md +1 -3
- package/.docs/reference/workspace/mesa-filesystem.md +4 -4
- package/.docs/reference/workspace/modal-sandbox.md +1 -3
- package/.docs/reference/workspace/railway-sandbox.md +2 -4
- package/.docs/reference/workspace/s3-filesystem.md +1 -3
- package/.docs/reference/workspace/vercel-sandbox.md +5 -7
- package/.docs/reference/workspace/vercel-serverless.md +2 -4
- package/CHANGELOG.md +36 -0
- package/package.json +5 -5
- package/.docs/docs/agents/channels.md +0 -225
- package/.docs/docs/agents/file-based-agents.md +0 -297
- package/.docs/docs/memory/storage.md +0 -267
|
@@ -243,4 +243,4 @@ new MastraStorageExporter({
|
|
|
243
243
|
- [Tracing Overview](https://mastra.ai/docs/observability/tracing/overview)
|
|
244
244
|
- [MastraPlatformExporter](https://mastra.ai/docs/observability/integrations/exporters/mastra-platform)
|
|
245
245
|
- [Composite Storage](https://mastra.ai/reference/storage/composite): Combine multiple storage providers
|
|
246
|
-
- [Storage Configuration](https://mastra.ai/docs/
|
|
246
|
+
- [Storage Configuration](https://mastra.ai/docs/storage/overview)
|
|
@@ -22,7 +22,7 @@ export const mastra = new Mastra({
|
|
|
22
22
|
})
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Visit [PinoLogger](https://mastra.ai/reference/logging/pino-logger) for all available configuration options.
|
|
26
26
|
|
|
27
27
|
## Logging to observability storage
|
|
28
28
|
|
|
@@ -325,7 +325,7 @@ const result = await agent.generate([{ role: 'user', content: 'Sensitive operati
|
|
|
325
325
|
})
|
|
326
326
|
```
|
|
327
327
|
|
|
328
|
-
|
|
328
|
+
For more granular control over sensitive data, consider using the [Sensitive Data Filter](https://mastra.ai/docs/observability/integrations/processors/sensitive-data-filter) processor, which can redact specific fields (like passwords, tokens, and keys) while preserving the rest of the input/output.
|
|
329
329
|
|
|
330
330
|
#### Child spans and metadata extraction
|
|
331
331
|
|
|
@@ -14,7 +14,7 @@ import { MongoDBVector } from '@mastra/mongodb'
|
|
|
14
14
|
const store = new MongoDBVector({
|
|
15
15
|
id: 'mongodb-vector',
|
|
16
16
|
uri: process.env.MONGODB_URI,
|
|
17
|
-
dbName: process.env.
|
|
17
|
+
dbName: process.env.MONGODB_DB_NAME,
|
|
18
18
|
})
|
|
19
19
|
await store.createIndex({
|
|
20
20
|
indexName: 'myCollection',
|
|
@@ -27,10 +27,14 @@ await store.upsert({
|
|
|
27
27
|
})
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
### Using MongoDB Atlas Vector
|
|
30
|
+
### Using MongoDB Atlas Vector Search
|
|
31
31
|
|
|
32
32
|
For detailed setup instructions and best practices, see the [official MongoDB Atlas Vector Search documentation](https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-overview/?utm_campaign=devrel\&utm_source=third-party-content\&utm_medium=cta\&utm_content=mastra-docs).
|
|
33
33
|
|
|
34
|
+
### Using VoyageAI with MongoDB
|
|
35
|
+
|
|
36
|
+
MongoDB works seamlessly with VoyageAI's embedding models, which are optimized for retrieval tasks. For complete examples and specialized models, see the [VoyageAI embeddings documentation](https://mastra.ai/models/embeddings) and [MongoDB vector reference](https://mastra.ai/reference/vectors/mongodb).
|
|
37
|
+
|
|
34
38
|
**PgVector**:
|
|
35
39
|
|
|
36
40
|
```ts
|
|
@@ -359,6 +363,7 @@ The dimension size must match the output dimension of your chosen embedding mode
|
|
|
359
363
|
|
|
360
364
|
- `OpenAI text-embedding-3-small`: 1536 dimensions (or custom, e.g., 256)
|
|
361
365
|
- `Cohere embed-multilingual-v3`: 1024 dimensions
|
|
366
|
+
- `VoyageAI voyage-3.5`: 1024 dimensions (or custom: 256, 512, 1024, 2048)
|
|
362
367
|
- `Google gemini-embedding-001`: 768 dimensions (or custom)
|
|
363
368
|
|
|
364
369
|
> **Warning:** Index dimensions can't be changed after creation. To use a different model, delete and recreate the index with the new dimension size.
|
|
@@ -105,7 +105,7 @@ const auth0Provider = new MastraAuthAuth0({
|
|
|
105
105
|
})
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
Visit [MastraAuthAuth0](https://mastra.ai/reference/auth/auth0) for all available configuration options.
|
|
109
109
|
|
|
110
110
|
## Client-side setup
|
|
111
111
|
|
|
@@ -87,7 +87,7 @@ export const mastra = new Mastra({
|
|
|
87
87
|
})
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
Visit [MastraAuthBetterAuth](https://mastra.ai/reference/auth/better-auth) for all available configuration options.
|
|
91
91
|
|
|
92
92
|
## Custom authorization
|
|
93
93
|
|
|
@@ -180,7 +180,7 @@ export const mastraClient = new MastraClient({
|
|
|
180
180
|
})
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
Visit [Mastra Client SDK](https://mastra.ai/docs/server/mastra-client) for more configuration options.
|
|
184
184
|
|
|
185
185
|
### Making authenticated requests
|
|
186
186
|
|
|
@@ -88,7 +88,7 @@ export const useClerkAuth = () => {
|
|
|
88
88
|
}
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
Refer to the [Clerk documentation](https://clerk.com/docs) for more information.
|
|
92
92
|
|
|
93
93
|
## Configuring `MastraClient`
|
|
94
94
|
|
|
@@ -118,7 +118,7 @@ const firebaseAuth = new MastraAuthFirebase({
|
|
|
118
118
|
})
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
Visit [MastraAuthFirebase](https://mastra.ai/reference/auth/firebase) for all available configuration options.
|
|
122
122
|
|
|
123
123
|
## Client-side setup
|
|
124
124
|
|
|
@@ -168,7 +168,7 @@ export const mastra = new Mastra({
|
|
|
168
168
|
})
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
Visit [MastraAuthGoogle](https://mastra.ai/reference/auth/google) for all available configuration options.
|
|
172
172
|
|
|
173
173
|
## Role mapping
|
|
174
174
|
|
|
@@ -242,7 +242,7 @@ export const createMastraClient = (idToken: string) => {
|
|
|
242
242
|
}
|
|
243
243
|
```
|
|
244
244
|
|
|
245
|
-
|
|
245
|
+
Visit [Mastra Client SDK](https://mastra.ai/docs/server/mastra-client) for more configuration options.
|
|
246
246
|
|
|
247
247
|
### Making authenticated requests
|
|
248
248
|
|
|
@@ -273,7 +273,7 @@ curl -X POST http://localhost:4111/api/agents/weatherAgent/generate \
|
|
|
273
273
|
- **Workspace users are rejected**: Verify `GOOGLE_ALLOWED_DOMAINS` matches the Google ID token `hd` claim.
|
|
274
274
|
- **Consumer Gmail accounts are rejected**: This is expected when `allowedDomains` is configured because Gmail accounts don't have a Workspace `hd` claim.
|
|
275
275
|
- **RBAC returns default permissions**: No roles were resolved for the user. Verify the user email or custom `getUserKey`, Google group membership, and `roleMapping`. If the Directory API lookup fails, the provider throws an error instead of returning `_default`.
|
|
276
|
-
- **Cookies
|
|
276
|
+
- **Cookies aren't sent cross-origin**: Set `credentials: "include"` in `MastraClient` and configure `server.cors` with your frontend origin and `credentials: true`.
|
|
277
277
|
- **Session lost on restart**: Set `GOOGLE_COOKIE_PASSWORD` to a stable value of at least 32 characters. Without it, an auto-generated key is used in development and changes on each restart.
|
|
278
278
|
|
|
279
279
|
## Related
|
|
@@ -61,7 +61,7 @@ export const mastra = new Mastra({
|
|
|
61
61
|
})
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
Visit [MastraJwtAuth](https://mastra.ai/reference/auth/jwt) for all available configuration options.
|
|
65
65
|
|
|
66
66
|
Inside [Studio](https://mastra.ai/docs/studio/overview), go to **Settings** and under **Headers** select the **"Add Header"** button. Enter `Authorization` as the header name and `Bearer <your-jwt>` as the value.
|
|
67
67
|
|
|
@@ -80,7 +80,7 @@ export const mastraClient = new MastraClient({
|
|
|
80
80
|
})
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
Visit [Mastra Client SDK](https://mastra.ai/docs/server/mastra-client) for more configuration options.
|
|
84
84
|
|
|
85
85
|
### Making authenticated requests
|
|
86
86
|
|
|
@@ -120,7 +120,7 @@ export const mastra = new Mastra({
|
|
|
120
120
|
|
|
121
121
|
> **Note:** To link users between providers, store the Okta user ID in the other provider's user metadata. Mastra uses this ID to fetch groups from Okta.
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
Visit [MastraAuthOkta](https://mastra.ai/reference/auth/okta) for all available configuration options.
|
|
124
124
|
|
|
125
125
|
## Role mapping
|
|
126
126
|
|
|
@@ -194,7 +194,7 @@ export const createMastraClient = (accessToken: string) => {
|
|
|
194
194
|
}
|
|
195
195
|
```
|
|
196
196
|
|
|
197
|
-
|
|
197
|
+
Visit [Mastra Client SDK](https://mastra.ai/docs/server/mastra-client) for more configuration options.
|
|
198
198
|
|
|
199
199
|
### Making authenticated requests
|
|
200
200
|
|
|
@@ -149,7 +149,7 @@ const workosAuth = new AdminOnlyWorkosAuth({
|
|
|
149
149
|
})
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
Visit [MastraAuthWorkos](https://mastra.ai/reference/auth/workos) for all available configuration options.
|
|
153
153
|
|
|
154
154
|
## Client-side setup
|
|
155
155
|
|
|
@@ -134,7 +134,7 @@ export const mastraClient = new MastraClient({
|
|
|
134
134
|
})
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
Visit [MastraClient](https://mastra.ai/reference/client-js/mastra-client) for more configuration options.
|
|
138
138
|
|
|
139
139
|
## Credentials and session cookies
|
|
140
140
|
|
|
@@ -32,7 +32,7 @@ export const mastra = new Mastra({
|
|
|
32
32
|
})
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Visit the [configuration reference](https://mastra.ai/reference/configuration) for a full list of available server options.
|
|
36
36
|
|
|
37
37
|
## Deploy your server
|
|
38
38
|
|
|
@@ -116,7 +116,7 @@ export const mastra = new Mastra({
|
|
|
116
116
|
})
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
Visit the [PubSub reference](https://mastra.ai/reference/pubsub/base) for the full delivery contract and the configuration options for each backend.
|
|
120
120
|
|
|
121
121
|
## Related
|
|
122
122
|
|
|
@@ -82,7 +82,7 @@ export const mastra = new Mastra({
|
|
|
82
82
|
})
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
Visit [Middleware](https://mastra.ai/docs/server/middleware) for how to use server middleware.
|
|
86
86
|
|
|
87
87
|
## Studio
|
|
88
88
|
|
|
@@ -188,7 +188,7 @@ export const registryAgent = new Agent({
|
|
|
188
188
|
})
|
|
189
189
|
```
|
|
190
190
|
|
|
191
|
-
|
|
191
|
+
Visit [Agent](https://mastra.ai/reference/agents/agent) for a full list of configuration options.
|
|
192
192
|
|
|
193
193
|
## Accessing values from workflow steps
|
|
194
194
|
|
|
@@ -210,7 +210,7 @@ const stepOne = createStep({
|
|
|
210
210
|
})
|
|
211
211
|
```
|
|
212
212
|
|
|
213
|
-
|
|
213
|
+
Visit [createStep()](https://mastra.ai/reference/workflows/step) for a full list of configuration options.
|
|
214
214
|
|
|
215
215
|
## Accessing values with tools
|
|
216
216
|
|
|
@@ -232,7 +232,7 @@ export const weatherTool = createTool({
|
|
|
232
232
|
})
|
|
233
233
|
```
|
|
234
234
|
|
|
235
|
-
|
|
235
|
+
Visit [createTool()](https://mastra.ai/reference/tools/create-tool) for a full list of configuration options.
|
|
236
236
|
|
|
237
237
|
## Reserved keys
|
|
238
238
|
|
|
@@ -303,7 +303,7 @@ app.listen(4111, () => {
|
|
|
303
303
|
})
|
|
304
304
|
```
|
|
305
305
|
|
|
306
|
-
|
|
306
|
+
See the [Express Adapter](https://mastra.ai/reference/server/express-adapter) documentation for full configuration options.
|
|
307
307
|
|
|
308
308
|
**Hono**:
|
|
309
309
|
|
|
@@ -324,7 +324,7 @@ serve({ fetch: app.fetch, port: 4111 }, () => {
|
|
|
324
324
|
})
|
|
325
325
|
```
|
|
326
326
|
|
|
327
|
-
|
|
327
|
+
See the [Hono Adapter](https://mastra.ai/reference/server/hono-adapter) documentation for full configuration options.
|
|
328
328
|
|
|
329
329
|
**Fastify**:
|
|
330
330
|
|
|
@@ -352,7 +352,7 @@ app.listen({ port }, () => {
|
|
|
352
352
|
})
|
|
353
353
|
```
|
|
354
354
|
|
|
355
|
-
|
|
355
|
+
See the [Fastify Adapter](https://mastra.ai/reference/server/fastify-adapter) documentation for full configuration options.
|
|
356
356
|
|
|
357
357
|
**Koa**:
|
|
358
358
|
|
|
@@ -387,7 +387,7 @@ app.listen(port, () => {
|
|
|
387
387
|
})
|
|
388
388
|
```
|
|
389
389
|
|
|
390
|
-
|
|
390
|
+
See the [Koa Adapter](https://mastra.ai/reference/server/koa-adapter) documentation for full configuration options.
|
|
391
391
|
|
|
392
392
|
**NestJS**:
|
|
393
393
|
|
|
@@ -418,7 +418,7 @@ async function bootstrap() {
|
|
|
418
418
|
bootstrap()
|
|
419
419
|
```
|
|
420
420
|
|
|
421
|
-
|
|
421
|
+
See the [NestJS Adapter](https://mastra.ai/reference/server/nestjs-adapter) documentation for full configuration options.
|
|
422
422
|
|
|
423
423
|
## Initialization flow
|
|
424
424
|
|
|
@@ -460,7 +460,7 @@ You can add your own routes to the app alongside Mastra's routes.
|
|
|
460
460
|
- When you want Mastra-managed auth and route metadata such as `requiresAuth`, prefer `registerApiRoute()`.
|
|
461
461
|
- When you mount routes directly on the framework app, use the adapter's exported `createAuthMiddleware()` helper if those routes need Mastra auth.
|
|
462
462
|
|
|
463
|
-
|
|
463
|
+
Visit "Adding custom routes" for [Express](https://mastra.ai/reference/server/express-adapter) and [Hono](https://mastra.ai/reference/server/hono-adapter) for more information.
|
|
464
464
|
|
|
465
465
|
## Route prefixes
|
|
466
466
|
|
|
@@ -513,7 +513,7 @@ const server = new MastraServer({
|
|
|
513
513
|
})
|
|
514
514
|
```
|
|
515
515
|
|
|
516
|
-
|
|
516
|
+
See [MastraServer](https://mastra.ai/reference/server/mastra-server) for full configuration options.
|
|
517
517
|
|
|
518
518
|
## Per-route auth overrides
|
|
519
519
|
|
|
@@ -540,7 +540,7 @@ const server = new MastraServer({
|
|
|
540
540
|
})
|
|
541
541
|
```
|
|
542
542
|
|
|
543
|
-
|
|
543
|
+
See [MastraServer](https://mastra.ai/reference/server/mastra-server) for full configuration options.
|
|
544
544
|
|
|
545
545
|
## Accessing the app
|
|
546
546
|
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Storage overview
|
|
4
|
+
|
|
5
|
+
Storage is the persistence layer for the Mastra runtime. It keeps memory, workflow state, observability data, eval results, schedules, and long-running agent state available after a process restarts.
|
|
6
|
+
|
|
7
|
+
Storage powers:
|
|
8
|
+
|
|
9
|
+
- [Memory](https://mastra.ai/docs/memory/overview): Message history, threads, resources, and working memory.
|
|
10
|
+
- [Workflows](https://mastra.ai/docs/workflows/overview): Durable snapshots for suspended and resumed workflow runs.
|
|
11
|
+
- [Observability](https://mastra.ai/docs/observability/overview): Traces, spans, metrics, logs, and feedback.
|
|
12
|
+
- [Evals](https://mastra.ai/docs/evals/overview): Scores, datasets, experiments, and evaluation results.
|
|
13
|
+
- [Long-running agents](https://mastra.ai/docs/long-running-agents/durable-agents): Background tasks, schedules, goals, and thread state.
|
|
14
|
+
|
|
15
|
+
## When to configure storage
|
|
16
|
+
|
|
17
|
+
Configure a persistent storage adapter when state must survive restarts, be shared across processes, or be visible in Studio across sessions. The default in-memory store is useful for tests and short local experiments, but it loses data when the process exits.
|
|
18
|
+
|
|
19
|
+
Use storage when your application needs any of these behaviors:
|
|
20
|
+
|
|
21
|
+
- Agents remember past messages or user facts.
|
|
22
|
+
- Workflows suspend and resume after a restart.
|
|
23
|
+
- Traces, metrics, logs, scores, or feedback stay available for analysis.
|
|
24
|
+
- Schedules and background tasks continue across deployments.
|
|
25
|
+
- Multiple runtime processes read and write the same state.
|
|
26
|
+
|
|
27
|
+
## How storage works
|
|
28
|
+
|
|
29
|
+
Mastra storage is organized into **domains**. A domain owns one type of runtime data, and a storage adapter implements one or more domains.
|
|
30
|
+
|
|
31
|
+
| Domain | What it stores |
|
|
32
|
+
| ----------------- | --------------------------------------------------------------------------- |
|
|
33
|
+
| `memory` | Threads, messages, resources, working memory, and other agent memory state. |
|
|
34
|
+
| `workflows` | Workflow snapshots used to suspend and resume runs. |
|
|
35
|
+
| `observability` | Traces, spans, metrics, logs, and feedback. |
|
|
36
|
+
| `scores` | Eval score records. |
|
|
37
|
+
| `datasets` | Dataset records and dataset items used by evals and experiments. |
|
|
38
|
+
| `experiments` | Experiment runs and per-item experiment results. |
|
|
39
|
+
| `backgroundTasks` | Background task records and execution state. |
|
|
40
|
+
| `schedules` | Schedule definitions and trigger history. |
|
|
41
|
+
| `threadState` | Durable task, goal, and thread state. |
|
|
42
|
+
|
|
43
|
+
Adapter support varies by domain. For the full domain list and built-in schemas, see the [storage overview reference](https://mastra.ai/reference/storage/overview).
|
|
44
|
+
|
|
45
|
+
## Choose a backend by data shape
|
|
46
|
+
|
|
47
|
+
Different domains write and query different kinds of data. Pick a backend based on the domain's access pattern:
|
|
48
|
+
|
|
49
|
+
- `memory`: Reads and writes rows during every remembered agent call. Use a transactional database such as libSQL, PostgreSQL, or MongoDB.
|
|
50
|
+
- `observability`: Writes high-volume telemetry and often queries aggregations. Use a dedicated observability store or an online analytical processing (OLAP) backend such as ClickHouse or DuckDB.
|
|
51
|
+
- `workflows`: Stores durable snapshots that must be available when a run resumes. Use a reliable persistent database.
|
|
52
|
+
- `scores`, `datasets`, and `experiments`: Store lower-frequency evaluation data that's often read later for analysis.
|
|
53
|
+
- `schedules`: Stores schedule definitions and fire history. Use an adapter that implements the schedules domain.
|
|
54
|
+
|
|
55
|
+
When domains have different operational needs, use [composite storage](#composite-storage) to route each domain to the right backend.
|
|
56
|
+
|
|
57
|
+
## Get started locally
|
|
58
|
+
|
|
59
|
+
For local development, use libSQL with a file-backed database. It doesn't require a separate database server and persists state between restarts.
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
import { Mastra } from '@mastra/core'
|
|
63
|
+
import { LibSQLStore } from '@mastra/libsql'
|
|
64
|
+
|
|
65
|
+
export const mastra = new Mastra({
|
|
66
|
+
storage: new LibSQLStore({
|
|
67
|
+
id: 'mastra-storage',
|
|
68
|
+
url: 'file:./mastra.db',
|
|
69
|
+
}),
|
|
70
|
+
})
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
> **Sharing the database with Studio:** When running `mastra dev` alongside your application, use an absolute path so both processes access the same database:
|
|
74
|
+
>
|
|
75
|
+
> ```typescript
|
|
76
|
+
> url: 'file:/absolute/path/to/your/project/mastra.db'
|
|
77
|
+
> ```
|
|
78
|
+
>
|
|
79
|
+
> Relative paths like `file:./mastra.db` resolve based on each process's working directory, which may differ.
|
|
80
|
+
|
|
81
|
+
Mastra initializes the required storage structures on first use.
|
|
82
|
+
|
|
83
|
+
## Configure for production
|
|
84
|
+
|
|
85
|
+
For production, use a persistent managed database. PostgreSQL is a good default for most teams because it works well for transactional runtime state and is widely available as a managed service.
|
|
86
|
+
|
|
87
|
+
Production guidance:
|
|
88
|
+
|
|
89
|
+
- Use a managed database with backups, monitoring, and connection pooling.
|
|
90
|
+
- Keep local file databases such as `file:./mastra.db` out of multi-process production deployments.
|
|
91
|
+
- Route high-volume domains, especially `observability`, to a dedicated backend with [composite storage](#composite-storage).
|
|
92
|
+
- Configure [retention](https://mastra.ai/reference/storage/retention) policies on the storage adapter or composite store, then call `storage.prune()` from a scheduler or maintenance job.
|
|
93
|
+
- Choose providers based on the domains your application uses. For example, schedules require an adapter that implements the `schedules` domain.
|
|
94
|
+
|
|
95
|
+
## Configuration scope
|
|
96
|
+
|
|
97
|
+
Storage can be configured at the Mastra instance level or at the agent level.
|
|
98
|
+
|
|
99
|
+
### Instance-level storage
|
|
100
|
+
|
|
101
|
+
Instance-level storage is shared by agents, workflows, observability, evals, schedules, and other runtime features registered on the same Mastra instance.
|
|
102
|
+
|
|
103
|
+
**PostgreSQL**:
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
import { Mastra } from '@mastra/core'
|
|
107
|
+
import { PostgresStore } from '@mastra/pg'
|
|
108
|
+
|
|
109
|
+
export const mastra = new Mastra({
|
|
110
|
+
storage: new PostgresStore({
|
|
111
|
+
id: 'mastra-storage',
|
|
112
|
+
connectionString: process.env.DATABASE_URL,
|
|
113
|
+
}),
|
|
114
|
+
})
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**MongoDB**:
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
import { Mastra } from '@mastra/core'
|
|
121
|
+
import { MongoDBStore } from '@mastra/mongodb'
|
|
122
|
+
|
|
123
|
+
export const mastra = new Mastra({
|
|
124
|
+
storage: new MongoDBStore({
|
|
125
|
+
id: 'mastra-storage',
|
|
126
|
+
uri: process.env.MONGODB_URI,
|
|
127
|
+
dbName: process.env.MONGODB_DB_NAME,
|
|
128
|
+
}),
|
|
129
|
+
})
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Use instance-level storage when most runtime domains can share the same database.
|
|
133
|
+
|
|
134
|
+
### Agent-level storage
|
|
135
|
+
|
|
136
|
+
Agent-level storage is configured on a `Memory` instance. It overrides instance-level storage for that agent's memory data only.
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
import { Agent } from '@mastra/core/agent'
|
|
140
|
+
import { Memory } from '@mastra/memory'
|
|
141
|
+
import { PostgresStore } from '@mastra/pg'
|
|
142
|
+
|
|
143
|
+
export const supportAgent = new Agent({
|
|
144
|
+
id: 'support-agent',
|
|
145
|
+
name: 'Support agent',
|
|
146
|
+
instructions: 'Answer customer support questions.',
|
|
147
|
+
model: 'openai/gpt-5.5',
|
|
148
|
+
memory: new Memory({
|
|
149
|
+
storage: new PostgresStore({
|
|
150
|
+
id: 'support-agent-storage',
|
|
151
|
+
connectionString: process.env.SUPPORT_AGENT_DATABASE_URL,
|
|
152
|
+
}),
|
|
153
|
+
}),
|
|
154
|
+
})
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Use agent-level storage when an agent needs an isolated memory boundary or a different memory backend.
|
|
158
|
+
|
|
159
|
+
## Composite storage
|
|
160
|
+
|
|
161
|
+
[`MastraCompositeStore`](https://mastra.ai/reference/storage/composite) routes domains to different backends. Use it when one database isn't the right fit for every domain.
|
|
162
|
+
|
|
163
|
+
The following example uses libSQL as the default store and routes workflow state to PostgreSQL:
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
import { Mastra } from '@mastra/core'
|
|
167
|
+
import { MastraCompositeStore } from '@mastra/core/storage'
|
|
168
|
+
import { LibSQLStore } from '@mastra/libsql'
|
|
169
|
+
import { WorkflowsPG } from '@mastra/pg'
|
|
170
|
+
|
|
171
|
+
export const mastra = new Mastra({
|
|
172
|
+
storage: new MastraCompositeStore({
|
|
173
|
+
id: 'composite-storage',
|
|
174
|
+
default: new LibSQLStore({
|
|
175
|
+
id: 'default-storage',
|
|
176
|
+
url: 'file:./mastra.db',
|
|
177
|
+
}),
|
|
178
|
+
domains: {
|
|
179
|
+
workflows: new WorkflowsPG({
|
|
180
|
+
connectionString: process.env.DATABASE_URL,
|
|
181
|
+
}),
|
|
182
|
+
},
|
|
183
|
+
}),
|
|
184
|
+
})
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
You can also route `observability` to a dedicated analytics backend. See [observability storage](https://mastra.ai/docs/observability/storage) for an observability-specific example.
|
|
188
|
+
|
|
189
|
+
## Supported providers
|
|
190
|
+
|
|
191
|
+
Each provider page includes installation instructions, configuration parameters, and usage examples:
|
|
192
|
+
|
|
193
|
+
- [libSQL](https://mastra.ai/reference/storage/libsql)
|
|
194
|
+
- [PostgreSQL](https://mastra.ai/reference/storage/postgresql)
|
|
195
|
+
- [MongoDB](https://mastra.ai/reference/storage/mongodb)
|
|
196
|
+
- [Upstash](https://mastra.ai/reference/storage/upstash)
|
|
197
|
+
- [Redis](https://mastra.ai/reference/storage/redis)
|
|
198
|
+
- [Cloudflare D1](https://mastra.ai/reference/storage/cloudflare-d1)
|
|
199
|
+
- [Cloudflare KV & Durable Objects](https://mastra.ai/reference/storage/cloudflare)
|
|
200
|
+
- [Convex](https://mastra.ai/reference/storage/convex)
|
|
201
|
+
- [DynamoDB](https://mastra.ai/reference/storage/dynamodb)
|
|
202
|
+
- [LanceDB](https://mastra.ai/reference/storage/lance)
|
|
203
|
+
- [Microsoft SQL Server](https://mastra.ai/reference/storage/mssql)
|
|
204
|
+
- [Google Cloud Spanner](https://mastra.ai/reference/storage/spanner)
|
|
205
|
+
|
|
206
|
+
> **Tip:** libSQL is the fastest path for local development because it doesn't require running a separate database server.
|
|
207
|
+
|
|
208
|
+
## Next steps
|
|
209
|
+
|
|
210
|
+
- [Composite storage](https://mastra.ai/reference/storage/composite)
|
|
211
|
+
- [Storage retention](https://mastra.ai/reference/storage/retention)
|
|
212
|
+
- [Storage schemas](https://mastra.ai/reference/storage/overview)
|
|
213
|
+
- [Memory](https://mastra.ai/docs/memory/overview)
|
|
214
|
+
- [Observability storage](https://mastra.ai/docs/observability/storage)
|
|
@@ -35,9 +35,7 @@ export const mastra = new Mastra({
|
|
|
35
35
|
})
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Once configured, Studio shows a login screen and requires authentication for all API requests.
|
|
39
|
-
|
|
40
|
-
> **Note:** Visit the [Auth docs](https://mastra.ai/docs/server/auth) for a full list of supported providers.
|
|
38
|
+
Once configured, Studio shows a login screen and requires authentication for all API requests. Visit the [Auth docs](https://mastra.ai/docs/server/auth) for a full list of supported providers.
|
|
41
39
|
|
|
42
40
|
## How it works
|
|
43
41
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Studio provides an interactive UI for building, testing, and managing your agents, workflows, and tools. Run it locally during development, add [authentication](https://mastra.ai/docs/studio/auth), or [deploy it](https://mastra.ai/docs/studio/deployment) to production so your team can manage agents, monitor performance, and gain insights through built-in observability.
|
|
6
6
|
|
|
7
|
-
[
|
|
7
|
+
> **📹 Watch:** Watch [Mastra Studio overview](https://youtu.be/ojGu6Bi4wYk) for a short walkthrough of building, testing, and managing agents in Studio.
|
|
8
8
|
|
|
9
9
|
## Start Studio
|
|
10
10
|
|