@mastra/mcp-docs-server 1.1.41 → 1.1.42-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/access-control.md +97 -0
- package/.docs/docs/agent-builder/browser.md +61 -0
- package/.docs/docs/agent-builder/channels.md +76 -0
- package/.docs/docs/agent-builder/configuration.md +147 -0
- package/.docs/docs/agent-builder/deploying.md +121 -0
- package/.docs/docs/agent-builder/memory.md +65 -0
- package/.docs/docs/agent-builder/model-policy.md +48 -0
- package/.docs/docs/agent-builder/overview.md +97 -0
- package/.docs/docs/agent-builder/skill-registries.md +31 -0
- package/.docs/docs/agent-builder/workspace.md +60 -0
- package/.docs/docs/agents/a2a.md +1 -1
- package/.docs/docs/agents/acp.md +4 -4
- package/.docs/docs/agents/adding-voice.md +37 -6
- package/.docs/docs/agents/agent-approval.md +15 -1
- package/.docs/docs/agents/background-tasks.md +2 -2
- package/.docs/docs/agents/channels.md +3 -1
- package/.docs/docs/agents/code-mode.md +163 -0
- 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 +3 -3
- package/.docs/docs/agents/response-caching.md +1 -1
- package/.docs/docs/agents/sdk-agents.md +261 -0
- package/.docs/docs/agents/signals.md +150 -73
- 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/editor/overview.md +70 -8
- 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/manual-install.md +1 -1
- 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 +1 -1
- package/.docs/docs/memory/observational-memory.md +19 -0
- package/.docs/docs/memory/semantic-recall.md +2 -2
- package/.docs/docs/memory/storage.md +2 -1
- package/.docs/docs/memory/working-memory.md +1 -1
- package/.docs/docs/observability/metrics/overview.md +1 -0
- package/.docs/docs/observability/metrics/querying.md +292 -0
- 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 +4 -0
- package/.docs/docs/server/mastra-client.md +1 -1
- 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/voice/overview.md +86 -24
- package/.docs/docs/voice/speech-to-speech.md +55 -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 +5 -3
- package/.docs/guides/build-your-ui/ai-sdk-ui.md +1 -1
- package/.docs/guides/deployment/inngest.md +69 -0
- 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 +6 -6
- 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/models/embeddings.md +2 -2
- package/.docs/reference/agents/agent.md +60 -21
- package/.docs/reference/agents/channels.md +48 -6
- 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/client-js/agent-builder.md +161 -0
- package/.docs/reference/client-js/agents.md +19 -2
- package/.docs/reference/client-js/mastra-client.md +4 -0
- package/.docs/reference/configuration.md +1 -1
- package/.docs/reference/editor/agent-builder/agent-builder-options.md +74 -0
- package/.docs/reference/editor/agent-builder/builder-agent-defaults.md +77 -0
- package/.docs/reference/editor/agent-builder/builder-models.md +64 -0
- package/.docs/reference/editor/blob-store-provider.md +59 -0
- package/.docs/reference/editor/browser-provider.md +75 -0
- package/.docs/reference/editor/filesystem-provider.md +62 -0
- package/.docs/reference/editor/mastra-editor.md +61 -1
- package/.docs/reference/editor/processor-provider.md +64 -0
- package/.docs/reference/editor/sandbox-provider.md +61 -0
- package/.docs/reference/editor/storage-browser-ref.md +80 -0
- package/.docs/reference/editor/storage-workspace-ref.md +93 -0
- 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/create-scorer.md +2 -0
- 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 +15 -0
- package/.docs/reference/memory/memory-class.md +3 -3
- package/.docs/reference/memory/observational-memory.md +6 -4
- package/.docs/reference/memory/serialized-memory-config.md +72 -0
- package/.docs/reference/observability/metrics/automatic-metrics.md +7 -1
- 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/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 +33 -2
- package/.docs/reference/processors/unicode-normalizer.md +1 -1
- package/.docs/reference/processors/working-memory-processor.md +1 -1
- package/.docs/reference/rag/rerank.md +1 -1
- package/.docs/reference/server/nestjs-adapter.md +1 -1
- package/.docs/reference/server/routes.md +108 -9
- package/.docs/reference/storage/dsql.md +1 -1
- package/.docs/reference/storage/mongodb.md +1 -1
- package/.docs/reference/storage/postgresql.md +1 -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 +3 -3
- package/.docs/reference/tools/mcp-client.md +53 -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 +3 -1
- package/.docs/reference/vectors/upstash.md +1 -1
- package/.docs/reference/voice/google-gemini-live.md +15 -2
- package/.docs/reference/voice/inworld-realtime.md +353 -0
- package/.docs/reference/voice/inworld.md +2 -0
- package/.docs/reference/voice/voice.addInstructions.md +1 -1
- package/.docs/reference/workspace/agentcore-runtime-sandbox.md +202 -0
- package/.docs/reference/workspace/agentfs-filesystem.md +1 -1
- package/.docs/reference/workspace/azure-blob-filesystem.md +1 -1
- package/.docs/reference/workspace/blaxel-sandbox.md +3 -0
- package/.docs/reference/workspace/docker-sandbox.md +4 -2
- 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/.docs/reference/workspace/vercel-microvm-sandbox.md +199 -0
- package/.docs/reference/workspace/vercel.md +2 -0
- package/CHANGELOG.md +65 -0
- package/package.json +8 -6
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Agent Builder overview
|
|
2
|
+
|
|
3
|
+
> **Note:** The Agent Builder is part of the Mastra Enterprise Edition. Production deployments require a valid EE license. [Contact sales](https://mastra.ai/contact) for more information.
|
|
4
|
+
|
|
5
|
+
The Agent Builder lets you build, configure, and operate Mastra agents all within the UI. It runs inside your Mastra server, persists everything to `Mastra.storage`, and supports multi-tenant agent workflows with RBAC and channel integrations.
|
|
6
|
+
|
|
7
|
+
- [**Configuration**](https://mastra.ai/docs/agent-builder/configuration): Toggle UI sections and pin admin-controlled defaults for every new agent.
|
|
8
|
+
- [**Model policy**](https://mastra.ai/docs/agent-builder/model-policy): Restrict which providers and models the Builder exposes, and pin a default.
|
|
9
|
+
- [**Memory**](https://mastra.ai/docs/agent-builder/memory): Configure the default memory shape for every Builder-created agent.
|
|
10
|
+
- [**Access control**](https://mastra.ai/docs/agent-builder/access-control): Gate the Builder behind Mastra RBAC roles and permissions.
|
|
11
|
+
- [**Channels**](https://mastra.ai/docs/agent-builder/channels): Connect Builder-created agents to Slack and other channels.
|
|
12
|
+
- [**Skill registries**](https://mastra.ai/docs/agent-builder/skill-registries): Browse and install community skills from opt-in registries.
|
|
13
|
+
- [**Deploying**](https://mastra.ai/docs/agent-builder/deploying): Swap local primitives for cloud-backed storage, filesystems, and sandboxes.
|
|
14
|
+
|
|
15
|
+
For building agents entirely in code, see the [Agents overview](https://mastra.ai/docs/agents/overview). For editing code-defined agents through Studio, see the [Editor overview](https://mastra.ai/docs/editor/overview).
|
|
16
|
+
|
|
17
|
+
## Get started
|
|
18
|
+
|
|
19
|
+
Install `@mastra/editor` alongside a storage adapter:
|
|
20
|
+
|
|
21
|
+
**npm**:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install @mastra/editor @mastra/libsql
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**pnpm**:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pnpm add @mastra/editor @mastra/libsql
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Yarn**:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
yarn add @mastra/editor @mastra/libsql
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Bun**:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
bun add @mastra/editor @mastra/libsql
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Wire the Agent Builder onto a `Mastra` instance:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { Mastra } from '@mastra/core/mastra'
|
|
49
|
+
import { MastraEditor } from '@mastra/editor'
|
|
50
|
+
import { createBuilderAgent } from '@mastra/editor/ee'
|
|
51
|
+
import { LibSQLStore } from '@mastra/libsql'
|
|
52
|
+
|
|
53
|
+
export const mastra = new Mastra({
|
|
54
|
+
storage: new LibSQLStore({ url: 'file:./mastra.db' }),
|
|
55
|
+
agents: { builderAgent: createBuilderAgent() },
|
|
56
|
+
editor: new MastraEditor({
|
|
57
|
+
builder: {
|
|
58
|
+
enabled: true,
|
|
59
|
+
configuration: {
|
|
60
|
+
agent: {
|
|
61
|
+
memory: { observationalMemory: true },
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
66
|
+
})
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Start the dev server:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npx mastra dev
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The Agent Builder is mounted at `http://localhost:4111/agent-builder`.
|
|
76
|
+
|
|
77
|
+
## Prerequisites
|
|
78
|
+
|
|
79
|
+
The Agent Builder requires:
|
|
80
|
+
|
|
81
|
+
- **Storage**: An `@mastra/core` storage adapter on the `Mastra` instance. Agents, memory, and workspace state all persist through `Mastra.storage`.
|
|
82
|
+
- **The Builder agent**: Register a Builder agent created with the `createBuilderAgent()` factory from `@mastra/editor/ee` on `Mastra.agents`. The chat-based editor invokes it through the same `Mastra.getAgent(id)` lookup as any other agent. Without this registration, the chat-based editor returns 404.
|
|
83
|
+
- **`OPENAI_API_KEY`**: The Builder agent created by `createBuilderAgent()` runs on an OpenAI model, so an `OPENAI_API_KEY` environment variable is required.
|
|
84
|
+
|
|
85
|
+
## Disabling the Builder
|
|
86
|
+
|
|
87
|
+
Set `enabled: false` to keep the config in place but turn the surface off:
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
new MastraEditor({
|
|
91
|
+
builder: {
|
|
92
|
+
enabled: false,
|
|
93
|
+
},
|
|
94
|
+
})
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Omitting the `builder` field has the same effect.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Skill registries
|
|
2
|
+
|
|
3
|
+
> **Note:** The Agent Builder is part of the Mastra Enterprise Edition. Production deployments require a valid EE license. [Contact sales](https://mastra.ai/contact) for more information.
|
|
4
|
+
|
|
5
|
+
Registries let the Agent Builder browse and install community skills directly from the UI. All registries are opt-in. When no registry is enabled, the Builder hides registry browse UI entirely.
|
|
6
|
+
|
|
7
|
+
## Quickstart
|
|
8
|
+
|
|
9
|
+
Enable the [skills.sh](https://skills.sh) registry:
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { MastraEditor } from '@mastra/editor'
|
|
13
|
+
|
|
14
|
+
new MastraEditor({
|
|
15
|
+
builder: {
|
|
16
|
+
enabled: true,
|
|
17
|
+
registries: {
|
|
18
|
+
skillsSh: { enabled: true },
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The Builder library tab now exposes a **Browse** view backed by skills.sh. End users can preview a skill, then install it into an agent.
|
|
25
|
+
|
|
26
|
+
> **Note:** See the [AgentBuilderOptions reference](https://mastra.ai/reference/editor/agent-builder/agent-builder-options) for the full `registries` schema.
|
|
27
|
+
|
|
28
|
+
## Related
|
|
29
|
+
|
|
30
|
+
- [Configuration](https://mastra.ai/docs/agent-builder/configuration) — wire registries alongside the rest of the Builder config.
|
|
31
|
+
- [AgentBuilderOptions reference](https://mastra.ai/reference/editor/agent-builder/agent-builder-options) — every field on `builder`.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Workspace
|
|
2
|
+
|
|
3
|
+
> **Note:** The Agent Builder is part of the Mastra Enterprise Edition. Production deployments require a valid EE license. [Contact sales](https://mastra.ai/contact) for more information.
|
|
4
|
+
|
|
5
|
+
A [workspace](https://mastra.ai/docs/workspace/overview) gives agents filesystem access, command execution, and skill loading. The Agent Builder pins a default workspace onto every new agent through `builder.configuration.agent.workspace`. End users can still override the workspace per agent through the Builder UI.
|
|
6
|
+
|
|
7
|
+
## Quickstart
|
|
8
|
+
|
|
9
|
+
Pin an inline workspace snapshot as the Builder default:
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { Mastra } from '@mastra/core'
|
|
13
|
+
import { MastraEditor } from '@mastra/editor'
|
|
14
|
+
|
|
15
|
+
export const mastra = new Mastra({
|
|
16
|
+
editor: new MastraEditor({
|
|
17
|
+
builder: {
|
|
18
|
+
enabled: true,
|
|
19
|
+
configuration: {
|
|
20
|
+
agent: {
|
|
21
|
+
workspace: {
|
|
22
|
+
type: 'inline',
|
|
23
|
+
config: {
|
|
24
|
+
name: 'project-workspace',
|
|
25
|
+
filesystem: {
|
|
26
|
+
provider: 'local',
|
|
27
|
+
config: { basePath: './workspace' },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
}),
|
|
35
|
+
})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The Builder derives a deterministic id from the inline config and persists the snapshot, so identical inline configs are deduplicated across agents.
|
|
39
|
+
|
|
40
|
+
## Workspace references
|
|
41
|
+
|
|
42
|
+
`configuration.agent.workspace` accepts a `StorageWorkspaceRef`:
|
|
43
|
+
|
|
44
|
+
- **`{ type: 'inline', config }`** — embeds a serialized workspace snapshot directly on the agent. Useful for per-agent, ad-hoc configurations.
|
|
45
|
+
- **`{ type: 'id', workspaceId }`** — references a workspace already registered on the `Mastra` instance via `new Mastra({ workspace })` or `mastra.addWorkspace(...)`. Use this for shared, named workspaces.
|
|
46
|
+
|
|
47
|
+
See the [StorageWorkspaceRef reference](https://mastra.ai/reference/editor/storage-workspace-ref) for both variants.
|
|
48
|
+
|
|
49
|
+
## Filesystem and sandbox
|
|
50
|
+
|
|
51
|
+
A workspace combines a `filesystem` (file tools) and an optional `sandbox` (command execution). For local development, point both at the same directory so files written through the filesystem are immediately visible to commands in the sandbox.
|
|
52
|
+
|
|
53
|
+
For cloud deployments, swap `LocalFilesystem` / `LocalSandbox` for managed providers (e.g., S3, E2B). See [Deploying](https://mastra.ai/docs/agent-builder/deploying) for the cloud-swap pattern.
|
|
54
|
+
|
|
55
|
+
## Related
|
|
56
|
+
|
|
57
|
+
- [Workspace overview](https://mastra.ai/docs/workspace/overview) — the underlying workspace model.
|
|
58
|
+
- [Filesystem](https://mastra.ai/docs/workspace/filesystem) and [Sandbox](https://mastra.ai/docs/workspace/sandbox) — the building blocks.
|
|
59
|
+
- [BuilderAgentDefaults reference](https://mastra.ai/reference/editor/agent-builder/builder-agent-defaults) — the full `workspace` field schema.
|
|
60
|
+
- [Configuration](https://mastra.ai/docs/agent-builder/configuration) — wire `workspace` alongside the rest of the Builder config.
|
package/.docs/docs/agents/a2a.md
CHANGED
|
@@ -81,7 +81,7 @@ export const supportAgent = new Agent({
|
|
|
81
81
|
id: 'support-agent',
|
|
82
82
|
name: 'Support Agent',
|
|
83
83
|
instructions: 'Answer user questions and delegate weather questions when needed.',
|
|
84
|
-
model: 'openai/gpt-5.
|
|
84
|
+
model: 'openai/gpt-5.5',
|
|
85
85
|
agents: {
|
|
86
86
|
remoteWeatherAgent,
|
|
87
87
|
},
|
package/.docs/docs/agents/acp.md
CHANGED
|
@@ -84,7 +84,7 @@ export const codeSupervisor = new Agent({
|
|
|
84
84
|
id: 'code-supervisor',
|
|
85
85
|
name: 'Code Supervisor',
|
|
86
86
|
instructions: 'Delegate code editing tasks to the code-agent subagent.',
|
|
87
|
-
model: 'openai/gpt-5.
|
|
87
|
+
model: 'openai/gpt-5.5',
|
|
88
88
|
agents: {
|
|
89
89
|
codeAgent,
|
|
90
90
|
},
|
|
@@ -113,7 +113,7 @@ export const codeSupervisor = new Agent({
|
|
|
113
113
|
id: 'code-supervisor',
|
|
114
114
|
name: 'Code Supervisor',
|
|
115
115
|
instructions: 'Use the code-agent tool when a task requires repository inspection or code edits.',
|
|
116
|
-
model: 'openai/gpt-5.
|
|
116
|
+
model: 'openai/gpt-5.5',
|
|
117
117
|
tools: {
|
|
118
118
|
codeAgentTool,
|
|
119
119
|
},
|
|
@@ -178,14 +178,14 @@ export const codeAgent = new AcpAgent({
|
|
|
178
178
|
description: 'An ACP-compatible coding agent',
|
|
179
179
|
command: 'claude',
|
|
180
180
|
args: ['--acp'],
|
|
181
|
-
model: '
|
|
181
|
+
model: 'claude-sonnet-4-6',
|
|
182
182
|
})
|
|
183
183
|
```
|
|
184
184
|
|
|
185
185
|
You can also change the model at runtime with `setModel()`:
|
|
186
186
|
|
|
187
187
|
```typescript
|
|
188
|
-
await codeAgent.setModel('
|
|
188
|
+
await codeAgent.setModel('claude-sonnet-4-6')
|
|
189
189
|
```
|
|
190
190
|
|
|
191
191
|
If the ACP agent advertises available models and your model ID doesn't match any of them, Mastra throws an error listing the valid options:
|
|
@@ -20,7 +20,7 @@ export const agent = new Agent({
|
|
|
20
20
|
id: 'voice-agent',
|
|
21
21
|
name: 'Voice Agent',
|
|
22
22
|
instructions: `You are a helpful assistant with both STT and TTS capabilities.`,
|
|
23
|
-
model: 'openai/gpt-5.
|
|
23
|
+
model: 'openai/gpt-5.5',
|
|
24
24
|
voice,
|
|
25
25
|
})
|
|
26
26
|
|
|
@@ -109,7 +109,7 @@ export const agent = new Agent({
|
|
|
109
109
|
id: 'speech-to-speech-agent',
|
|
110
110
|
name: 'Speech-to-Speech Agent',
|
|
111
111
|
instructions: `You are a helpful assistant with speech-to-speech capabilities.`,
|
|
112
|
-
model: 'openai/gpt-5.
|
|
112
|
+
model: 'openai/gpt-5.5',
|
|
113
113
|
tools: {
|
|
114
114
|
// Tools configured on Agent are passed to voice provider
|
|
115
115
|
search,
|
|
@@ -132,6 +132,37 @@ agent.voice.send(microphoneStream)
|
|
|
132
132
|
agent.voice.close()
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
+
### Per-session voice for concurrent sessions
|
|
136
|
+
|
|
137
|
+
A static `voice` instance is shared across every request. For one-shot text-to-speech this is fine, but realtime and speech-to-speech providers store one WebSocket, one set of tools, and one request context per instance. If you deploy a single agent that handles several live sessions at once, a shared instance lets one session overwrite another session's tools, instructions, and request context.
|
|
138
|
+
|
|
139
|
+
To give each session its own voice, provide `voice` as a resolver. Mastra runs the resolver on every `getVoice()` call and returns a fresh, session-owned instance:
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
import { Agent } from '@mastra/core/agent'
|
|
143
|
+
import { OpenAIRealtimeVoice } from '@mastra/voice-openai-realtime'
|
|
144
|
+
|
|
145
|
+
export const agent = new Agent({
|
|
146
|
+
id: 'support-line',
|
|
147
|
+
name: 'Support Line',
|
|
148
|
+
instructions: ({ requestContext }) => `Help user ${requestContext.get('user')}.`,
|
|
149
|
+
model: 'openai/gpt-5.5',
|
|
150
|
+
voice: ({ requestContext }) => new OpenAIRealtimeVoice({ apiKey: requestContext.get('apiKey') }),
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
// Each concurrent session resolves its own voice instance
|
|
154
|
+
const voice = await agent.getVoice({ requestContext })
|
|
155
|
+
await voice.connect()
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
When you use a resolver:
|
|
159
|
+
|
|
160
|
+
- Each call to `getVoice()` returns a new instance, so concurrent sessions never share state.
|
|
161
|
+
- Mastra does not add tools or instructions to a resolver instance. Configure those inside the resolver or on the provider.
|
|
162
|
+
- You own the lifecycle of the returned instance, so call `disconnect()` or `close()` when the session ends.
|
|
163
|
+
|
|
164
|
+
The `agent.voice` getter has no request context, so it throws when `voice` is a resolver. Use `agent.getVoice({ requestContext })` instead.
|
|
165
|
+
|
|
135
166
|
### Event System
|
|
136
167
|
|
|
137
168
|
The realtime voice provider emits several events you can listen for:
|
|
@@ -209,7 +240,7 @@ export const convertToText = async (input: string | NodeJS.ReadableStream): Prom
|
|
|
209
240
|
export const hybridVoiceAgent = new Agent({
|
|
210
241
|
id: 'hybrid-voice-agent',
|
|
211
242
|
name: 'Hybrid Voice Agent',
|
|
212
|
-
model: 'openai/gpt-5.
|
|
243
|
+
model: 'openai/gpt-5.5',
|
|
213
244
|
instructions: 'You can speak and listen using different providers.',
|
|
214
245
|
voice: new CompositeVoice({
|
|
215
246
|
input: new OpenAIVoice(),
|
|
@@ -221,7 +252,7 @@ export const unifiedVoiceAgent = new Agent({
|
|
|
221
252
|
id: 'unified-voice-agent',
|
|
222
253
|
name: 'Unified Voice Agent',
|
|
223
254
|
instructions: 'You are an agent with both STT and TTS capabilities.',
|
|
224
|
-
model: 'openai/gpt-5.
|
|
255
|
+
model: 'openai/gpt-5.5',
|
|
225
256
|
voice: new OpenAIVoice(),
|
|
226
257
|
})
|
|
227
258
|
|
|
@@ -263,7 +294,7 @@ export const agent = new Agent({
|
|
|
263
294
|
id: 'voice-agent',
|
|
264
295
|
name: 'Voice Agent',
|
|
265
296
|
instructions: `You are a helpful assistant with both STT and TTS capabilities.`,
|
|
266
|
-
model: 'openai/gpt-5.
|
|
297
|
+
model: 'openai/gpt-5.5',
|
|
267
298
|
|
|
268
299
|
// Create a composite voice using OpenAI for listening and PlayAI for speaking
|
|
269
300
|
voice: new CompositeVoice({
|
|
@@ -288,7 +319,7 @@ export const agent = new Agent({
|
|
|
288
319
|
id: 'aisdk-voice-agent',
|
|
289
320
|
name: 'AI SDK Voice Agent',
|
|
290
321
|
instructions: `You are a helpful assistant with voice capabilities.`,
|
|
291
|
-
model: 'openai/gpt-5.
|
|
322
|
+
model: 'openai/gpt-5.5',
|
|
292
323
|
|
|
293
324
|
// Pass AI SDK models directly to CompositeVoice
|
|
294
325
|
voice: new CompositeVoice({
|
|
@@ -86,6 +86,20 @@ for await (const chunk of stream.fullStream) {
|
|
|
86
86
|
}
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
+
#### Conditional approval with a function
|
|
90
|
+
|
|
91
|
+
Instead of a boolean, `requireToolApproval` accepts a function that decides per tool call. It receives the `toolName`, the `args` the model passed, the `requestContext`, and the `workspace`. Return `true` to require approval for that call, or `false` to allow it. This lets you gate approval dynamically — for example, only for tools whose name matches a pattern:
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
const stream = await agent.stream('Clean up old records', {
|
|
95
|
+
requireToolApproval: ({ toolName }) => /^delete_/.test(toolName),
|
|
96
|
+
})
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
A tool's own `requireApproval` setting still takes precedence: if a tool defines its own approval rule, that rule decides for that tool and the function above does not override it. If the function throws, the call requires approval (fail-safe).
|
|
100
|
+
|
|
101
|
+
> **Note:** Function-based `requireToolApproval` is only available on regular `stream()` / `generate()` calls. Durable agents and stored agents persist their options, and a function can't be serialized, so they accept only a boolean. If you pass a function in those contexts it falls back to requiring approval for every tool call.
|
|
102
|
+
|
|
89
103
|
### Runtime suspension with `suspend()`
|
|
90
104
|
|
|
91
105
|
A tool can also pause _during_ its `execute` function by calling `suspend()`. This is useful when the tool starts running and then discovers it needs additional user input or confirmation before it can finish.
|
|
@@ -398,7 +412,7 @@ const supervisorAgent = new Agent({
|
|
|
398
412
|
name: 'Supervisor Agent',
|
|
399
413
|
instructions: `You coordinate data retrieval tasks.
|
|
400
414
|
Delegate to data-agent for user lookups.`,
|
|
401
|
-
model: 'openai/gpt-5.
|
|
415
|
+
model: 'openai/gpt-5.5',
|
|
402
416
|
agents: { dataAgent },
|
|
403
417
|
memory: new Memory(),
|
|
404
418
|
})
|
|
@@ -80,7 +80,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
80
80
|
export const researcher = new Agent({
|
|
81
81
|
id: 'researcher',
|
|
82
82
|
instructions: 'You research topics and answer questions.',
|
|
83
|
-
model: 'openai/gpt-5.
|
|
83
|
+
model: 'openai/gpt-5.5',
|
|
84
84
|
tools: { researchTool, summarizeTool },
|
|
85
85
|
backgroundTasks: {
|
|
86
86
|
tools: {
|
|
@@ -175,7 +175,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
175
175
|
const supervisor = new Agent({
|
|
176
176
|
id: 'supervisor',
|
|
177
177
|
instructions: 'Coordinate research and writing using the available agents.',
|
|
178
|
-
model: 'openai/gpt-5.
|
|
178
|
+
model: 'openai/gpt-5.5',
|
|
179
179
|
agents: { researchAgent, writingAgent },
|
|
180
180
|
backgroundTasks: {
|
|
181
181
|
tools: {
|
|
@@ -23,7 +23,7 @@ export const supportAgent = new Agent({
|
|
|
23
23
|
id: 'support-agent',
|
|
24
24
|
name: 'Support Agent',
|
|
25
25
|
instructions: 'You are a helpful support assistant.',
|
|
26
|
-
model: 'openai/gpt-5.
|
|
26
|
+
model: 'openai/gpt-5.5',
|
|
27
27
|
channels: {
|
|
28
28
|
adapters: {
|
|
29
29
|
slack: createSlackAdapter(),
|
|
@@ -88,6 +88,8 @@ When a user mentions the agent mid-conversation in a channel thread, the agent m
|
|
|
88
88
|
|
|
89
89
|
Set `threadContext: { maxMessages: 0 }` to disable this behavior. This only applies to non-DM threads.
|
|
90
90
|
|
|
91
|
+
Mastra also adds a short system message telling the agent which channel and platform the request came from (DM vs public channel, platform name, bot display name). Set `threadContext: { addSystemMessage: false }` to skip it.
|
|
92
|
+
|
|
91
93
|
## Tool approval
|
|
92
94
|
|
|
93
95
|
Tools with `requireApproval: true` render as interactive cards with Approve and Deny buttons:
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Code mode
|
|
2
|
+
|
|
3
|
+
> **Alpha:** This feature is in alpha. Breaking changes may occur without a major version bump until the API is stable.
|
|
4
|
+
|
|
5
|
+
Code mode gives an agent a single tool that runs a short TypeScript program in a sandbox. Instead of calling tools one at a time, the model writes a program that orchestrates your existing tools as `external_*` functions, batching calls with `Promise.all`, aggregating with `reduce`, branching, and doing math in a real runtime, then returns a single result.
|
|
6
|
+
|
|
7
|
+
`createCodeMode` returns this tool with the default id `execute_typescript`. The id is configurable, so an agent can have several code mode tools at once, each scoped to a different set of tools (see [Scoping tools across multiple code tools](#scoping-tools-across-multiple-code-tools)).
|
|
8
|
+
|
|
9
|
+
## When to use code mode
|
|
10
|
+
|
|
11
|
+
Use code mode when a task touches several tools at once or needs real computation between calls:
|
|
12
|
+
|
|
13
|
+
- Fewer round-trips: a task that touches several tools runs in one tool call instead of one model turn per tool.
|
|
14
|
+
- Correct math: sums, averages, and other arithmetic run as JavaScript, not as token prediction.
|
|
15
|
+
- Planning up front: filtering, aggregation, and branching happen inside the program rather than across separate turns.
|
|
16
|
+
|
|
17
|
+
## How it works
|
|
18
|
+
|
|
19
|
+
Your tools keep running on the host with full validation, request context, and tracing. Only the model's orchestration code runs in the sandbox. Each `external_*` call is bridged back to the real tool on the host, so dangerous tools, approvals, and validation behave exactly as they do for normal tool calls.
|
|
20
|
+
|
|
21
|
+
The program runs in a [Workspace sandbox](https://mastra.ai/docs/workspace/overview). A sandbox is required, because code mode runs model-authored code and the execution boundary must be chosen deliberately. Pass one via `sandbox`, or run the agent in a workspace that provides one. To execute on the host machine, pass `new LocalSandbox()` explicitly. This runs the program as a host `node` process with host privileges, so only use it for trusted or local development.
|
|
22
|
+
|
|
23
|
+
## Quickstart
|
|
24
|
+
|
|
25
|
+
`createCodeMode` returns the tool plus generated instructions. With no `id`, the tool is named `execute_typescript`. Add both to your agent:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { Agent } from '@mastra/core/agent'
|
|
29
|
+
import { createCodeMode, createTool } from '@mastra/core/tools'
|
|
30
|
+
import { LocalSandbox } from '@mastra/core/workspace'
|
|
31
|
+
import { z } from 'zod'
|
|
32
|
+
|
|
33
|
+
const getTopProducts = createTool({
|
|
34
|
+
id: 'getTopProducts',
|
|
35
|
+
description: 'Get top selling products',
|
|
36
|
+
inputSchema: z.object({ limit: z.number() }),
|
|
37
|
+
outputSchema: z.object({
|
|
38
|
+
products: z.array(z.object({ id: z.string(), name: z.string(), totalSales: z.number() })),
|
|
39
|
+
}),
|
|
40
|
+
execute: async ({ limit }) => fetchTopProducts(limit),
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const getProductRatings = createTool({
|
|
44
|
+
id: 'getProductRatings',
|
|
45
|
+
description: 'Get ratings for a product',
|
|
46
|
+
inputSchema: z.object({ productId: z.string() }),
|
|
47
|
+
outputSchema: z.object({ ratings: z.array(z.object({ score: z.number() })) }),
|
|
48
|
+
execute: async ({ productId }) => fetchRatings(productId),
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const { tool, instructions } = createCodeMode({
|
|
52
|
+
tools: { getTopProducts, getProductRatings },
|
|
53
|
+
sandbox: new LocalSandbox(), // required; runs on the host — see "How it works"
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
const agent = new Agent({
|
|
57
|
+
name: 'shop-assistant',
|
|
58
|
+
instructions: ['You are a helpful shopping assistant.', instructions],
|
|
59
|
+
model: 'openai/gpt-5.5',
|
|
60
|
+
tools: { execute_typescript: tool },
|
|
61
|
+
})
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Asked "What are the top 5 products and the average rating for each?", the model emits one `execute_typescript` call instead of many separate tool calls:
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
const top = await external_getTopProducts({ limit: 5 })
|
|
68
|
+
const ratings = await Promise.all(
|
|
69
|
+
top.products.map(p => external_getProductRatings({ productId: p.id })),
|
|
70
|
+
)
|
|
71
|
+
return top.products.map((product, i) => {
|
|
72
|
+
const scores = ratings[i].ratings.map(r => r.score)
|
|
73
|
+
const avg = scores.reduce((sum, s) => sum + s, 0) / scores.length
|
|
74
|
+
return {
|
|
75
|
+
name: product.name,
|
|
76
|
+
sales: product.totalSales,
|
|
77
|
+
averageRating: Math.round(avg * 100) / 100,
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
All five rating lookups run in parallel, the averages are computed in JavaScript, and the agent receives one structured result.
|
|
83
|
+
|
|
84
|
+
## Configuration
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
const { tool, instructions } = createCodeMode({
|
|
88
|
+
tools: { getTopProducts, getProductRatings }, // exposed as external_*; only these can be called
|
|
89
|
+
sandbox, // required WorkspaceSandbox, unless the agent runs in a workspace that provides one
|
|
90
|
+
timeout: 30_000, // optional execution timeout in ms (default 30000)
|
|
91
|
+
id: 'execute_typescript', // optional tool id (default "execute_typescript")
|
|
92
|
+
})
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
| Option | Type | Description |
|
|
96
|
+
| --------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
97
|
+
| `tools` | `ToolsInput` | Tools exposed to the program as `external_<id>`. Only these may be called. |
|
|
98
|
+
| `sandbox` | `WorkspaceSandbox` | Sandbox to run the program in. Required unless the agent runs in a workspace that provides one. Pass `new LocalSandbox()` to run on the host. |
|
|
99
|
+
| `timeout` | `number` | Execution timeout in milliseconds. Default `30000`. |
|
|
100
|
+
| `id` | `string` | The generated tool's id. Default `execute_typescript`. |
|
|
101
|
+
|
|
102
|
+
## Result
|
|
103
|
+
|
|
104
|
+
The tool returns a `CodeModeToolResult`:
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
type CodeModeToolResult = {
|
|
108
|
+
success: boolean
|
|
109
|
+
result?: unknown // value returned by the program
|
|
110
|
+
logs?: string[] // captured console output
|
|
111
|
+
error?: { message: string; name?: string; line?: number }
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Inspecting the instructions
|
|
116
|
+
|
|
117
|
+
The generated `instructions` contain the usage contract and a typed `external_*` declaration for each tool, derived from your tool schemas. Print them to see exactly what the model receives:
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
import { createCodeModeInstructions } from '@mastra/core/tools'
|
|
121
|
+
|
|
122
|
+
console.log(createCodeModeInstructions({ tools: { getTopProducts, getProductRatings } }))
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Scoping tools across multiple code tools
|
|
126
|
+
|
|
127
|
+
`createCodeMode` captures its own allow-list. Call it more than once to give an agent several code tools, each scoped to a different subset of tools. A program can only call the `external_*` functions for the tools passed to its own `createCodeMode` call, so the subsets stay isolated.
|
|
128
|
+
|
|
129
|
+
Give each tool a distinct `id` so their ids do not collide, and add each tool's instructions to the agent:
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
const sales = createCodeMode({
|
|
133
|
+
id: 'sales_code',
|
|
134
|
+
tools: { listRecentOrders, getCustomer },
|
|
135
|
+
sandbox,
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
const inventory = createCodeMode({
|
|
139
|
+
id: 'inventory_code',
|
|
140
|
+
tools: { listProducts, getSupplier },
|
|
141
|
+
sandbox,
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
const agent = new Agent({
|
|
145
|
+
name: 'ops-assistant',
|
|
146
|
+
instructions: ['You are an ops assistant.', sales.instructions, inventory.instructions],
|
|
147
|
+
model: 'openai/gpt-5.5',
|
|
148
|
+
tools: { sales_code: sales.tool, inventory_code: inventory.tool },
|
|
149
|
+
})
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
A program run by `sales_code` cannot call an inventory tool, and the reverse holds too. Use this for least-privilege scoping and to keep each tool's prompt surface small.
|
|
153
|
+
|
|
154
|
+
## Tips
|
|
155
|
+
|
|
156
|
+
- Keep tools focused, so each does one thing well and the model composes them in code.
|
|
157
|
+
- Code mode helps most when calls can be parallelized with `Promise.all`.
|
|
158
|
+
- Use `console.log` for debugging. Logs are captured in the result.
|
|
159
|
+
|
|
160
|
+
## Related
|
|
161
|
+
|
|
162
|
+
- [Tools](https://mastra.ai/docs/agents/using-tools)
|
|
163
|
+
- [Workspace overview](https://mastra.ai/docs/workspace/overview)
|
|
@@ -246,7 +246,7 @@ costGuard.onViolation = ({ processorId, message, detail }) => {
|
|
|
246
246
|
|
|
247
247
|
// Log moderation violations
|
|
248
248
|
const moderation = new ModerationProcessor({
|
|
249
|
-
model: '
|
|
249
|
+
model: 'openai/gpt-5-nano',
|
|
250
250
|
strategy: 'block',
|
|
251
251
|
})
|
|
252
252
|
|
|
@@ -360,7 +360,7 @@ See [workflows as processors](https://mastra.ai/docs/agents/processors) for more
|
|
|
360
360
|
Guardrail processors don't need your primary model. Use a small, fast model for classification tasks:
|
|
361
361
|
|
|
362
362
|
```typescript
|
|
363
|
-
const GUARDRAIL_MODEL = '
|
|
363
|
+
const GUARDRAIL_MODEL = 'openai/gpt-5-nano'
|
|
364
364
|
|
|
365
365
|
new ModerationProcessor({ model: GUARDRAIL_MODEL })
|
|
366
366
|
new PIIDetector({ model: GUARDRAIL_MODEL })
|
|
@@ -27,7 +27,7 @@ export const routingAgent = new Agent({
|
|
|
27
27
|
name: 'Routing Agent',
|
|
28
28
|
instructions: `
|
|
29
29
|
You are a network of writers and researchers. The user will ask you to research a topic. Always respond with a complete report—no bullet points. Write in full paragraphs, like a blog post. Do not answer with incomplete or uncertain information.`,
|
|
30
|
-
model: 'openai/gpt-5.
|
|
30
|
+
model: 'openai/gpt-5.5',
|
|
31
31
|
agents: {
|
|
32
32
|
researchAgent,
|
|
33
33
|
writingAgent,
|
|
@@ -382,7 +382,7 @@ import { TokenLimiter } from '@mastra/core/processors'
|
|
|
382
382
|
|
|
383
383
|
const agent = new Agent({
|
|
384
384
|
name: 'my-agent',
|
|
385
|
-
model: 'openai/gpt-5.
|
|
385
|
+
model: 'openai/gpt-5.5',
|
|
386
386
|
inputProcessors: [new TokenLimiter(127000)],
|
|
387
387
|
})
|
|
388
388
|
```
|
|
@@ -647,7 +647,7 @@ const moderationWorkflow = createWorkflow({
|
|
|
647
647
|
const agent = new Agent({
|
|
648
648
|
id: 'moderated-agent',
|
|
649
649
|
name: 'Moderated Agent',
|
|
650
|
-
model: 'openai/gpt-5.
|
|
650
|
+
model: 'openai/gpt-5.5',
|
|
651
651
|
inputProcessors: [moderationWorkflow],
|
|
652
652
|
})
|
|
653
653
|
```
|
|
@@ -686,7 +686,7 @@ export class QualityChecker implements Processor {
|
|
|
686
686
|
const agent = new Agent({
|
|
687
687
|
id: 'quality-agent',
|
|
688
688
|
name: 'Quality Agent',
|
|
689
|
-
model: 'openai/gpt-5.
|
|
689
|
+
model: 'openai/gpt-5.5',
|
|
690
690
|
outputProcessors: [new QualityChecker()],
|
|
691
691
|
maxProcessorRetries: 3, // Maximum retry attempts. If unset, retries are disabled (unless errorProcessors are configured, in which case it defaults to 10).
|
|
692
692
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Response Caching
|
|
2
2
|
|
|
3
|
-
> **
|
|
3
|
+
> **Alpha:** This feature is in alpha. Breaking changes may occur without a major version bump until the API is stable.
|
|
4
4
|
|
|
5
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
6
|
|