@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
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# PubSub
|
|
2
|
+
|
|
3
|
+
Mastra uses a publish/subscribe (pub/sub) system as its internal event bus. Components publish events to named topics, and other components subscribe to those topics to react. The backend you configure decides how far those events travel: within one process, across processes on one host, or across separate instances.
|
|
4
|
+
|
|
5
|
+
You set the backend once on the `Mastra` instance, and the rest of the system uses it without changes. By default, Mastra uses an in-process backend that needs no setup.
|
|
6
|
+
|
|
7
|
+
## How Mastra uses PubSub
|
|
8
|
+
|
|
9
|
+
Several built-in systems publish and subscribe to events through the same pub/sub bus:
|
|
10
|
+
|
|
11
|
+
- **Workflow execution**: The scheduler publishes a `workflow.start` event, and a long-lived worker consumes it to run the workflow. Step and lifecycle events flow over pub/sub during execution.
|
|
12
|
+
- **Scheduled workflows**: The scheduler dispatches due runs by publishing to the workflow topic. See [Scheduled workflows](https://mastra.ai/docs/workflows/scheduled-workflows).
|
|
13
|
+
- **Background tasks**: A task manager dispatches work to a worker group and fans task lifecycle updates out to subscribers, which is how background task streams stay live. See [Background task streaming](https://mastra.ai/docs/streaming/background-task-streaming).
|
|
14
|
+
- **Agent signals**: Sending a signal to an active agent run publishes an event on a thread topic, so a run executing in another process receives the signal.
|
|
15
|
+
- **Resumable streams**: Stream chunks are published per run, so a client that reconnects can replay what it missed.
|
|
16
|
+
|
|
17
|
+
Because these systems run on one bus, the backend you choose applies to all of them at once.
|
|
18
|
+
|
|
19
|
+
## Delivery modes
|
|
20
|
+
|
|
21
|
+
Backends deliver events in one of two modes, defined by the [`PubSub`](https://mastra.ai/reference/pubsub/base) contract:
|
|
22
|
+
|
|
23
|
+
- **Pull**: Consumers read from the backend on their own, which Mastra does with a long-lived worker loop. Distributed backends such as [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams) use this mode.
|
|
24
|
+
- **Push**: Events arrive without the consumer asking, either in process or over HTTP. The default [`EventEmitterPubSub`](https://mastra.ai/reference/pubsub/event-emitter) delivers this way in process.
|
|
25
|
+
|
|
26
|
+
Subscribers can also opt into work distribution. A group of subscribers that share a consumer group split the events between them, so each event is handled once. Subscribers without a group each receive every event, which fans the stream out to all of them.
|
|
27
|
+
|
|
28
|
+
## Default backend
|
|
29
|
+
|
|
30
|
+
When you do not set the `pubsub` option, Mastra uses [`EventEmitterPubSub`](https://mastra.ai/reference/pubsub/event-emitter). It delivers events in process using a Node.js [`EventEmitter`](https://nodejs.org/api/events.html#class-eventemitter), so it works without any external service.
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { Mastra } from '@mastra/core'
|
|
34
|
+
|
|
35
|
+
// No pubsub option: Mastra uses EventEmitterPubSub
|
|
36
|
+
export const mastra = new Mastra({})
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Because it runs in process, events are not persisted and do not reach other processes. The default suits a single instance, which covers most applications.
|
|
40
|
+
|
|
41
|
+
## Choosing a backend
|
|
42
|
+
|
|
43
|
+
Set the `pubsub` option on the `Mastra` instance to choose a backend. Each backend implements the same [`PubSub`](https://mastra.ai/reference/pubsub/base) contract, so the rest of your application does not change.
|
|
44
|
+
|
|
45
|
+
The deciding question is where the subscriber runs.
|
|
46
|
+
|
|
47
|
+
| Backend | Scope | Mode | Package |
|
|
48
|
+
| ----------------------------------------------------------------------------- | ---------------------------- | ------------- | ----------------------------- |
|
|
49
|
+
| [`EventEmitterPubSub`](https://mastra.ai/reference/pubsub/event-emitter) | Single process | Pull and push | `@mastra/core` |
|
|
50
|
+
| [`UnixSocketPubSub`](https://mastra.ai/reference/pubsub/unix-socket-pubsub) | Multiple processes, one host | Push | `@mastra/core` |
|
|
51
|
+
| [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams) | Distributed, multiple hosts | Pull | `@mastra/redis-streams` |
|
|
52
|
+
| [`GoogleCloudPubSub`](https://mastra.ai/reference/pubsub/google-cloud-pubsub) | Distributed, multiple hosts | Pull | `@mastra/google-cloud-pubsub` |
|
|
53
|
+
|
|
54
|
+
### Multiple processes on one host
|
|
55
|
+
|
|
56
|
+
Use [`UnixSocketPubSub`](https://mastra.ai/reference/pubsub/unix-socket-pubsub) when several processes on the same machine need to share a stream. It delivers events over a Unix domain socket and elects one process as a broker. If the broker exits, the remaining processes elect a new one.
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { Mastra } from '@mastra/core'
|
|
60
|
+
import { UnixSocketPubSub } from '@mastra/core/events'
|
|
61
|
+
|
|
62
|
+
export const mastra = new Mastra({
|
|
63
|
+
pubsub: new UnixSocketPubSub('/tmp/mastra/events.sock'),
|
|
64
|
+
})
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Distributed deployments
|
|
68
|
+
|
|
69
|
+
Use a distributed backend when you run more than one instance or host, so every instance receives the same events. This matters whenever a request handled by one instance must reach work running on another. For example, sending a signal to an agent run requires the signal event to cross the process boundary to the instance that owns the run. With the in-process default, that instance never receives the event.
|
|
70
|
+
|
|
71
|
+
Both backends below deliver across processes and hosts and persist events for redelivery.
|
|
72
|
+
|
|
73
|
+
The following example uses [Redis Streams](https://redis.io/docs/latest/develop/data-types/streams/):
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
import { Mastra } from '@mastra/core'
|
|
77
|
+
import { RedisStreamsPubSub } from '@mastra/redis-streams'
|
|
78
|
+
|
|
79
|
+
export const mastra = new Mastra({
|
|
80
|
+
pubsub: new RedisStreamsPubSub({
|
|
81
|
+
url: 'redis://localhost:6379',
|
|
82
|
+
}),
|
|
83
|
+
})
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The following example uses [Google Cloud Pub/Sub](https://cloud.google.com/pubsub/docs):
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
import { Mastra } from '@mastra/core'
|
|
90
|
+
import { GoogleCloudPubSub } from '@mastra/google-cloud-pubsub'
|
|
91
|
+
|
|
92
|
+
export const mastra = new Mastra({
|
|
93
|
+
pubsub: new GoogleCloudPubSub({
|
|
94
|
+
projectId: 'my-project',
|
|
95
|
+
}),
|
|
96
|
+
})
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Resumable streams
|
|
100
|
+
|
|
101
|
+
Resumable streams let a client reconnect and replay events it missed, which requires the backend to keep recent history. Distributed backends such as [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams) persist events, so they support replay on their own.
|
|
102
|
+
|
|
103
|
+
In-process delivery does not keep history. To add replay on top of [`EventEmitterPubSub`](https://mastra.ai/reference/pubsub/event-emitter), wrap it in [`CachingPubSub`](https://mastra.ai/reference/pubsub/caching-pubsub), which records published events per topic so a late or reconnecting subscriber can catch up before continuing with live events.
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
import { Mastra } from '@mastra/core'
|
|
107
|
+
import { CachingPubSub, EventEmitterPubSub } from '@mastra/core/events'
|
|
108
|
+
import { InMemoryServerCache } from '@mastra/core/cache'
|
|
109
|
+
|
|
110
|
+
const cache = new InMemoryServerCache()
|
|
111
|
+
|
|
112
|
+
export const mastra = new Mastra({
|
|
113
|
+
pubsub: new CachingPubSub(new EventEmitterPubSub(), cache),
|
|
114
|
+
})
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
> **Note:** Visit the [PubSub reference](https://mastra.ai/reference/pubsub/base) for the full delivery contract and the configuration options for each backend.
|
|
118
|
+
|
|
119
|
+
## Related
|
|
120
|
+
|
|
121
|
+
- [PubSub reference](https://mastra.ai/reference/pubsub/base)
|
|
122
|
+
- [Mastra class](https://mastra.ai/reference/core/mastra-class)
|
|
123
|
+
- [Background task streaming](https://mastra.ai/docs/streaming/background-task-streaming)
|
|
124
|
+
- [Scheduled workflows](https://mastra.ai/docs/workflows/scheduled-workflows)
|
|
@@ -155,7 +155,7 @@ export const dynamicAgent = new Agent({
|
|
|
155
155
|
|
|
156
156
|
return `${basePrompt} ${localeInstructions}`.trim()
|
|
157
157
|
},
|
|
158
|
-
model: 'openai/gpt-5.
|
|
158
|
+
model: 'openai/gpt-5.5',
|
|
159
159
|
})
|
|
160
160
|
```
|
|
161
161
|
|
|
@@ -182,7 +182,7 @@ export const registryAgent = new Agent({
|
|
|
182
182
|
|
|
183
183
|
return prompt.content
|
|
184
184
|
},
|
|
185
|
-
model: 'openai/gpt-5.
|
|
185
|
+
model: 'openai/gpt-5.5',
|
|
186
186
|
})
|
|
187
187
|
```
|
|
188
188
|
|
|
@@ -336,7 +336,7 @@ export const validatedAgent = new Agent({
|
|
|
336
336
|
|
|
337
337
|
return `You are helping user ${userId}`
|
|
338
338
|
},
|
|
339
|
-
model: 'openai/gpt-5.
|
|
339
|
+
model: 'openai/gpt-5.5',
|
|
340
340
|
})
|
|
341
341
|
```
|
|
342
342
|
|
|
@@ -46,6 +46,26 @@ Setting [`server.auth`](https://mastra.ai/reference/configuration) does two thin
|
|
|
46
46
|
|
|
47
47
|
Studio detects available capabilities by calling the `GET /api/auth/capabilities` endpoint. The response tells Studio which login methods to render and, if the user is already authenticated, includes their user info and permissions.
|
|
48
48
|
|
|
49
|
+
## Pass a token through the URL
|
|
50
|
+
|
|
51
|
+
When another application embeds or links to Studio, it can hand over an authorization token through the `auth_header` URL parameter. This is useful when an external host already holds a token and wants to open an authenticated Studio session without showing the login screen.
|
|
52
|
+
|
|
53
|
+
The `auth_header` value always populates the `Authorization` request header. The parameter sets that one header only, so include any scheme prefix the server expects in the value, such as `Bearer`.
|
|
54
|
+
|
|
55
|
+
Open Studio with the token in the query string:
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
https://your-studio-host/?auth_header=Bearer%20your-token
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Studio handles the token as follows:
|
|
62
|
+
|
|
63
|
+
- It reads `auth_header` once on load and sends the value as the `Authorization` header on every API request in that session.
|
|
64
|
+
- It removes `auth_header` from the address bar while preserving other query parameters and the hash.
|
|
65
|
+
- It keeps the token in memory only and never writes it to local storage, so the token stays transient and does not persist across page reloads.
|
|
66
|
+
|
|
67
|
+
The token rides in a URL parameter, so the host application is responsible for how that URL is generated and transmitted. URL parameters can be exposed through browser history, referrer headers, and server access logs.
|
|
68
|
+
|
|
49
69
|
## Role-based access control
|
|
50
70
|
|
|
51
71
|
RBAC lets you control what each user can see and do inside Studio. It's separate from authentication: `server.auth` handles who the user is, while `server.rbac` handles what they can do.
|
|
@@ -16,7 +16,7 @@ const voiceAgent = new Agent({
|
|
|
16
16
|
id: 'voice-agent',
|
|
17
17
|
name: 'Voice Agent',
|
|
18
18
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
19
|
-
model: 'openai/gpt-5.
|
|
19
|
+
model: 'openai/gpt-5.5',
|
|
20
20
|
voice: new OpenAIVoice(),
|
|
21
21
|
})
|
|
22
22
|
```
|
|
@@ -40,7 +40,7 @@ const voiceAgent = new Agent({
|
|
|
40
40
|
id: 'voice-agent',
|
|
41
41
|
name: 'Voice Agent',
|
|
42
42
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
43
|
-
model: 'openai/gpt-5.
|
|
43
|
+
model: 'openai/gpt-5.5',
|
|
44
44
|
voice: new OpenAIVoice(),
|
|
45
45
|
})
|
|
46
46
|
|
|
@@ -68,7 +68,7 @@ const voiceAgent = new Agent({
|
|
|
68
68
|
id: 'voice-agent',
|
|
69
69
|
name: 'Voice Agent',
|
|
70
70
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
71
|
-
model: 'openai/gpt-5.
|
|
71
|
+
model: 'openai/gpt-5.5',
|
|
72
72
|
voice: new AzureVoice(),
|
|
73
73
|
})
|
|
74
74
|
|
|
@@ -95,7 +95,7 @@ const voiceAgent = new Agent({
|
|
|
95
95
|
id: 'voice-agent',
|
|
96
96
|
name: 'Voice Agent',
|
|
97
97
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
98
|
-
model: 'openai/gpt-5.
|
|
98
|
+
model: 'openai/gpt-5.5',
|
|
99
99
|
voice: new ElevenLabsVoice(),
|
|
100
100
|
})
|
|
101
101
|
|
|
@@ -122,7 +122,7 @@ const voiceAgent = new Agent({
|
|
|
122
122
|
id: 'voice-agent',
|
|
123
123
|
name: 'Voice Agent',
|
|
124
124
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
125
|
-
model: 'openai/gpt-5.
|
|
125
|
+
model: 'openai/gpt-5.5',
|
|
126
126
|
voice: new PlayAIVoice(),
|
|
127
127
|
})
|
|
128
128
|
|
|
@@ -149,7 +149,7 @@ const voiceAgent = new Agent({
|
|
|
149
149
|
id: 'voice-agent',
|
|
150
150
|
name: 'Voice Agent',
|
|
151
151
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
152
|
-
model: 'openai/gpt-5.
|
|
152
|
+
model: 'openai/gpt-5.5',
|
|
153
153
|
voice: new GoogleVoice(),
|
|
154
154
|
})
|
|
155
155
|
|
|
@@ -176,7 +176,7 @@ const voiceAgent = new Agent({
|
|
|
176
176
|
id: 'voice-agent',
|
|
177
177
|
name: 'Voice Agent',
|
|
178
178
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
179
|
-
model: 'openai/gpt-5.
|
|
179
|
+
model: 'openai/gpt-5.5',
|
|
180
180
|
voice: new CloudflareVoice(),
|
|
181
181
|
})
|
|
182
182
|
|
|
@@ -203,7 +203,7 @@ const voiceAgent = new Agent({
|
|
|
203
203
|
id: 'voice-agent',
|
|
204
204
|
name: 'Voice Agent',
|
|
205
205
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
206
|
-
model: 'openai/gpt-5.
|
|
206
|
+
model: 'openai/gpt-5.5',
|
|
207
207
|
voice: new DeepgramVoice(),
|
|
208
208
|
})
|
|
209
209
|
|
|
@@ -230,7 +230,7 @@ const voiceAgent = new Agent({
|
|
|
230
230
|
id: 'voice-agent',
|
|
231
231
|
name: 'Voice Agent',
|
|
232
232
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
233
|
-
model: 'openai/gpt-5.
|
|
233
|
+
model: 'openai/gpt-5.5',
|
|
234
234
|
voice: new InworldVoice(),
|
|
235
235
|
})
|
|
236
236
|
|
|
@@ -257,7 +257,7 @@ const voiceAgent = new Agent({
|
|
|
257
257
|
id: 'voice-agent',
|
|
258
258
|
name: 'Voice Agent',
|
|
259
259
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
260
|
-
model: 'openai/gpt-5.
|
|
260
|
+
model: 'openai/gpt-5.5',
|
|
261
261
|
voice: new SpeechifyVoice(),
|
|
262
262
|
})
|
|
263
263
|
|
|
@@ -284,7 +284,7 @@ const voiceAgent = new Agent({
|
|
|
284
284
|
id: 'voice-agent',
|
|
285
285
|
name: 'Voice Agent',
|
|
286
286
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
287
|
-
model: 'openai/gpt-5.
|
|
287
|
+
model: 'openai/gpt-5.5',
|
|
288
288
|
voice: new SarvamVoice(),
|
|
289
289
|
})
|
|
290
290
|
|
|
@@ -311,7 +311,7 @@ const voiceAgent = new Agent({
|
|
|
311
311
|
id: 'voice-agent',
|
|
312
312
|
name: 'Voice Agent',
|
|
313
313
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
314
|
-
model: 'openai/gpt-5.
|
|
314
|
+
model: 'openai/gpt-5.5',
|
|
315
315
|
voice: new MurfVoice(),
|
|
316
316
|
})
|
|
317
317
|
|
|
@@ -346,7 +346,7 @@ const voiceAgent = new Agent({
|
|
|
346
346
|
id: 'voice-agent',
|
|
347
347
|
name: 'Voice Agent',
|
|
348
348
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
349
|
-
model: 'openai/gpt-5.
|
|
349
|
+
model: 'openai/gpt-5.5',
|
|
350
350
|
voice: new OpenAIVoice(),
|
|
351
351
|
})
|
|
352
352
|
|
|
@@ -375,7 +375,7 @@ const voiceAgent = new Agent({
|
|
|
375
375
|
id: 'voice-agent',
|
|
376
376
|
name: 'Voice Agent',
|
|
377
377
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
378
|
-
model: 'openai/gpt-5.
|
|
378
|
+
model: 'openai/gpt-5.5',
|
|
379
379
|
voice: new AzureVoice(),
|
|
380
380
|
})
|
|
381
381
|
|
|
@@ -403,7 +403,7 @@ const voiceAgent = new Agent({
|
|
|
403
403
|
id: 'voice-agent',
|
|
404
404
|
name: 'Voice Agent',
|
|
405
405
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
406
|
-
model: 'openai/gpt-5.
|
|
406
|
+
model: 'openai/gpt-5.5',
|
|
407
407
|
voice: new ElevenLabsVoice(),
|
|
408
408
|
})
|
|
409
409
|
|
|
@@ -431,7 +431,7 @@ const voiceAgent = new Agent({
|
|
|
431
431
|
id: 'voice-agent',
|
|
432
432
|
name: 'Voice Agent',
|
|
433
433
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
434
|
-
model: 'openai/gpt-5.
|
|
434
|
+
model: 'openai/gpt-5.5',
|
|
435
435
|
voice: new GoogleVoice(),
|
|
436
436
|
})
|
|
437
437
|
|
|
@@ -459,7 +459,7 @@ const voiceAgent = new Agent({
|
|
|
459
459
|
id: 'voice-agent',
|
|
460
460
|
name: 'Voice Agent',
|
|
461
461
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
462
|
-
model: 'openai/gpt-5.
|
|
462
|
+
model: 'openai/gpt-5.5',
|
|
463
463
|
voice: new CloudflareVoice(),
|
|
464
464
|
})
|
|
465
465
|
|
|
@@ -487,7 +487,7 @@ const voiceAgent = new Agent({
|
|
|
487
487
|
id: 'voice-agent',
|
|
488
488
|
name: 'Voice Agent',
|
|
489
489
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
490
|
-
model: 'openai/gpt-5.
|
|
490
|
+
model: 'openai/gpt-5.5',
|
|
491
491
|
voice: new DeepgramVoice(),
|
|
492
492
|
})
|
|
493
493
|
|
|
@@ -515,7 +515,7 @@ const voiceAgent = new Agent({
|
|
|
515
515
|
id: 'voice-agent',
|
|
516
516
|
name: 'Voice Agent',
|
|
517
517
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
518
|
-
model: 'openai/gpt-5.
|
|
518
|
+
model: 'openai/gpt-5.5',
|
|
519
519
|
voice: new InworldVoice(),
|
|
520
520
|
})
|
|
521
521
|
|
|
@@ -543,7 +543,7 @@ const voiceAgent = new Agent({
|
|
|
543
543
|
id: 'voice-agent',
|
|
544
544
|
name: 'Voice Agent',
|
|
545
545
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
546
|
-
model: 'openai/gpt-5.
|
|
546
|
+
model: 'openai/gpt-5.5',
|
|
547
547
|
voice: new SarvamVoice(),
|
|
548
548
|
})
|
|
549
549
|
|
|
@@ -575,7 +575,7 @@ const voiceAgent = new Agent({
|
|
|
575
575
|
id: 'voice-agent',
|
|
576
576
|
name: 'Voice Agent',
|
|
577
577
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
578
|
-
model: 'openai/gpt-5.
|
|
578
|
+
model: 'openai/gpt-5.5',
|
|
579
579
|
voice: new OpenAIRealtimeVoice(),
|
|
580
580
|
})
|
|
581
581
|
|
|
@@ -605,7 +605,7 @@ const voiceAgent = new Agent({
|
|
|
605
605
|
id: 'voice-agent',
|
|
606
606
|
name: 'Voice Agent',
|
|
607
607
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
608
|
-
model: 'openai/gpt-5.
|
|
608
|
+
model: 'openai/gpt-5.5',
|
|
609
609
|
voice: new GeminiLiveVoice({
|
|
610
610
|
// Live API mode
|
|
611
611
|
apiKey: process.env.GOOGLE_API_KEY,
|
|
@@ -654,7 +654,7 @@ const voiceAgent = new Agent({
|
|
|
654
654
|
id: 'voice-agent',
|
|
655
655
|
name: 'Voice Agent',
|
|
656
656
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
657
|
-
model: 'openai/gpt-5.
|
|
657
|
+
model: 'openai/gpt-5.5',
|
|
658
658
|
voice: new NovaSonicVoice({
|
|
659
659
|
region: 'us-east-1',
|
|
660
660
|
speaker: 'matthew',
|
|
@@ -697,7 +697,7 @@ const voiceAgent = new Agent({
|
|
|
697
697
|
id: 'voice-agent',
|
|
698
698
|
name: 'Voice Agent',
|
|
699
699
|
instructions: 'You are a voice assistant that can help users with their tasks.',
|
|
700
|
-
model: 'openai/gpt-5.
|
|
700
|
+
model: 'openai/gpt-5.5',
|
|
701
701
|
voice: new InworldRealtimeVoice({
|
|
702
702
|
apiKey: process.env.INWORLD_API_KEY,
|
|
703
703
|
model: 'inworld/models/gemma-4-26b-a4b-it',
|
|
@@ -1132,7 +1132,7 @@ const voiceAgent = new Agent({
|
|
|
1132
1132
|
id: 'aisdk-voice-agent',
|
|
1133
1133
|
name: 'AI SDK Voice Agent',
|
|
1134
1134
|
instructions: 'You are a helpful assistant with voice capabilities.',
|
|
1135
|
-
model: 'openai/gpt-5.
|
|
1135
|
+
model: 'openai/gpt-5.5',
|
|
1136
1136
|
voice,
|
|
1137
1137
|
})
|
|
1138
1138
|
```
|
|
@@ -32,7 +32,7 @@ const agent = new Agent({
|
|
|
32
32
|
id: 'agent',
|
|
33
33
|
name: 'OpenAI Realtime Agent',
|
|
34
34
|
instructions: `You are a helpful assistant with real-time voice capabilities.`,
|
|
35
|
-
model: 'openai/gpt-5.
|
|
35
|
+
model: 'openai/gpt-5.5',
|
|
36
36
|
voice: new OpenAIRealtimeVoice(),
|
|
37
37
|
})
|
|
38
38
|
|
|
@@ -66,7 +66,7 @@ const agent = new Agent({
|
|
|
66
66
|
name: 'Gemini Live Agent',
|
|
67
67
|
instructions: 'You are a helpful assistant with real-time voice capabilities.',
|
|
68
68
|
// Model used for text generation; voice provider handles realtime audio
|
|
69
|
-
model: 'openai/gpt-5.
|
|
69
|
+
model: 'openai/gpt-5.5',
|
|
70
70
|
voice: new GeminiLiveVoice({
|
|
71
71
|
apiKey: process.env.GOOGLE_API_KEY,
|
|
72
72
|
model: 'gemini-2.0-flash-exp',
|
|
@@ -113,7 +113,7 @@ const agent = new Agent({
|
|
|
113
113
|
name: 'Nova Sonic Agent',
|
|
114
114
|
instructions: 'You are a helpful assistant with real-time voice capabilities.',
|
|
115
115
|
// Model used for text generation; voice provider handles realtime audio
|
|
116
|
-
model: 'openai/gpt-5.
|
|
116
|
+
model: 'openai/gpt-5.5',
|
|
117
117
|
voice: new NovaSonicVoice({
|
|
118
118
|
region: 'us-east-1',
|
|
119
119
|
speaker: 'matthew',
|
|
@@ -157,7 +157,7 @@ const agent = new Agent({
|
|
|
157
157
|
name: 'Inworld Realtime Agent',
|
|
158
158
|
instructions: 'You are a helpful assistant with real-time voice capabilities.',
|
|
159
159
|
// Model used for text generation; voice provider handles realtime audio
|
|
160
|
-
model: 'openai/gpt-5.
|
|
160
|
+
model: 'openai/gpt-5.5',
|
|
161
161
|
voice: new InworldRealtimeVoice({
|
|
162
162
|
apiKey: process.env.INWORLD_API_KEY,
|
|
163
163
|
model: 'inworld/models/gemma-4-26b-a4b-it',
|
|
@@ -44,7 +44,7 @@ const workspace = new Workspace({
|
|
|
44
44
|
|
|
45
45
|
const agent = new Agent({
|
|
46
46
|
id: 'file-agent',
|
|
47
|
-
model: 'openai/gpt-5.
|
|
47
|
+
model: 'openai/gpt-5.5',
|
|
48
48
|
instructions: 'You are a helpful file management assistant.',
|
|
49
49
|
workspace,
|
|
50
50
|
})
|
|
@@ -116,7 +116,7 @@ const workspace = new Workspace({
|
|
|
116
116
|
|
|
117
117
|
const agent = new Agent({
|
|
118
118
|
id: 'multi-role-agent',
|
|
119
|
-
model: 'openai/gpt-5.
|
|
119
|
+
model: 'openai/gpt-5.5',
|
|
120
120
|
workspace,
|
|
121
121
|
})
|
|
122
122
|
```
|
|
@@ -1305,7 +1305,7 @@ import { nestedAgentTool } from '../tools/nested-agent-tool'
|
|
|
1305
1305
|
export const forecastAgent = new Agent({
|
|
1306
1306
|
id: 'forecast-agent',
|
|
1307
1307
|
instructions: 'Use the nested-agent-stream tool when asked about weather.',
|
|
1308
|
-
model: 'openai/gpt-5.
|
|
1308
|
+
model: 'openai/gpt-5.5',
|
|
1309
1309
|
tools: { nestedAgentTool },
|
|
1310
1310
|
})
|
|
1311
1311
|
```
|
|
@@ -47,7 +47,7 @@ Set up the Workflow, define steps to extract and classify candidate data, and th
|
|
|
47
47
|
id: 'recruiter-agent',
|
|
48
48
|
name: 'Recruiter Agent',
|
|
49
49
|
instructions: `You are a recruiter.`,
|
|
50
|
-
model: 'openai/gpt-5.
|
|
50
|
+
model: 'openai/gpt-5.5',
|
|
51
51
|
})
|
|
52
52
|
|
|
53
53
|
const gatherCandidateInfo = createStep({
|
|
@@ -27,7 +27,7 @@ To create an agent in Mastra use the `Agent` class to define it and then registe
|
|
|
27
27
|
instructions:
|
|
28
28
|
'You are Michel, a practical and experienced home chef' +
|
|
29
29
|
'You help people cook with whatever ingredients they have available.',
|
|
30
|
-
model: 'openai/gpt-5.
|
|
30
|
+
model: 'openai/gpt-5.5',
|
|
31
31
|
})
|
|
32
32
|
```
|
|
33
33
|
|
|
@@ -122,7 +122,7 @@ When asked to review code:
|
|
|
122
122
|
2. Follow the review process from the skill
|
|
123
123
|
3. Check against the style guide in skill references
|
|
124
124
|
4. Be constructive and specific with line numbers`,
|
|
125
|
-
model: 'openai/gpt-5.
|
|
125
|
+
model: 'openai/gpt-5.5',
|
|
126
126
|
})
|
|
127
127
|
```
|
|
128
128
|
|
|
@@ -107,7 +107,7 @@ Create a tool file that exposes Firecrawl search and scrape to Mastra.
|
|
|
107
107
|
id: 'web-agent',
|
|
108
108
|
name: 'Web Agent',
|
|
109
109
|
instructions: 'Use Firecrawl tools to search and scrape web pages, then summarize the results.',
|
|
110
|
-
model: 'openai/gpt-5.
|
|
110
|
+
model: 'openai/gpt-5.5',
|
|
111
111
|
tools: { firecrawlSearch, firecrawlScrape },
|
|
112
112
|
})
|
|
113
113
|
```
|
|
@@ -99,7 +99,7 @@ Let's define the agent's behavior, connect it to your Mastra project, and create
|
|
|
99
99
|
and provide accurate, well-supported answers based on the retrieved content.
|
|
100
100
|
Focus on the specific content available in the tool and acknowledge if you cannot find sufficient information to answer a question.
|
|
101
101
|
Base your responses only on the content provided, not on general knowledge.`,
|
|
102
|
-
model: 'openai/gpt-5.
|
|
102
|
+
model: 'openai/gpt-5.5',
|
|
103
103
|
tools: {
|
|
104
104
|
vectorQueryTool,
|
|
105
105
|
},
|
|
@@ -94,7 +94,7 @@ Success criteria:
|
|
|
94
94
|
- Information is accurate and well-sourced
|
|
95
95
|
- Final output is well-formatted and complete
|
|
96
96
|
- If anything is missing or uncertain, continue gathering information`,
|
|
97
|
-
model: 'openai/gpt-5.
|
|
97
|
+
model: 'openai/gpt-5.5',
|
|
98
98
|
agents: {
|
|
99
99
|
researchAgent,
|
|
100
100
|
writingAgent,
|
|
@@ -288,7 +288,7 @@ Success criteria:
|
|
|
288
288
|
- Information is accurate and well-sourced
|
|
289
289
|
- Final output is well-formatted and complete
|
|
290
290
|
- If anything is missing or uncertain, continue gathering information`,
|
|
291
|
-
model: 'openai/gpt-5.
|
|
291
|
+
model: 'openai/gpt-5.5',
|
|
292
292
|
agents: {
|
|
293
293
|
researchAgent,
|
|
294
294
|
writingAgent,
|
|
@@ -48,7 +48,7 @@ export const slackAgent = new Agent({
|
|
|
48
48
|
name: 'Slack Agent',
|
|
49
49
|
instructions:
|
|
50
50
|
'You are a helpful assistant. Answer questions, help with tasks, and have natural conversations.',
|
|
51
|
-
model: 'anthropic/claude-opus-4-
|
|
51
|
+
model: 'anthropic/claude-opus-4-7',
|
|
52
52
|
channels: {
|
|
53
53
|
adapters: {
|
|
54
54
|
slack: createSlackAdapter(),
|
|
@@ -24,7 +24,7 @@ To create an agent in Mastra use the `Agent` class to define it and then registe
|
|
|
24
24
|
name: 'Stock Agent',
|
|
25
25
|
instructions:
|
|
26
26
|
'You are a helpful assistant that provides current stock prices. When asked about a stock, use the stock price tool to fetch the stock price.',
|
|
27
|
-
model: 'openai/gpt-5.
|
|
27
|
+
model: 'openai/gpt-5.5',
|
|
28
28
|
})
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -83,7 +83,7 @@ The Stock Agent doesn't yet know anything about current stock prices. To change
|
|
|
83
83
|
name: 'Stock Agent',
|
|
84
84
|
instructions:
|
|
85
85
|
'You are a helpful assistant that provides current stock prices. When asked about a stock, use the stock price tool to fetch the stock price.',
|
|
86
|
-
model: 'openai/gpt-5.
|
|
86
|
+
model: 'openai/gpt-5.5',
|
|
87
87
|
tools: {
|
|
88
88
|
stockPrices,
|
|
89
89
|
},
|