@mastra/mcp-docs-server 1.1.42-alpha.8 → 1.1.43-alpha.0
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/memory.md +1 -1
- package/.docs/docs/agents/a2a.md +1 -1
- package/.docs/docs/agents/acp.md +23 -160
- package/.docs/docs/agents/adding-voice.md +7 -7
- package/.docs/docs/agents/agent-approval.md +1 -1
- package/.docs/docs/agents/background-tasks.md +2 -2
- package/.docs/docs/agents/channels.md +1 -1
- package/.docs/docs/agents/code-mode.md +3 -3
- package/.docs/docs/agents/guardrails.md +2 -2
- package/.docs/docs/agents/networks.md +1 -1
- package/.docs/docs/agents/overview.md +1 -1
- package/.docs/docs/agents/processors.md +146 -3
- package/.docs/docs/agents/sdk-agents.md +261 -0
- package/.docs/docs/agents/signals.md +230 -10
- package/.docs/docs/agents/structured-output.md +5 -5
- package/.docs/docs/agents/supervisor-agents.md +2 -2
- package/.docs/docs/agents/using-tools.md +5 -5
- package/.docs/docs/browser/agent-browser.md +1 -1
- package/.docs/docs/browser/browser-viewer.md +1 -1
- package/.docs/docs/browser/overview.md +1 -1
- package/.docs/docs/browser/stagehand.md +5 -5
- package/.docs/docs/build-with-ai/skills.md +3 -3
- package/.docs/docs/editor/overview.md +12 -11
- package/.docs/docs/evals/custom-scorers.md +1 -1
- package/.docs/docs/evals/datasets/running-experiments.md +1 -1
- package/.docs/docs/evals/overview.md +2 -2
- package/.docs/docs/getting-started/build-with-ai.md +37 -0
- package/.docs/docs/mastra-platform/observability.md +4 -4
- package/.docs/docs/mcp/mcp-apps.md +3 -3
- package/.docs/docs/mcp/overview.md +1 -1
- package/.docs/docs/memory/memory-processors.md +6 -6
- package/.docs/docs/memory/multi-user-threads.md +2 -2
- package/.docs/docs/memory/semantic-recall.md +1 -1
- package/.docs/docs/memory/storage.md +2 -1
- package/.docs/docs/memory/working-memory.md +28 -1
- package/.docs/docs/observability/metrics/querying.md +1 -1
- package/.docs/docs/observability/tracing/exporters/langfuse.md +1 -1
- package/.docs/docs/observability/tracing/exporters/langsmith.md +2 -2
- package/.docs/docs/rag/graph-rag.md +2 -2
- package/.docs/docs/rag/retrieval.md +12 -12
- package/.docs/docs/server/auth/fga.md +2 -0
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/pubsub.md +124 -0
- package/.docs/docs/server/request-context.md +3 -3
- package/.docs/docs/streaming/overview.md +1 -1
- package/.docs/docs/streaming/tool-streaming.md +1 -1
- package/.docs/docs/studio/auth.md +20 -0
- package/.docs/docs/voice/overview.md +25 -25
- package/.docs/docs/voice/speech-to-speech.md +4 -4
- package/.docs/docs/voice/speech-to-text.md +1 -1
- package/.docs/docs/voice/text-to-speech.md +1 -1
- package/.docs/docs/workspace/filesystem.md +2 -2
- package/.docs/docs/workspace/overview.md +1 -1
- package/.docs/docs/workspace/sandbox.md +1 -1
- package/.docs/guides/build-your-ui/ai-sdk-ui.md +1 -1
- package/.docs/guides/guide/ai-recruiter.md +1 -1
- package/.docs/guides/guide/chef-michel.md +1 -1
- package/.docs/guides/guide/code-review-bot.md +1 -1
- package/.docs/guides/guide/dev-assistant.md +1 -1
- package/.docs/guides/guide/docs-manager.md +1 -1
- package/.docs/guides/guide/firecrawl.md +1 -1
- package/.docs/guides/guide/github-actions-pr-description.md +1 -1
- package/.docs/guides/guide/research-assistant.md +1 -1
- package/.docs/guides/guide/research-coordinator.md +2 -2
- package/.docs/guides/guide/slack-assistant.md +1 -1
- package/.docs/guides/guide/stock-agent.md +2 -2
- package/.docs/guides/guide/whatsapp-chat-bot.md +2 -2
- package/.docs/guides/migrations/agentnetwork.md +4 -4
- package/.docs/guides/migrations/upgrade-to-v1/agent.md +1 -1
- package/.docs/guides/migrations/vnext-to-standard-apis.md +2 -2
- package/.docs/reference/acp/acp-agent.md +228 -0
- package/.docs/reference/acp/create-acp-tool.md +131 -0
- package/.docs/reference/agents/agent.md +55 -5
- package/.docs/reference/agents/channels.md +47 -5
- package/.docs/reference/agents/durable-agent.md +239 -0
- package/.docs/reference/agents/generateLegacy.md +1 -1
- package/.docs/reference/agents/getLLM.md +2 -2
- package/.docs/reference/agents/getMetadata.md +2 -2
- package/.docs/reference/agents/network.md +1 -1
- package/.docs/reference/browser/agent-browser.md +1 -1
- package/.docs/reference/browser/browser-viewer.md +1 -1
- package/.docs/reference/browser/mastra-browser.md +1 -1
- package/.docs/reference/browser/stagehand-browser.md +5 -5
- package/.docs/reference/cli/mastra.md +5 -5
- package/.docs/reference/client-js/agents.md +41 -7
- package/.docs/reference/configuration.md +1 -1
- package/.docs/reference/evals/answer-relevancy.md +1 -1
- package/.docs/reference/evals/answer-similarity.md +1 -1
- package/.docs/reference/evals/bias.md +1 -1
- package/.docs/reference/evals/context-precision.md +3 -3
- package/.docs/reference/evals/context-relevance.md +11 -11
- package/.docs/reference/evals/faithfulness.md +1 -1
- package/.docs/reference/evals/hallucination.md +5 -5
- package/.docs/reference/evals/noise-sensitivity.md +11 -11
- package/.docs/reference/evals/prompt-alignment.md +15 -15
- package/.docs/reference/evals/tool-call-accuracy.md +3 -3
- package/.docs/reference/evals/toxicity.md +1 -1
- package/.docs/reference/index.md +9 -0
- package/.docs/reference/memory/memory-class.md +3 -3
- package/.docs/reference/memory/observational-memory.md +4 -4
- package/.docs/reference/observability/tracing/exporters/langfuse.md +1 -1
- package/.docs/reference/processors/batch-parts-processor.md +1 -1
- package/.docs/reference/processors/cost-guard-processor.md +1 -1
- package/.docs/reference/processors/language-detector.md +1 -1
- package/.docs/reference/processors/message-history-processor.md +1 -1
- package/.docs/reference/processors/moderation-processor.md +2 -2
- package/.docs/reference/processors/pii-detector.md +2 -2
- package/.docs/reference/processors/prefill-error-handler.md +2 -2
- package/.docs/reference/processors/processor-interface.md +2 -2
- package/.docs/reference/processors/prompt-injection-detector.md +1 -1
- package/.docs/reference/processors/regex-filter-processor.md +1 -1
- package/.docs/reference/processors/response-cache.md +2 -2
- package/.docs/reference/processors/semantic-recall-processor.md +1 -1
- package/.docs/reference/processors/skill-search-processor.md +1 -1
- package/.docs/reference/processors/system-prompt-scrubber.md +1 -1
- package/.docs/reference/processors/token-limiter-processor.md +3 -3
- package/.docs/reference/processors/tool-call-filter.md +2 -2
- package/.docs/reference/processors/tool-search-processor.md +2 -2
- package/.docs/reference/processors/unicode-normalizer.md +1 -1
- package/.docs/reference/processors/working-memory-processor.md +1 -1
- package/.docs/reference/pubsub/base.md +168 -0
- package/.docs/reference/pubsub/caching-pubsub.md +102 -0
- package/.docs/reference/pubsub/event-emitter.md +72 -0
- package/.docs/reference/pubsub/google-cloud-pubsub.md +94 -0
- package/.docs/reference/pubsub/redis-streams.md +108 -0
- package/.docs/reference/pubsub/unix-socket-pubsub.md +52 -0
- package/.docs/reference/rag/rerank.md +1 -1
- package/.docs/reference/server/nestjs-adapter.md +1 -1
- package/.docs/reference/storage/dsql.md +1 -1
- package/.docs/reference/storage/libsql.md +6 -0
- package/.docs/reference/storage/mongodb.md +4 -1
- package/.docs/reference/storage/postgresql.md +4 -1
- package/.docs/reference/storage/redis.md +1 -1
- package/.docs/reference/storage/spanner.md +5 -0
- package/.docs/reference/storage/upstash.md +1 -1
- package/.docs/reference/streaming/agents/stream.md +1 -1
- package/.docs/reference/templates/overview.md +1 -1
- package/.docs/reference/tools/mcp-client.md +2 -2
- package/.docs/reference/tools/mcp-server.md +33 -1
- package/.docs/reference/tools/vector-query-tool.md +1 -1
- package/.docs/reference/vectors/libsql.md +1 -1
- package/.docs/reference/vectors/mongodb.md +1 -1
- package/.docs/reference/vectors/pg.md +1 -1
- package/.docs/reference/vectors/upstash.md +1 -1
- package/.docs/reference/voice/voice.addInstructions.md +1 -1
- package/.docs/reference/workspace/agentfs-filesystem.md +1 -1
- package/.docs/reference/workspace/azure-blob-filesystem.md +1 -1
- package/.docs/reference/workspace/docker-sandbox.md +1 -1
- package/.docs/reference/workspace/e2b-sandbox.md +9 -5
- package/.docs/reference/workspace/files-sdk-filesystem.md +1 -1
- package/.docs/reference/workspace/gcs-filesystem.md +1 -1
- package/.docs/reference/workspace/google-drive-filesystem.md +1 -1
- package/.docs/reference/workspace/local-filesystem.md +1 -1
- package/.docs/reference/workspace/local-sandbox.md +1 -1
- package/.docs/reference/workspace/modal-sandbox.md +1 -1
- package/.docs/reference/workspace/s3-filesystem.md +1 -1
- package/CHANGELOG.md +38 -0
- package/package.json +6 -6
- package/.docs/docs/agents/response-caching.md +0 -150
|
@@ -132,6 +132,9 @@ The storage implementation handles schema creation and updates automatically. It
|
|
|
132
132
|
- `mastra_traces`: Stores telemetry and tracing data
|
|
133
133
|
- `mastra_scorers`: Stores scoring and evaluation data
|
|
134
134
|
- `mastra_resources`: Stores resource working memory data
|
|
135
|
+
- `mastra_notifications`: Stores notification inbox records and delivery metadata
|
|
136
|
+
|
|
137
|
+
`PostgresStore` exposes notification storage through `getStore('notifications')`.
|
|
135
138
|
|
|
136
139
|
### Observability
|
|
137
140
|
|
|
@@ -332,7 +335,7 @@ export const pgAgent = new Agent({
|
|
|
332
335
|
name: 'PG Agent',
|
|
333
336
|
instructions:
|
|
334
337
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
335
|
-
model: 'openai/gpt-5.
|
|
338
|
+
model: 'openai/gpt-5.5',
|
|
336
339
|
memory: new Memory({
|
|
337
340
|
storage: new PostgresStore({
|
|
338
341
|
id: 'pg-agent-storage',
|
|
@@ -181,7 +181,7 @@ export const redisAgent = new Agent({
|
|
|
181
181
|
name: 'Redis Agent',
|
|
182
182
|
instructions:
|
|
183
183
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
184
|
-
model: 'openai/gpt-5.
|
|
184
|
+
model: 'openai/gpt-5.5',
|
|
185
185
|
memory: new Memory({
|
|
186
186
|
storage: new RedisStore({
|
|
187
187
|
id: 'redis-agent-storage',
|
|
@@ -122,6 +122,11 @@ The storage adapter creates the following tables, all using the GoogleSQL dialec
|
|
|
122
122
|
- `mastra_prompt_blocks` / `mastra_prompt_block_versions`: prompt block records and versioned content snapshots (template content, rules, request-context schema)
|
|
123
123
|
- `mastra_scorer_definitions` / `mastra_scorer_definition_versions`: scorer definition records and versioned config snapshots (judge instructions, model, score range, preset config, default sampling)
|
|
124
124
|
- `mastra_schedules` / `mastra_schedule_triggers`: cron-driven workflow schedules and trigger history, consumed by Mastra's built-in `WorkflowScheduler`
|
|
125
|
+
- `mastra_workspaces` / `mastra_workspace_versions`: workspace records and versioned configuration snapshots (filesystem, sandbox, mounts, search, skills, tools)
|
|
126
|
+
- `mastra_datasets` / `mastra_dataset_items` / `mastra_dataset_versions`: evaluation datasets, SCD-2 versioned items, and version snapshots
|
|
127
|
+
- `mastra_experiments` / `mastra_experiment_results`: experiment runs and their per-item results
|
|
128
|
+
- `mastra_favorites`: per-user favorites for agents and skills, with denormalized `favoriteCount` maintained on the parent record
|
|
129
|
+
- `mastra_channel_installations` / `mastra_channel_config`: multi-platform channel installations and per-platform configuration
|
|
125
130
|
- `mastra_ai_spans`: AI tracing spans for observability (per-trace and per-span records, used to power the Studio traces UI)
|
|
126
131
|
|
|
127
132
|
Tables are created with `STRING(MAX)` for text and JSON payloads, `INT64`, `FLOAT64`, `BOOL`, and `TIMESTAMP`.
|
|
@@ -103,7 +103,7 @@ export const upstashAgent = new Agent({
|
|
|
103
103
|
name: 'Upstash Agent',
|
|
104
104
|
instructions:
|
|
105
105
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
106
|
-
model: 'openai/gpt-5.
|
|
106
|
+
model: 'openai/gpt-5.5',
|
|
107
107
|
memory: new Memory({
|
|
108
108
|
storage: new UpstashStore({
|
|
109
109
|
id: 'upstash-agent-storage',
|
|
@@ -322,7 +322,7 @@ await agent.stream('message for agent', {
|
|
|
322
322
|
sentiment: z.enum(['positive', 'negative', 'neutral']),
|
|
323
323
|
confidence: z.number(),
|
|
324
324
|
}),
|
|
325
|
-
model: 'openai/gpt-5.
|
|
325
|
+
model: 'openai/gpt-5.5',
|
|
326
326
|
errorStrategy: 'warn',
|
|
327
327
|
},
|
|
328
328
|
// Output processors for streaming response validation
|
|
@@ -192,7 +192,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
192
192
|
|
|
193
193
|
const agent = new Agent({
|
|
194
194
|
name: 'example-agent',
|
|
195
|
-
model: 'openai/gpt-5.
|
|
195
|
+
model: 'openai/gpt-5.5', // or other provider strings
|
|
196
196
|
instructions: 'Your agent instructions here',
|
|
197
197
|
})
|
|
198
198
|
```
|
|
@@ -890,7 +890,7 @@ const agent = new Agent({
|
|
|
890
890
|
id: 'multi-tool-agent',
|
|
891
891
|
name: 'Multi-tool Agent',
|
|
892
892
|
instructions: 'You have access to multiple tool servers.',
|
|
893
|
-
model: 'openai/gpt-5.
|
|
893
|
+
model: 'openai/gpt-5.5',
|
|
894
894
|
tools: await mcp.listTools(),
|
|
895
895
|
})
|
|
896
896
|
|
|
@@ -941,7 +941,7 @@ const agent = new Agent({
|
|
|
941
941
|
id: 'multi-tool-agent',
|
|
942
942
|
name: 'Multi-tool Agent',
|
|
943
943
|
instructions: 'You help users check stocks and weather.',
|
|
944
|
-
model: 'openai/gpt-5.
|
|
944
|
+
model: 'openai/gpt-5.5',
|
|
945
945
|
})
|
|
946
946
|
|
|
947
947
|
// Later, configure MCP with user-specific settings
|
|
@@ -22,7 +22,7 @@ const myAgent = new Agent({
|
|
|
22
22
|
name: 'MyExampleAgent',
|
|
23
23
|
description: 'A generalist to help with basic questions.',
|
|
24
24
|
instructions: 'You are a helpful assistant.',
|
|
25
|
-
model: 'openai/gpt-5.
|
|
25
|
+
model: 'openai/gpt-5.5',
|
|
26
26
|
})
|
|
27
27
|
|
|
28
28
|
const weatherTool = createTool({
|
|
@@ -67,6 +67,8 @@ The constructor accepts an `MCPServerConfig` object with the following propertie
|
|
|
67
67
|
|
|
68
68
|
**instructions** (`string`): Optional instructions describing how to use the server and its features.
|
|
69
69
|
|
|
70
|
+
**mapAuthInfoToUser** (`({ authInfo, extra, requestContext }) => unknown | null | undefined | Promise<unknown | null | undefined>`): Maps MCP transport auth data from \`extra.authInfo\` into the \`user\` value used by Mastra FGA checks. Use this when an OAuth-protected MCP server is registered on a Mastra instance with an FGA provider.
|
|
71
|
+
|
|
70
72
|
**repository** (`Repository`): Optional repository information for the server's source code.
|
|
71
73
|
|
|
72
74
|
**releaseDate** (`string`): Optional release date of this server version (ISO 8601 string). Defaults to the time of instantiation if not provided.
|
|
@@ -1097,6 +1099,36 @@ Whatever you set on `req.auth` in your HTTP middleware becomes available as `con
|
|
|
1097
1099
|
req.auth = { ... } → context?.mcp?.extra?.authInfo.extra = { ... }
|
|
1098
1100
|
```
|
|
1099
1101
|
|
|
1102
|
+
### Map auth data for FGA
|
|
1103
|
+
|
|
1104
|
+
When an `MCPServer` is registered on a Mastra instance with a fine-grained authorization (FGA) provider, Mastra checks `requestContext.get('user')` before listing or calling tools. HTTP MCP transports pass authenticated data as `extra.authInfo`, so use `mapAuthInfoToUser` to set the user shape expected by your FGA provider.
|
|
1105
|
+
|
|
1106
|
+
```typescript
|
|
1107
|
+
const server = new MCPServer({
|
|
1108
|
+
id: 'my-server',
|
|
1109
|
+
name: 'My Server',
|
|
1110
|
+
version: '1.0.0',
|
|
1111
|
+
tools: { getUserData },
|
|
1112
|
+
mapAuthInfoToUser: ({ authInfo }) => {
|
|
1113
|
+
const user = authInfo as {
|
|
1114
|
+
extra?: {
|
|
1115
|
+
userId?: string
|
|
1116
|
+
organizationMembershipId?: string
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
if (!user.extra?.userId) {
|
|
1121
|
+
return null
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
return {
|
|
1125
|
+
id: user.extra.userId,
|
|
1126
|
+
organizationMembershipId: user.extra.organizationMembershipId,
|
|
1127
|
+
}
|
|
1128
|
+
},
|
|
1129
|
+
})
|
|
1130
|
+
```
|
|
1131
|
+
|
|
1100
1132
|
### Setting Up Authentication Middleware
|
|
1101
1133
|
|
|
1102
1134
|
To pass data to your tools, populate `req.auth` on the Node.js request object in your HTTP server middleware before calling `server.startHTTP()`.
|
|
@@ -142,7 +142,7 @@ const queryTool = createVectorQueryTool({
|
|
|
142
142
|
indexName: 'documentation',
|
|
143
143
|
model: new ModelRouterEmbeddingModel('openai/text-embedding-3-small'),
|
|
144
144
|
reranker: {
|
|
145
|
-
model: 'openai/gpt-5.
|
|
145
|
+
model: 'openai/gpt-5.5',
|
|
146
146
|
options: {
|
|
147
147
|
weights: {
|
|
148
148
|
semantic: 0.5, // Semantic relevance weight
|
|
@@ -277,7 +277,7 @@ export const libsqlAgent = new Agent({
|
|
|
277
277
|
name: 'libSQL Agent',
|
|
278
278
|
instructions:
|
|
279
279
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
280
|
-
model: 'openai/gpt-5.
|
|
280
|
+
model: 'openai/gpt-5.5',
|
|
281
281
|
memory: new Memory({
|
|
282
282
|
storage: new LibSQLStore({
|
|
283
283
|
id: 'libsql-agent-storage',
|
|
@@ -263,7 +263,7 @@ export const mongodbAgent = new Agent({
|
|
|
263
263
|
name: 'mongodb-agent',
|
|
264
264
|
instructions:
|
|
265
265
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
266
|
-
model: 'openai/gpt-5.
|
|
266
|
+
model: 'openai/gpt-5.5',
|
|
267
267
|
memory: new Memory({
|
|
268
268
|
storage: new MongoDBStore({
|
|
269
269
|
id: 'mongodb-storage',
|
|
@@ -401,7 +401,7 @@ export const pgAgent = new Agent({
|
|
|
401
401
|
name: 'PG Agent',
|
|
402
402
|
instructions:
|
|
403
403
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
404
|
-
model: 'openai/gpt-5.
|
|
404
|
+
model: 'openai/gpt-5.5',
|
|
405
405
|
memory: new Memory({
|
|
406
406
|
storage: new PostgresStore({
|
|
407
407
|
id: 'pg-agent-storage',
|
|
@@ -265,7 +265,7 @@ export const upstashAgent = new Agent({
|
|
|
265
265
|
name: 'Upstash Agent',
|
|
266
266
|
instructions:
|
|
267
267
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
268
|
-
model: 'openai/gpt-5.
|
|
268
|
+
model: 'openai/gpt-5.5',
|
|
269
269
|
memory: new Memory({
|
|
270
270
|
storage: new UpstashStore({
|
|
271
271
|
id: 'upstash-agent-storage',
|
|
@@ -20,7 +20,7 @@ const voice = new OpenAIRealtimeVoice({
|
|
|
20
20
|
const agent = new Agent({
|
|
21
21
|
name: 'Customer Support Agent',
|
|
22
22
|
instructions: 'You are a helpful customer support agent for a software company.',
|
|
23
|
-
model: 'openai/gpt-5.
|
|
23
|
+
model: 'openai/gpt-5.5',
|
|
24
24
|
voice,
|
|
25
25
|
})
|
|
26
26
|
|
|
@@ -48,7 +48,7 @@ const workspace = new Workspace({
|
|
|
48
48
|
|
|
49
49
|
const agent = new Agent({
|
|
50
50
|
name: 'dev-agent',
|
|
51
|
-
model: 'anthropic/claude-opus-4-
|
|
51
|
+
model: 'anthropic/claude-opus-4-7',
|
|
52
52
|
workspace,
|
|
53
53
|
})
|
|
54
54
|
```
|
|
@@ -71,6 +71,10 @@ const agent = new Agent({
|
|
|
71
71
|
|
|
72
72
|
**accessToken** (`string`): Access token for authentication. Falls back to E2B\_ACCESS\_TOKEN env var.
|
|
73
73
|
|
|
74
|
+
**metadata** (`Record<string, unknown>`): Custom metadata attached to the sandbox instance.
|
|
75
|
+
|
|
76
|
+
**instructions** (`string | ((opts: { defaultInstructions: string; requestContext?: RequestContext }) => string)`): Custom instructions returned by \`getInstructions()\`. A string fully replaces the defaults; a function receives the defaults and can extend or customize them per-request. Pass an empty string to suppress instructions entirely.
|
|
77
|
+
|
|
74
78
|
## Properties
|
|
75
79
|
|
|
76
80
|
**id** (`string`): Sandbox instance identifier
|
|
@@ -79,9 +83,7 @@ const agent = new Agent({
|
|
|
79
83
|
|
|
80
84
|
**provider** (`string`): Provider identifier ('e2b')
|
|
81
85
|
|
|
82
|
-
**status** (`ProviderStatus`): 'pending' | 'initializing' | 'ready' | 'error'
|
|
83
|
-
|
|
84
|
-
**supportsMounting** (`boolean`): Always true - E2B sandboxes support mounting cloud filesystems
|
|
86
|
+
**status** (`ProviderStatus`): 'pending' | 'initializing' | 'ready' | 'starting' | 'running' | 'stopping' | 'stopped' | 'destroying' | 'destroyed' | 'error'
|
|
85
87
|
|
|
86
88
|
**processes** (`E2BProcessManager`): Background process manager. See \[SandboxProcessManager reference]\(/reference/workspace/process-manager).
|
|
87
89
|
|
|
@@ -118,7 +120,7 @@ See [`SandboxProcessManager` reference](https://mastra.ai/reference/workspace/pr
|
|
|
118
120
|
|
|
119
121
|
## Mounting cloud storage
|
|
120
122
|
|
|
121
|
-
E2B sandboxes can mount S3
|
|
123
|
+
E2B sandboxes can mount S3, GCS, and Azure Blob filesystems, making cloud storage accessible as local directories inside the sandbox. This is useful for:
|
|
122
124
|
|
|
123
125
|
- Processing large datasets stored in cloud buckets
|
|
124
126
|
- Writing output files directly to cloud storage
|
|
@@ -160,6 +162,7 @@ E2B sandboxes use FUSE (Filesystem in Userspace) to mount cloud storage:
|
|
|
160
162
|
|
|
161
163
|
- **S3/R2**: Mounted via [s3fs-fuse](https://github.com/s3fs-fuse/s3fs-fuse)
|
|
162
164
|
- **GCS**: Mounted via [gcsfuse](https://github.com/GoogleCloudPlatform/gcsfuse)
|
|
165
|
+
- **Azure Blob**: Mounted via [blobfuse2](https://github.com/Azure/azure-storage-fuse)
|
|
163
166
|
|
|
164
167
|
The E2B sandbox automatically installs the required FUSE tools when mounting is used. For best performance, pre-build a custom template with the tools installed.
|
|
165
168
|
|
|
@@ -250,4 +253,5 @@ This is optional—`gcsfuse` is installed automatically at mount time if not pre
|
|
|
250
253
|
- [LocalSandbox reference](https://mastra.ai/reference/workspace/local-sandbox)
|
|
251
254
|
- [S3Filesystem reference](https://mastra.ai/reference/workspace/s3-filesystem)
|
|
252
255
|
- [GCSFilesystem reference](https://mastra.ai/reference/workspace/gcs-filesystem)
|
|
256
|
+
- [Azure Blob Filesystem reference](https://mastra.ai/reference/workspace/azure-blob-filesystem)
|
|
253
257
|
- [Workspace overview](https://mastra.ai/docs/workspace/overview)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 1.1.43-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`c973db4`](https://github.com/mastra-ai/mastra/commit/c973db428df1b564ff0c35d4b2a90e8f4f1e13fd), [`552285e`](https://github.com/mastra-ai/mastra/commit/552285e5af43cfc680a0972032cab8de8776c6a0), [`77e686c`](https://github.com/mastra-ai/mastra/commit/77e686c264e493e99ae5024e4dfe3ea5d5a09718), [`ece8dba`](https://github.com/mastra-ai/mastra/commit/ece8dba7ec1a5089eee8c33167cd762bfa91e509), [`e751af2`](https://github.com/mastra-ai/mastra/commit/e751af219433fbf4c7035b2d771b4c9ec8813b05), [`e2a8380`](https://github.com/mastra-ai/mastra/commit/e2a838017a7657850404c1e94c70d79ffdc6f14a), [`be3f1cd`](https://github.com/mastra-ai/mastra/commit/be3f1cd81f0e2a649e8eac15a024d542d814aef8), [`a34d9db`](https://github.com/mastra-ai/mastra/commit/a34d9dbc39fedb722f271318e9355ecee70489ab)]:
|
|
8
|
+
- @mastra/core@1.39.0-alpha.0
|
|
9
|
+
- @mastra/mcp@1.9.1-alpha.0
|
|
10
|
+
|
|
11
|
+
## 1.1.42
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`fa63872`](https://github.com/mastra-ai/mastra/commit/fa6387280954e6b667bec5714b55ba082bc627ff), [`d779de3`](https://github.com/mastra-ai/mastra/commit/d779de3cd9d2e7ed8110547190e2f15e786a0e41), [`1750c97`](https://github.com/mastra-ai/mastra/commit/1750c975d6179fbf6db2813b15229d4f8f23fc55), [`9283971`](https://github.com/mastra-ai/mastra/commit/928397157009b4aef4d5fdf3a0a273cb371beb55), [`f07b646`](https://github.com/mastra-ai/mastra/commit/f07b64604ab7d25391179790b7fd4823df9e2dff), [`d8838ae`](https://github.com/mastra-ai/mastra/commit/d8838ae80b69780361693d27098f7f6684af12fe), [`40f9297`](https://github.com/mastra-ai/mastra/commit/40f9297003b921c62373d3e8d3a4bda76c9f6de3), [`19a8658`](https://github.com/mastra-ai/mastra/commit/19a86589c788ef48bb6c1b0612cc82a201857379), [`850af77`](https://github.com/mastra-ai/mastra/commit/850af7779cb87c350804488734544a5b1843de25), [`0f0d1ba`](https://github.com/mastra-ai/mastra/commit/0f0d1ba67bfcb2204e571401662f1eceefc03357), [`a18775a`](https://github.com/mastra-ai/mastra/commit/a18775a693172546ee2378d39b67d4e32895b251), [`1baf2d1`](https://github.com/mastra-ai/mastra/commit/1baf2d152c6881338ff8f114633d5316fe13dd15), [`8c31bcd`](https://github.com/mastra-ai/mastra/commit/8c31bcdb00e597880d5939b1b7d7566fbe5dacae), [`0e32507`](https://github.com/mastra-ai/mastra/commit/0e32507962cdfa5569b7bda5bc6fb3dd34e40b03), [`95b14cd`](https://github.com/mastra-ai/mastra/commit/95b14cdd820e86d97ac05fe568424c513a252e31), [`07c3de7`](https://github.com/mastra-ai/mastra/commit/07c3de7f7bc418beccaea3b5e6b7f7cdda79d492), [`0bf2d93`](https://github.com/mastra-ai/mastra/commit/0bf2d932d20e2936f2d9abb8c0a86e24fbc97ec6), [`7b0d34c`](https://github.com/mastra-ai/mastra/commit/7b0d34cfe4a2fce22ac86ae17404685ff67a2ddb), [`a659a77`](https://github.com/mastra-ai/mastra/commit/a659a779bdebe3a52a518c56d2260592d0240fe0), [`0e51c36`](https://github.com/mastra-ai/mastra/commit/0e51c362be673502ac79626a75d1416479b0b76e), [`aa36be2`](https://github.com/mastra-ai/mastra/commit/aa36be23aa513b7dc53cb8ca16b7fab8f20e43ad), [`3332be9`](https://github.com/mastra-ai/mastra/commit/3332be9701ecd77aba840959d9a1d1ce7aef02d3), [`212c635`](https://github.com/mastra-ai/mastra/commit/212c635203e61d036ab41db8ff86c3893dc795b3), [`d8838ae`](https://github.com/mastra-ai/mastra/commit/d8838ae80b69780361693d27098f7f6684af12fe), [`9aa5a73`](https://github.com/mastra-ai/mastra/commit/9aa5a73e7e110f6e9365eec69364a33d5f03bb56), [`f73c789`](https://github.com/mastra-ai/mastra/commit/f73c789e8ef21561580395d2c410119cab5848c8), [`8bd16da`](https://github.com/mastra-ai/mastra/commit/8bd16da73a4cb874d739373643dbd6a6e7f88684), [`c8630f8`](https://github.com/mastra-ai/mastra/commit/c8630f80d4f40cb5d22e60ab162b618b1907167a), [`94dfef6`](https://github.com/mastra-ai/mastra/commit/94dfef6e2bf19a88467ea3940afcbce88a433f0f), [`47f71dc`](https://github.com/mastra-ai/mastra/commit/47f71dc6fbcbd12d71e21a979e676e20a02bd77d), [`50ceae2`](https://github.com/mastra-ai/mastra/commit/50ceae270878e2f8fb2b2c6c2faab09df0007c8a), [`a122f79`](https://github.com/mastra-ai/mastra/commit/a122f79427ae225ec79c7b2ed46278da48d04b17), [`8cdde58`](https://github.com/mastra-ai/mastra/commit/8cdde5875bbba6702d9df226f2b20232b8d75d6c), [`3a081c1`](https://github.com/mastra-ai/mastra/commit/3a081c1255c5ae8c99f6dad91cc612934ef6f2bd), [`49f8abc`](https://github.com/mastra-ai/mastra/commit/49f8abce8258e4f2f87bd326acfbdb641264a47c), [`847ff1e`](https://github.com/mastra-ai/mastra/commit/847ff1e0d94368d94b2e173e4e0908e115568ef3), [`0c1ed1d`](https://github.com/mastra-ai/mastra/commit/0c1ed1d00c7d87b5ac99ca95896211a2fa9189fa), [`259d409`](https://github.com/mastra-ai/mastra/commit/259d409a514174299dbde1ff5e1121209b3ba850), [`9e16c68`](https://github.com/mastra-ai/mastra/commit/9e16c6818b6485ccb43df28aba6f3a2219d28662), [`cefca33`](https://github.com/mastra-ai/mastra/commit/cefca33ae666e69810c935fedf95a929c173d1d7), [`d00e8c5`](https://github.com/mastra-ai/mastra/commit/d00e8c50daebe5bce5bf2f48bde39c86fc3d2fe4), [`36fa7e2`](https://github.com/mastra-ai/mastra/commit/36fa7e24d14e58a1eb46147097b32f583e5b8775), [`87e9774`](https://github.com/mastra-ai/mastra/commit/87e97741c1e493cd6d62f478eb810b49bda4d57c), [`65a72e7`](https://github.com/mastra-ai/mastra/commit/65a72e70c25eedea8ff985a6624b96be2850236b), [`fe9eacd`](https://github.com/mastra-ai/mastra/commit/fe9eacd9545a0a9d64aad31c9fa90294a425289e), [`4c02027`](https://github.com/mastra-ai/mastra/commit/4c020277235eaa6b1dc957c90ad0639eef213992), [`0f77241`](https://github.com/mastra-ai/mastra/commit/0f7724108806703799a8ba80ad0f09414afd5066), [`849efb9`](https://github.com/mastra-ai/mastra/commit/849efb9fca6dc976589c1f90a303fea618769109), [`92ff509`](https://github.com/mastra-ai/mastra/commit/92ff5098ef8a990438ca038077021a5f7541ec1d), [`3fce5e7`](https://github.com/mastra-ai/mastra/commit/3fce5e70d011d289043e75003ef3336ed4aa43c3), [`a763592`](https://github.com/mastra-ai/mastra/commit/a763592c3db46963ef1011cfe16fe372816e775e), [`db79c86`](https://github.com/mastra-ai/mastra/commit/db79c86c60723d57e02f9636ca2611bd4515f194), [`6855012`](https://github.com/mastra-ai/mastra/commit/685501247cc4717506f3e89beed03509d63a5370), [`80c7737`](https://github.com/mastra-ai/mastra/commit/80c7737e32d7917b5f356957d67c169d01744fd3), [`7fef31c`](https://github.com/mastra-ai/mastra/commit/7fef31c0d2a6d362a43a647a8a4f6ab893758a23), [`7fef31c`](https://github.com/mastra-ai/mastra/commit/7fef31c0d2a6d362a43a647a8a4f6ab893758a23), [`3f1cf47`](https://github.com/mastra-ai/mastra/commit/3f1cf476f74c1e4cc2df908837e05853a5347e31)]:
|
|
16
|
+
- @mastra/core@1.38.0
|
|
17
|
+
- @mastra/mcp@1.9.0
|
|
18
|
+
|
|
19
|
+
## 1.1.42-alpha.11
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [[`850af77`](https://github.com/mastra-ai/mastra/commit/850af7779cb87c350804488734544a5b1843de25), [`7b0d34c`](https://github.com/mastra-ai/mastra/commit/7b0d34cfe4a2fce22ac86ae17404685ff67a2ddb)]:
|
|
24
|
+
- @mastra/core@1.38.0-alpha.9
|
|
25
|
+
|
|
26
|
+
## 1.1.42-alpha.10
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [[`0c1ed1d`](https://github.com/mastra-ai/mastra/commit/0c1ed1d00c7d87b5ac99ca95896211a2fa9189fa), [`849efb9`](https://github.com/mastra-ai/mastra/commit/849efb9fca6dc976589c1f90a303fea618769109)]:
|
|
31
|
+
- @mastra/core@1.38.0-alpha.8
|
|
32
|
+
- @mastra/mcp@1.9.0-alpha.1
|
|
33
|
+
|
|
34
|
+
## 1.1.42-alpha.9
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- Updated dependencies:
|
|
39
|
+
- @mastra/core@1.38.0-alpha.7
|
|
40
|
+
|
|
3
41
|
## 1.1.42-alpha.8
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.43-alpha.0",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"jsdom": "^26.1.0",
|
|
29
29
|
"local-pkg": "^1.1.2",
|
|
30
30
|
"zod": "^4.4.3",
|
|
31
|
-
"@mastra/
|
|
32
|
-
"@mastra/
|
|
31
|
+
"@mastra/core": "1.39.0-alpha.0",
|
|
32
|
+
"@mastra/mcp": "^1.9.1-alpha.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@hono/node-server": "^1.19.11",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"tsx": "^4.21.0",
|
|
46
46
|
"typescript": "^6.0.3",
|
|
47
47
|
"vitest": "4.1.5",
|
|
48
|
-
"@internal/lint": "0.0.
|
|
49
|
-
"@internal/types-builder": "0.0.
|
|
50
|
-
"@mastra/core": "1.
|
|
48
|
+
"@internal/lint": "0.0.100",
|
|
49
|
+
"@internal/types-builder": "0.0.75",
|
|
50
|
+
"@mastra/core": "1.39.0-alpha.0"
|
|
51
51
|
},
|
|
52
52
|
"homepage": "https://mastra.ai",
|
|
53
53
|
"repository": {
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
# Response Caching
|
|
2
|
-
|
|
3
|
-
> **Experimental:** This feature is in alpha. Breaking changes may occur without a major version bump until the API is stable.
|
|
4
|
-
|
|
5
|
-
Response caching skips the LLM call and replays a previously cached response when an agent receives an identical request. Use it to reduce latency and avoid paying for repeated calls.
|
|
6
|
-
|
|
7
|
-
Caching is implemented as the [`ResponseCache`](https://mastra.ai/reference/processors/response-cache) input processor. Mastra doesn't provide an agent-level option. To enable caching, register the processor explicitly. This keeps the API surface small while Mastra collects feedback; per-call overrides flow through `RequestContext`.
|
|
8
|
-
|
|
9
|
-
## When to use response caching
|
|
10
|
-
|
|
11
|
-
Reach for it when the same request shape repeats across users or sessions, for example prompt templates, suggested-prompt buttons, agentic search re-asks, or guardrail LLMs that classify the same input over and over. Skip it when calls trigger external side effects through tools, since cache hits replay tool calls without re-executing them.
|
|
12
|
-
|
|
13
|
-
## Quickstart
|
|
14
|
-
|
|
15
|
-
Add a `ResponseCache` to the agent's `inputProcessors` and pass any `MastraServerCache` as the backend. For development, `InMemoryServerCache` works out of the box:
|
|
16
|
-
|
|
17
|
-
```typescript
|
|
18
|
-
import { Agent } from '@mastra/core/agent'
|
|
19
|
-
import { InMemoryServerCache } from '@mastra/core/cache'
|
|
20
|
-
import { ResponseCache } from '@mastra/core/processors'
|
|
21
|
-
|
|
22
|
-
const cache = new InMemoryServerCache()
|
|
23
|
-
|
|
24
|
-
export const searchAgent = new Agent({
|
|
25
|
-
name: 'Search Agent',
|
|
26
|
-
instructions: 'You answer questions concisely.',
|
|
27
|
-
model: 'openai/gpt-5',
|
|
28
|
-
inputProcessors: [new ResponseCache({ cache, ttl: 600 })], // 10 minutes
|
|
29
|
-
})
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
The first call runs the LLM normally and writes the response to the cache. Subsequent calls with an identical resolved prompt return the cached response without invoking the LLM.
|
|
33
|
-
|
|
34
|
-
## Per-call overrides via RequestContext
|
|
35
|
-
|
|
36
|
-
Per-call config flows through `RequestContext`. Use `ResponseCache.context()` to build a fresh context, or `ResponseCache.applyContext()` to merge into one you already have:
|
|
37
|
-
|
|
38
|
-
```typescript
|
|
39
|
-
import { ResponseCache } from '@mastra/core/processors'
|
|
40
|
-
import { RequestContext } from '@mastra/core/request-context'
|
|
41
|
-
|
|
42
|
-
// Fresh context with the override
|
|
43
|
-
await agent.stream('hello', {
|
|
44
|
-
requestContext: ResponseCache.context({ key: 'custom-key', bust: true }),
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
// Or merge into an existing context
|
|
48
|
-
const ctx = new RequestContext()
|
|
49
|
-
ctx.set('caller-meta', { userId: 'u-123' })
|
|
50
|
-
ResponseCache.applyContext(ctx, { bust: true })
|
|
51
|
-
await agent.stream('hello', { requestContext: ctx })
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Three fields are overridable per call:
|
|
55
|
-
|
|
56
|
-
- `key`: String or function. Overrides the auto-derived cache key for this request only.
|
|
57
|
-
- `scope`: String or `null`. Overrides the tenant/user scope for this request only. `null` opts out of scoping.
|
|
58
|
-
- `bust`: Boolean. Skips the cache read but still writes on completion (useful for "force refresh" buttons).
|
|
59
|
-
|
|
60
|
-
`cache`, `ttl`, and `agentId` stay on the constructor. They're instance-level concerns and not safe to vary per call.
|
|
61
|
-
|
|
62
|
-
## Tenant scoping
|
|
63
|
-
|
|
64
|
-
By default, `ResponseCache` looks up `MASTRA_RESOURCE_ID_KEY` on the request context and uses it as the cache scope. This means an agent that already populates the resource id (e.g. via memory) gets per-user isolation automatically. Two users never see each other's cached responses.
|
|
65
|
-
|
|
66
|
-
Override explicitly when you need a different scope:
|
|
67
|
-
|
|
68
|
-
```typescript
|
|
69
|
-
new Agent({
|
|
70
|
-
// ...
|
|
71
|
-
inputProcessors: [
|
|
72
|
-
new ResponseCache({
|
|
73
|
-
cache,
|
|
74
|
-
scope: 'org-123', // explicit tenant scope
|
|
75
|
-
}),
|
|
76
|
-
],
|
|
77
|
-
})
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
Pass `scope: null` to deliberately share entries across all callers. Only use this for known-public, non-personalized content.
|
|
81
|
-
|
|
82
|
-
## Custom cache backend
|
|
83
|
-
|
|
84
|
-
`ResponseCache` accepts any `MastraServerCache`. For production, use `RedisCache` from `@mastra/redis`:
|
|
85
|
-
|
|
86
|
-
```typescript
|
|
87
|
-
import { Agent } from '@mastra/core/agent'
|
|
88
|
-
import { ResponseCache } from '@mastra/core/processors'
|
|
89
|
-
import { RedisCache } from '@mastra/redis'
|
|
90
|
-
|
|
91
|
-
const cache = new RedisCache({ url: process.env.REDIS_URL })
|
|
92
|
-
|
|
93
|
-
export const agent = new Agent({
|
|
94
|
-
name: 'Cached Agent',
|
|
95
|
-
instructions: '...',
|
|
96
|
-
model: 'openai/gpt-5',
|
|
97
|
-
inputProcessors: [new ResponseCache({ cache })],
|
|
98
|
-
})
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
For a custom backend, extend `MastraServerCache` and implement its abstract methods (the processor only calls `get` and `set`).
|
|
102
|
-
|
|
103
|
-
## How caching is implemented
|
|
104
|
-
|
|
105
|
-
`ResponseCache` hooks into `processLLMRequest` (cache lookup, short-circuits on hit) and `processLLMResponse` (cache write on completion). Both run inside the agentic loop _after_ memory has loaded and earlier input processors have transformed the prompt.
|
|
106
|
-
|
|
107
|
-
This means the cache key is derived from the resolved `LanguageModelV2Prompt` Mastra is about to send to the model. The key is created _after_ memory has loaded and earlier input processors have run, and each step in an agentic tool loop is independently cached.
|
|
108
|
-
|
|
109
|
-
## What's in the cache key
|
|
110
|
-
|
|
111
|
-
When you don't supply `key`, the processor derives one deterministically from the inputs that change the LLM's response at this step: `agentId`, `stepNumber` (so each step in a tool loop has its own cache entry), `scope`, model identity (`provider`, `modelId`, spec version), and the resolved `prompt` (post-memory + post-processors). Any change to these inputs automatically invalidates the cache.
|
|
112
|
-
|
|
113
|
-
### Customize the cache key
|
|
114
|
-
|
|
115
|
-
Pass `key` as a function on the constructor or per-call to derive your own cache key from any subset of those inputs. The function receives the same inputs the deterministic hash would have consumed and returns a string (or a `Promise<string>`):
|
|
116
|
-
|
|
117
|
-
```typescript
|
|
118
|
-
import { ResponseCache, buildResponseCacheKey } from '@mastra/core/processors'
|
|
119
|
-
|
|
120
|
-
await agent.stream(input, {
|
|
121
|
-
requestContext: ResponseCache.context({
|
|
122
|
-
// Cache only on the model id and the resolved prompt tail — ignore
|
|
123
|
-
// step number, scope, etc.
|
|
124
|
-
key: ({ model, prompt }) => `qa:${model.modelId}:${JSON.stringify(prompt).slice(-200)}`,
|
|
125
|
-
}),
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
// Or reuse the deterministic helper while overriding individual fields:
|
|
129
|
-
await agent.stream(input, {
|
|
130
|
-
requestContext: ResponseCache.context({
|
|
131
|
-
key: inputs => buildResponseCacheKey({ ...inputs, scope: 'global' }),
|
|
132
|
-
}),
|
|
133
|
-
})
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
If the function throws, the processor falls back to the default key derivation so the call still benefits from caching.
|
|
137
|
-
|
|
138
|
-
## How cache hits work
|
|
139
|
-
|
|
140
|
-
When the processor finds a cache hit, it short-circuits the LLM call by returning the cached chunks from `processLLMRequest`. The agentic loop synthesizes a stream from those chunks instead of calling the model. `agent.generate()` collects them into a `FullOutput`; `agent.stream()` returns a `MastraModelOutput` whose chunks come from the cached buffer, so consumers iterating `fullStream` or awaiting `text`, `usage`, and `finishReason` see the cached values.
|
|
141
|
-
|
|
142
|
-
Cache writes happen after the response completes. Failed runs (errors, tripwire activations) aren't cached, so the next call retries cleanly.
|
|
143
|
-
|
|
144
|
-
## Related
|
|
145
|
-
|
|
146
|
-
- [`ResponseCache` reference](https://mastra.ai/reference/processors/response-cache)
|
|
147
|
-
- [Processors](https://mastra.ai/docs/agents/processors)
|
|
148
|
-
- [Guardrails](https://mastra.ai/docs/agents/guardrails)
|
|
149
|
-
- [Agent.stream()](https://mastra.ai/reference/streaming/agents/stream)
|
|
150
|
-
- [Agent.generate()](https://mastra.ai/reference/agents/generate)
|