@mastra/mcp-docs-server 1.2.13-alpha.4 → 1.2.13-alpha.8
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/agents/agent-approval.md +2 -2
- package/.docs/docs/deployment/workers.md +14 -14
- package/.docs/docs/evals/datasets/running-experiments.md +1 -1
- package/.docs/docs/index.md +1 -1
- package/.docs/docs/long-running-agents/durable-agents.md +2 -2
- package/.docs/docs/mastra-platform/overview.md +1 -1
- package/.docs/docs/mastra-platform/{workspace.md → workspaces.md} +48 -7
- package/.docs/docs/memory/observational-memory.md +30 -13
- package/.docs/docs/memory/overview.md +14 -0
- package/.docs/docs/server/auth/workers.md +7 -5
- package/.docs/docs/server/mastra-client.md +60 -0
- package/.docs/docs/server/pubsub.md +2 -2
- package/.docs/docs/what-is-mastra.md +10 -10
- package/.docs/docs/workflows/overview.md +1 -1
- package/.docs/docs/workflows/scheduled-workflows.md +1 -0
- package/.docs/guides/deployment/kubernetes.md +2 -0
- package/.docs/guides/deployment/mastra-workers.md +350 -6
- package/.docs/guides/deployment/vercel.md +2 -0
- package/.docs/models/gateways/openrouter.md +1 -4
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/hyper.md +2 -1
- package/.docs/models/providers/minimax.md +1 -1
- package/.docs/models/providers/openai.md +2 -2
- package/.docs/models/providers/opencode-go.md +2 -1
- package/.docs/models/providers/opencode.md +1 -1
- package/.docs/models/providers/perplexity-agent.md +3 -1
- package/.docs/reference/agents/durable-agent.md +12 -1
- package/.docs/reference/cli/mastra.md +30 -14
- package/.docs/reference/core/mastra-class.md +1 -1
- package/.docs/reference/evals/summarization.md +203 -0
- package/.docs/reference/index.md +1 -0
- package/.docs/reference/memory/observational-memory.md +74 -24
- package/.docs/reference/observability/tracing/interfaces.md +3 -0
- package/.docs/reference/processors/regex-filter-processor.md +1 -1
- package/.docs/reference/tools/isolated-vm-transport.md +1 -1
- package/.docs/reference/vectors/mongodb.md +13 -13
- package/.docs/reference/workers/overview.md +10 -8
- package/.docs/reference/workspace/platform-filesystem.md +5 -2
- package/.docs/reference/workspace/platform-sandbox.md +80 -4
- package/CHANGELOG.md +15 -0
- package/package.json +5 -5
|
@@ -108,7 +108,7 @@ A tool's own `requireApproval` setting takes precedence over the function above.
|
|
|
108
108
|
|
|
109
109
|
For sensitive tools, bind the approval to the exact tool name and arguments that were shown to the reviewer. If those arguments drift before execution, the tool shouldn't run under the old approval.
|
|
110
110
|
|
|
111
|
-
The `tool-call-approval` chunk already includes `toolName`, `toolCallId`, and `args`. You can fingerprint those fields when the approval request is shown. The example below uses a
|
|
111
|
+
The `tool-call-approval` chunk already includes `toolName`, `toolCallId`, and `args`. You can fingerprint those fields when the approval request is shown. The example below uses a JSON string as the fingerprint, but in production you should use a stable hash of the tool name and arguments:
|
|
112
112
|
|
|
113
113
|
```typescript
|
|
114
114
|
import { Agent } from '@mastra/core/agent'
|
|
@@ -174,7 +174,7 @@ async function approveReviewedToolCall(runId: string, toolCallId: string, finger
|
|
|
174
174
|
await consumeApprovalStream(stream)
|
|
175
175
|
```
|
|
176
176
|
|
|
177
|
-
In production, store the approved fingerprint in durable storage scoped to the user, run, tool call, and policy version. The `Set` above is intentionally small so the boundary is
|
|
177
|
+
In production, store the approved fingerprint in durable storage scoped to the user, run, tool call, and policy version. The `Set` above is intentionally small so the boundary is clear: the approval is consumed once, and only for the same canonical tool arguments that were reviewed.
|
|
178
178
|
|
|
179
179
|
### Runtime suspension with `suspend()`
|
|
180
180
|
|
|
@@ -17,7 +17,7 @@ Workers matter when any of these apply:
|
|
|
17
17
|
- Different parts of the system need to scale independently (e.g., more orchestration capacity without more API instances)
|
|
18
18
|
- Background tool calls should run on dedicated compute
|
|
19
19
|
|
|
20
|
-
If your application handles light traffic and workflows complete
|
|
20
|
+
If your application handles light traffic and workflows complete fast, the default in-process setup works fine. Skip the worker infrastructure until you need it.
|
|
21
21
|
|
|
22
22
|
## Worker types
|
|
23
23
|
|
|
@@ -33,11 +33,11 @@ The orchestration worker requires a PubSub backend that supports pull mode (e.g.
|
|
|
33
33
|
|
|
34
34
|
### Scheduler worker
|
|
35
35
|
|
|
36
|
-
Polls storage for due cron schedules and publishes `workflow.start` events. It
|
|
36
|
+
Polls storage for due cron schedules and publishes `workflow.start` events. It's a producer only, meaning it creates work for the orchestration worker to pick up.
|
|
37
37
|
|
|
38
38
|
The scheduler reads declarative `schedule` fields from your workflow definitions automatically. See [Scheduled workflows](https://mastra.ai/docs/workflows/scheduled-workflows) for how to declare schedules.
|
|
39
39
|
|
|
40
|
-
**
|
|
40
|
+
**Don't run more than one scheduler instance.** Multiple schedulers polling the same storage would fire duplicate events for the same schedule.
|
|
41
41
|
|
|
42
42
|
### Background task worker
|
|
43
43
|
|
|
@@ -47,7 +47,7 @@ The background task worker manages concurrency limits, task lifecycle, and resul
|
|
|
47
47
|
|
|
48
48
|
## How workers run
|
|
49
49
|
|
|
50
|
-
### In-process (default)
|
|
50
|
+
### In-process mode (default)
|
|
51
51
|
|
|
52
52
|
With no configuration, Mastra creates and starts workers inside the API process. Events flow through an in-memory PubSub, and everything shares a single Node.js runtime.
|
|
53
53
|
|
|
@@ -64,7 +64,7 @@ This setup needs no external infrastructure beyond your storage adapter. It does
|
|
|
64
64
|
|
|
65
65
|
### Split processes
|
|
66
66
|
|
|
67
|
-
To run workers
|
|
67
|
+
To run workers in their own processes, configure a distributed [PubSub](https://mastra.ai/docs/server/pubsub) backend and use the `MASTRA_WORKERS` environment variable to control which workers start in each process.
|
|
68
68
|
|
|
69
69
|
**Redis Streams + PostgreSQL**:
|
|
70
70
|
|
|
@@ -100,38 +100,38 @@ export const mastra = new Mastra({
|
|
|
100
100
|
})
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
Any [supported storage backend](https://mastra.ai/reference/workers/overview) works
|
|
103
|
+
Any [supported storage backend](https://mastra.ai/reference/workers/overview) works. Swap the storage adapter for your preferred database.
|
|
104
104
|
|
|
105
105
|
Run the same build artifact in multiple containers, each with a different [`MASTRA_WORKERS`](https://mastra.ai/reference/workers/overview) value to control which worker starts in each process.
|
|
106
106
|
|
|
107
107
|
Split deployments require a distributed PubSub backend ([`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams) or [`GoogleCloudPubSub`](https://mastra.ai/reference/pubsub/google-cloud-pubsub)), a shared [storage backend](https://mastra.ai/reference/workers/overview), and network connectivity between the orchestration worker and the API.
|
|
108
108
|
|
|
109
|
-
The [worker deployment guide](https://mastra.ai/guides/deployment/mastra-workers) walks through this setup with
|
|
109
|
+
The [worker deployment guide](https://mastra.ai/guides/deployment/mastra-workers) walks through this setup with Docker Compose and Kubernetes examples.
|
|
110
110
|
|
|
111
111
|
## Network architecture
|
|
112
112
|
|
|
113
|
-
Workers are internal infrastructure. They
|
|
113
|
+
Workers are internal infrastructure. They're not exposed to end users and don't need their own subdomain, public URL, or inbound HTTP route.
|
|
114
114
|
|
|
115
115
|
In a split deployment:
|
|
116
116
|
|
|
117
|
-
- **The API server is the only public-facing process
|
|
118
|
-
- **Workers connect outbound only
|
|
119
|
-
- **The orchestration worker calls the API internally
|
|
117
|
+
- **The API server is the only public-facing process**: It serves all client HTTP requests, including REST endpoints, agent interactions, workflow triggers, and any custom routes.
|
|
118
|
+
- **Workers connect outbound only**: They pull events from the distributed PubSub backend and read/write to the shared storage database. They don't accept inbound traffic from clients.
|
|
119
|
+
- **The orchestration worker calls the API internally**: It sends step execution requests to the API over the container network using `MASTRA_STEP_EXECUTION_URL`. This is internal service-to-service communication, not a public endpoint.
|
|
120
120
|
|
|
121
121
|
All three worker types (orchestration, scheduler, background task) sit behind the API on a private network. They share access to the PubSub backend and storage database but never receive traffic directly from clients. If a worker-related feature needs an HTTP route (for example, token minting for a voice integration), that route runs on the API server, not on the worker process.
|
|
122
122
|
|
|
123
123
|
## Known limitations
|
|
124
124
|
|
|
125
|
-
- **No dead-letter queue**: Failed events are nacked and retried, but there
|
|
125
|
+
- **No dead-letter queue**: Failed events are nacked and retried, but there's no DLQ for events that fail after all retries.
|
|
126
126
|
- **No built-in health endpoint**: Workers don't expose an HTTP health check. Use container-level liveness probes or process monitoring.
|
|
127
127
|
- **Scheduler is single-instance**: Running multiple scheduler processes causes duplicate schedule fires.
|
|
128
128
|
- **Runs stuck in "running" after API crash**: If the API process crashes while executing a workflow step, the run remains in `running` status with no automatic retry. For [durable agents](https://mastra.ai/docs/long-running-agents/durable-agents), set `recovery.durableAgents` to `'auto'` in the Mastra config to automatically re-drive orphaned runs on server restart. See [Crash recovery](https://mastra.ai/docs/long-running-agents/durable-agents) for details.
|
|
129
129
|
|
|
130
130
|
## Related
|
|
131
131
|
|
|
132
|
-
- [Worker deployment guide](https://mastra.ai/guides/deployment/mastra-workers): Docker Compose
|
|
132
|
+
- [Worker deployment guide](https://mastra.ai/guides/deployment/mastra-workers): Docker Compose and Kubernetes examples
|
|
133
133
|
- [Worker authentication](https://mastra.ai/docs/server/auth/workers): Secure worker-to-API communication
|
|
134
|
-
- [Workers reference](https://mastra.ai/reference/workers/overview):
|
|
134
|
+
- [Workers reference](https://mastra.ai/reference/workers/overview): Details about worker environment variables and types, with a list of supported storage backends
|
|
135
135
|
- [CLI reference](https://mastra.ai/reference/cli/mastra): `mastra worker build` and `mastra worker start`
|
|
136
136
|
- [PubSub](https://mastra.ai/docs/server/pubsub): Event delivery backends
|
|
137
137
|
- [Scheduled workflows](https://mastra.ai/docs/workflows/scheduled-workflows): Declare cron schedules on workflows
|
|
@@ -133,7 +133,7 @@ Visit the [Scorers overview](https://mastra.ai/docs/evals/overview) for details
|
|
|
133
133
|
|
|
134
134
|
## Tool mocks
|
|
135
135
|
|
|
136
|
-
When an experiment runs an agent that calls side-effecting tools,
|
|
136
|
+
When an experiment runs an agent that calls side-effecting tools, attach static tool mocks to individual dataset items to make the run deterministic. During the experiment, a mocked tool returns its declared output instead of executing. Tools without a mock on the item run live by default.
|
|
137
137
|
|
|
138
138
|
Mocks live on the dataset item, so they version with the row and travel with the test case. Each mock declares a tool name, the arguments it expects, and the output to return:
|
|
139
139
|
|
package/.docs/docs/index.md
CHANGED
|
@@ -166,4 +166,4 @@ For other frameworks, see the [framework integration guides](https://mastra.ai/g
|
|
|
166
166
|
|
|
167
167
|
Browse [templates](https://mastra.ai/templates) for complete Mastra projects you can clone and adapt.
|
|
168
168
|
|
|
169
|
-
> **Note:** New to Mastra? Read [What
|
|
169
|
+
> **Note:** New to Mastra? Read [What's Mastra?](https://mastra.ai/docs/what-is-mastra) for an overview of the framework, its capabilities, and what you can build with it.
|
|
@@ -245,7 +245,7 @@ On startup, this discovers every registered durable agent with runs stuck in `ru
|
|
|
245
245
|
|
|
246
246
|
### Manual recovery
|
|
247
247
|
|
|
248
|
-
If you need finer control
|
|
248
|
+
If you need finer control, such as gating recovery behind a leader election or running it on a schedule, call the methods directly:
|
|
249
249
|
|
|
250
250
|
```typescript
|
|
251
251
|
// Recover all durable agents
|
|
@@ -261,7 +261,7 @@ await durableAgent.recoverActiveRuns({ runId: 'run-abc-123' })
|
|
|
261
261
|
|
|
262
262
|
### Multi-instance deployments
|
|
263
263
|
|
|
264
|
-
|
|
264
|
+
Mastra doesn't provide a distributed lease or lock yet. In multi-replica deployments, every replica that starts with `recovery.durableAgents: 'auto'` will race to recover the same runs. For now, either gate recovery behind your own leader election or run it from a single replica.
|
|
265
265
|
|
|
266
266
|
## Related
|
|
267
267
|
|
|
@@ -10,7 +10,7 @@ The [Mastra platform](https://projects.mastra.ai) provides three products for de
|
|
|
10
10
|
|
|
11
11
|
Deploy with a single command, [`mastra deploy`](https://mastra.ai/docs/mastra-platform/deploy), or connect a GitHub repository for push-to-deploy. See the [GitHub integration](https://mastra.ai/docs/mastra-platform/github) for the repository-linked flow.
|
|
12
12
|
|
|
13
|
-
Each project can run multiple [**Environments**](https://mastra.ai/docs/mastra-platform/environments) (for example `production` and `staging`), provision [**Hosted databases**](https://mastra.ai/docs/mastra-platform/database) from the CLI or project settings to persist application data, and get a managed [**
|
|
13
|
+
Each project can run multiple [**Environments**](https://mastra.ai/docs/mastra-platform/environments) (for example `production` and `staging`), provision [**Hosted databases**](https://mastra.ai/docs/mastra-platform/database) from the CLI or project settings to persist application data, and get a managed [**Workspaces**](https://mastra.ai/docs/mastra-platform/workspaces) per environment that gives agents a filesystem and a sandbox with no manual configuration.
|
|
14
14
|
|
|
15
15
|
[**Trace Intelligence**](https://mastra.ai/docs/mastra-platform/trace-intelligence) finds recurring goals, outcomes, behaviors, and sentiment across your agent traces. Trace Intelligence is available in private beta for selected projects.
|
|
16
16
|
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# Workspaces
|
|
4
4
|
|
|
5
|
-
A workspace
|
|
5
|
+
A workspace is a set of runtime resources the Mastra platform provisions and hands to your agents at deploy time. Each environment gets its own workspace so `production` and `staging` stay isolated.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- A **sandbox** for executing commands, exposed as [`PlatformSandbox`](https://mastra.ai/reference/workspace/platform-sandbox).
|
|
7
|
+
Every workspace exposes two capabilities:
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
- One **bucket** for filesystem storage, wrapped by [`PlatformFilesystem`](https://mastra.ai/reference/workspace/platform-filesystem). The bucket is a durable, environment-scoped store agents read from and write to across runs.
|
|
10
|
+
- A pool of **on-demand sandboxes** for command execution, wrapped by [`PlatformSandbox`](https://mastra.ai/reference/workspace/platform-sandbox). Each `PlatformSandbox` instance provisions its own remote sandbox on `start()` and destroys it on `destroy()`. Agents typically spin up many sandboxes per session, use them for a task, and let them go.
|
|
11
|
+
|
|
12
|
+
Workspaces are scoped to a single [environment](https://mastra.ai/docs/mastra-platform/environments), so `production` and `staging` don't share buckets or sandbox pools. The platform manages provisioning, credentials, and idle cleanup. Your deploy only constructs the providers.
|
|
11
13
|
|
|
12
14
|
## When workspaces are provisioned
|
|
13
15
|
|
|
@@ -15,7 +17,7 @@ New projects have workspaces enabled by default. When you create an environment,
|
|
|
15
17
|
|
|
16
18
|
Existing projects that haven't opted in show an **Enable workspaces** action in the Workspaces tab. Enabling provisions a bucket for every environment on the project.
|
|
17
19
|
|
|
18
|
-
If provisioning fails for an environment, for example while
|
|
20
|
+
If provisioning fails for an environment, for example while the sandbox provider is under load, the Workspaces tab shows the failure and offers a retry. The environment itself is still created. Only the workspace is unavailable until you retry.
|
|
19
21
|
|
|
20
22
|
## Use the workspace from your code
|
|
21
23
|
|
|
@@ -68,6 +70,45 @@ export const mastra = new Mastra({
|
|
|
68
70
|
|
|
69
71
|
`PlatformFilesystem` and `PlatformSandbox` read their credentials from environment variables the platform injects at deploy time, so you don't pass any options on the platform.
|
|
70
72
|
|
|
73
|
+
## One bucket, many sandboxes
|
|
74
|
+
|
|
75
|
+
The two providers have different lifecycles, and the difference matters when you design agents.
|
|
76
|
+
|
|
77
|
+
**`PlatformFilesystem` is a long-lived handle to the environment's bucket.** All requests, all agents, and all sandboxes in the environment read and write the same object storage. Anything an agent writes is visible on the next request unless you explicitly delete it.
|
|
78
|
+
|
|
79
|
+
**`PlatformSandbox` is a client for provisioning ephemeral sandboxes.** Each `PlatformSandbox` instance owns one remote sandbox:
|
|
80
|
+
|
|
81
|
+
- `start()` provisions a fresh sandbox (or reattaches when you passed `sandboxId`).
|
|
82
|
+
- `executeCommand()` runs commands against it.
|
|
83
|
+
- `destroy()` tears the sandbox down. `stop()` is an alias.
|
|
84
|
+
|
|
85
|
+
The `sandbox` you pass to `Workspace` provides the tools an agent uses inside its own request. When your agent needs another isolated environment, for example a per-task workspace, a per-user tenant, or a background job that shouldn't touch the caller's shell state, construct another `PlatformSandbox`:
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
import { PlatformSandbox } from '@mastra/platform-workspace'
|
|
89
|
+
|
|
90
|
+
export async function runInFreshSandbox(command: string) {
|
|
91
|
+
const sandbox = new PlatformSandbox()
|
|
92
|
+
await sandbox.start()
|
|
93
|
+
try {
|
|
94
|
+
return await sandbox.executeCommand(command)
|
|
95
|
+
} finally {
|
|
96
|
+
await sandbox.destroy()
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Or clone a configured sandbox as the template for a fleet, so the clones inherit credentials, environment, network isolation, and defaults without repeating them:
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
const template = new PlatformSandbox({ networkIsolation: 'PRIVATE' })
|
|
105
|
+
|
|
106
|
+
const perProjectSandbox = template.clone({ id: `project-${projectId}` })
|
|
107
|
+
await perProjectSandbox.start()
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
See [`PlatformSandbox` reference](https://mastra.ai/reference/workspace/platform-sandbox) for the full lifecycle, checkpoint recovery, reattachment, and clone options.
|
|
111
|
+
|
|
71
112
|
## Injected environment variables
|
|
72
113
|
|
|
73
114
|
Every deploy that runs on a platform environment with a workspace receives these variables:
|
|
@@ -107,5 +148,5 @@ The Workspaces tab in your platform project shows, per environment:
|
|
|
107
148
|
## See also
|
|
108
149
|
|
|
109
150
|
- [`PlatformFilesystem`](https://mastra.ai/reference/workspace/platform-filesystem): reference for the filesystem provider.
|
|
110
|
-
- [`PlatformSandbox`](https://mastra.ai/reference/workspace/platform-sandbox): reference for the sandbox provider.
|
|
151
|
+
- [`PlatformSandbox`](https://mastra.ai/reference/workspace/platform-sandbox): reference for the sandbox provider, including checkpoint recovery and cloning.
|
|
111
152
|
- [Environments](https://mastra.ai/docs/mastra-platform/environments): how environments scope workspaces, variables, and databases.
|
|
@@ -94,7 +94,7 @@ See [configuration options](https://mastra.ai/reference/memory/observational-mem
|
|
|
94
94
|
>
|
|
95
95
|
> For an AI SDK example, see [Using Mastra Memory](https://mastra.ai/guides/build-your-ui/ai-sdk-ui).
|
|
96
96
|
|
|
97
|
-
> **Note:** OM currently only supports `@mastra/pg`, `@mastra/libsql`, `@mastra/mongodb`, and `@mastra/convex` storage adapters. It uses background agents for managing memory. When no model is set, the default model is `google/gemini-2.5-flash`.
|
|
97
|
+
> **Note:** OM currently only supports `@mastra/pg`, `@mastra/libsql`, `@mastra/mysql`, `@mastra/mongodb`, and `@mastra/convex` storage adapters. It uses background agents for managing memory. When no model is set, the default model is `google/gemini-2.5-flash`.
|
|
98
98
|
|
|
99
99
|
## Temporal gap markers
|
|
100
100
|
|
|
@@ -378,7 +378,7 @@ new Agent({
|
|
|
378
378
|
})
|
|
379
379
|
```
|
|
380
380
|
|
|
381
|
-
You can also pass an allowlist of mimeType globs (for example `['image/*']`) to forward only the kinds the Observer can handle.
|
|
381
|
+
You can also pass an allowlist of mimeType globs (for example `['image/*']`) to forward only the kinds the Observer can handle. Alternatively, set `observeAttachments: 'auto'` to let Mastra decide from the provider capabilities registry: attachments are forwarded when the Observer model supports multimodal input and dropped otherwise, falling back to `true` when no capability data is available for the model.
|
|
382
382
|
|
|
383
383
|
```md
|
|
384
384
|
Date: 2026-01-15
|
|
@@ -399,12 +399,29 @@ Example: An agent using Playwright MCP might see 50,000+ tokens per page snapsho
|
|
|
399
399
|
|
|
400
400
|
When observations exceed their threshold (default: 40,000 tokens), the Reflector condenses them and combines related items, plus reflects on patterns.
|
|
401
401
|
|
|
402
|
+
Reflections don't accumulate as a separate, ever-growing layer. Each reflection rewrites the entire observation log. The Reflector's output becomes the new log, and new observations append after it. When the log next hits the threshold, the Reflector re-processes everything, including earlier reflections. It condenses older information more aggressively while keeping recent detail. Memory stays bounded around the reflection threshold no matter how long the conversation runs.
|
|
403
|
+
|
|
402
404
|
The result is a three-tier system:
|
|
403
405
|
|
|
404
406
|
1. **Recent messages**: Exact conversation history for the current task
|
|
405
407
|
2. **Observations**: A log of what the Observer has seen
|
|
406
408
|
3. **Reflections**: Condensed observations when memory becomes too long
|
|
407
409
|
|
|
410
|
+
### How context changes over time
|
|
411
|
+
|
|
412
|
+
With default settings, the context window doesn't grow unbounded. It oscillates through an observe-and-shrink cycle:
|
|
413
|
+
|
|
414
|
+

|
|
415
|
+
|
|
416
|
+
1. **0 → 30k tokens**: Message history grows normally. In the background, the Observer buffers observations every \~6k tokens (`bufferTokens: 0.2`).
|
|
417
|
+
2. **30k reached**: Buffered observations activate instantly. Observed messages are removed from the context window and only \~6k tokens of recent history remain (`bufferActivation: 0.8` retains 20% of the threshold). The \~24k tokens of removed messages become roughly 1-5k tokens of observations at typical 5-40x compression.
|
|
418
|
+
3. **Repeat**: History grows from \~6k back toward 30k and shrinks again. Each cycle appends to the observation log, which grows much more slowly than raw history.
|
|
419
|
+
4. **Observations reach 40k**: The Reflector creates a smaller log from the current observations and any earlier reflections.
|
|
420
|
+
|
|
421
|
+
In the normal buffered cycle, raw history oscillates between roughly 6k and 30k tokens. The observation log stays around 40k tokens, however long the conversation runs. These are activation thresholds rather than hard caps. If background buffering doesn't keep pace, history can grow past the threshold until `blockAfter` (default `1.2`) forces a synchronous observation at \~36k tokens (\~48k for reflection) as a safety ceiling.
|
|
422
|
+
|
|
423
|
+
With [`shareTokenBudget`](https://mastra.ai/reference/memory/observational-memory) enabled, the two budgets pool together. While the observation log is small, message history can expand into the unused observation space (up to \~70k tokens with the defaults) before observation triggers. It then shrinks as observations accumulate.
|
|
424
|
+
|
|
408
425
|
### Retrieval mode
|
|
409
426
|
|
|
410
427
|
Normal OM compresses messages into observations, which is great for staying on task, but the original wording is gone. Retrieval mode fixes this by keeping each observation group linked to the raw messages that produced it. When the agent needs exact wording, tool output, or chronology that the summary compressed away, it can call a `recall` tool to page through the source messages.
|
|
@@ -684,7 +701,7 @@ Reflection works similarly, the Reflector runs in the background when observatio
|
|
|
684
701
|
| ------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
685
702
|
| `observation.bufferTokens` | `0.2` | How often to buffer. `0.2` means every 20% of `messageTokens`. With the default 30k threshold, that's roughly every 6k tokens. Can also be an absolute token count (e.g. `5000`). |
|
|
686
703
|
| `observation.bufferActivation` | `0.8` | How aggressively to clear the message window on activation. `0.8` means remove enough messages to keep only 20% of `messageTokens` remaining. Lower values keep more message history. |
|
|
687
|
-
| `observation.blockAfter` | `1.2` | Safety
|
|
704
|
+
| `observation.blockAfter` | `1.2` | Safety net if buffering can't keep up. Values from 1 up to (but not including) 100 multiply `messageTokens`: at `1.2`, synchronous observation is forced at 36k tokens (1.2 × 30k). Values of 100 or more are absolute token counts (e.g. `50_000`). |
|
|
688
705
|
| `activateAfterIdle` | none | Forces buffered observations to activate after a period of inactivity, even before `observation.messageTokens` is reached. Accepts a numeric millisecond value such as `300_000`, duration strings like `"5m"` or `"1hr"`, or `"auto"` for a provider-aware prompt cache TTL. |
|
|
689
706
|
| `activateOnProviderChange` | `false` | Forces buffered observations to activate when the next step uses a different `provider/model` than the one that produced the latest assistant step. Use this when switching providers or models would invalidate prompt cache reuse. |
|
|
690
707
|
| `reflection.bufferActivation` | `0.5` | When to start background reflection. `0.5` means reflection begins when observations reach 50% of the `observationTokens` threshold. |
|
|
@@ -696,16 +713,16 @@ If you're relying on prompt caching, set `activateAfterIdle` to `"auto"` or to a
|
|
|
696
713
|
|
|
697
714
|
With `"auto"`, Mastra chooses an idle activation TTL from the active model provider:
|
|
698
715
|
|
|
699
|
-
| Provider
|
|
700
|
-
|
|
|
701
|
-
| Anthropic, OpenRouter, unknown providers, xAI
|
|
702
|
-
| DeepSeek
|
|
703
|
-
| Google Gemini
|
|
704
|
-
| Groq
|
|
705
|
-
| OpenAI with `providerOptions.openai.promptCacheRetention: "24h"`
|
|
706
|
-
| OpenAI with `providerOptions.openai.promptCacheRetention: "in_memory"`
|
|
707
|
-
| OpenAI `gpt-4*`, `gpt-5`, `gpt-5-*`, `gpt-5.1
|
|
708
|
-
| Other OpenAI models
|
|
716
|
+
| Provider | Auto TTL |
|
|
717
|
+
| ------------------------------------------------------------------------------------------------------ | --------- |
|
|
718
|
+
| Anthropic, OpenRouter, unknown providers, xAI | 5 minutes |
|
|
719
|
+
| DeepSeek | 1 hour |
|
|
720
|
+
| Google Gemini | 24 hours |
|
|
721
|
+
| Groq | 2 hours |
|
|
722
|
+
| OpenAI with `providerOptions.openai.promptCacheRetention: "24h"` | 1 hour |
|
|
723
|
+
| OpenAI with `providerOptions.openai.promptCacheRetention: "in_memory"` | 5 minutes |
|
|
724
|
+
| OpenAI `gpt-4*`, `gpt-5`, `gpt-5-*`, and `gpt-5.1` through `gpt-5.4` (including `-` suffixed variants) | 5 minutes |
|
|
725
|
+
| Other OpenAI models | 1 hour |
|
|
709
726
|
|
|
710
727
|
```typescript
|
|
711
728
|
const memory = new Memory({
|
|
@@ -172,6 +172,20 @@ export const memoryAgent = new Agent({
|
|
|
172
172
|
|
|
173
173
|
See [Observational Memory](https://mastra.ai/docs/memory/observational-memory) for details on how observations and reflections work, and [the reference](https://mastra.ai/reference/memory/observational-memory) for all configuration options.
|
|
174
174
|
|
|
175
|
+
## What the model sees
|
|
176
|
+
|
|
177
|
+
Each memory feature is added to either the system messages or the conversation messages in the request sent to the model. The layers depend on the features you've enabled. Working memory and semantic recall only appear when configured. The same applies to Observational Memory, while message history is on by default. The diagram shows where each enabled layer is placed in the request. The list below describes what each layer contributes:
|
|
178
|
+
|
|
179
|
+

|
|
180
|
+
|
|
181
|
+
- [Working memory](https://mastra.ai/docs/memory/working-memory) is injected as a system message containing the template and the stored data. With `useStateSignals`, it's delivered as a state signal instead.
|
|
182
|
+
- [Semantic recall](https://mastra.ai/docs/memory/semantic-recall) matches from the current thread are inserted as regular messages and interleave with message history by timestamp. Matches from other threads are formatted into a system message instead.
|
|
183
|
+
- [Message history](https://mastra.ai/docs/memory/message-history) adds the last N messages in chronological order. Your new message always comes last.
|
|
184
|
+
- [Observational Memory](https://mastra.ai/docs/memory/observational-memory) replaces old raw history: reflections and observations live in a system message, and only messages that haven't been observed yet remain in the conversation. A short continuation reminder is placed at the start of the conversation messages.
|
|
185
|
+
- Context messages are the optional `context` array passed on a call, for example `agent.generate(msg, { context: [...] })`. Use them for one-off background such as app state or your own RAG results. They appear as regular conversation messages for that request only and are never saved to memory.
|
|
186
|
+
|
|
187
|
+
Conversation messages are ordered by timestamp and deduplicated by message ID, so recalled older messages appear before recent history. Context messages passed at call time are stamped with the current time, which places them after history and recall but before your new message. To inspect the exact context for a real request, use [Tracing](https://mastra.ai/docs/observability/tracing/overview) and open the LLM call spans, see [Observability](#observability) below.
|
|
188
|
+
|
|
175
189
|
## Memory in multi-agent systems
|
|
176
190
|
|
|
177
191
|
When a [supervisor agent](https://mastra.ai/docs/agents/supervisor-agents) delegates to a subagent, Mastra isolates subagent memory automatically. No flag enables this as it happens on every delegation. Understanding how this scoping works lets you decide what stays private and what to share intentionally.
|
|
@@ -57,7 +57,7 @@ services:
|
|
|
57
57
|
orchestration-worker:
|
|
58
58
|
environment:
|
|
59
59
|
MASTRA_WORKER_AUTH_TOKEN: ${WORKER_TOKEN}
|
|
60
|
-
MASTRA_STEP_EXECUTION_URL: http://api:4111/api
|
|
60
|
+
MASTRA_STEP_EXECUTION_URL: http://api:4111/api # Use HTTPS in production
|
|
61
61
|
# ... other env vars
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -65,6 +65,8 @@ services:
|
|
|
65
65
|
WORKER_TOKEN=sk-worker-secret-token
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
+
These examples use `http://` for local development. In production, use HTTPS URLs and terminate TLS with a service mesh or ingress controller. See [Security recommendations](#security-recommendations).
|
|
69
|
+
|
|
68
70
|
The orchestration worker reads `MASTRA_WORKER_AUTH_TOKEN` and sends it as a `Bearer` token in the `Authorization` header on every step execution request.
|
|
69
71
|
|
|
70
72
|
## Auth credential types
|
|
@@ -87,7 +89,7 @@ Send the credential as `x-worker-api-key` instead of `Authorization`:
|
|
|
87
89
|
import { HttpRemoteStrategy } from '@mastra/core/worker'
|
|
88
90
|
|
|
89
91
|
const strategy = new HttpRemoteStrategy({
|
|
90
|
-
serverUrl: 'http://api:4111/api',
|
|
92
|
+
serverUrl: 'http://api:4111/api', // Use HTTPS in production
|
|
91
93
|
auth: { type: 'api-key', key: process.env.WORKER_API_KEY! },
|
|
92
94
|
})
|
|
93
95
|
```
|
|
@@ -102,7 +104,7 @@ Use any header name and value:
|
|
|
102
104
|
import { HttpRemoteStrategy } from '@mastra/core/worker'
|
|
103
105
|
|
|
104
106
|
const strategy = new HttpRemoteStrategy({
|
|
105
|
-
serverUrl: 'http://api:4111/api',
|
|
107
|
+
serverUrl: 'http://api:4111/api', // Use HTTPS in production
|
|
106
108
|
auth: {
|
|
107
109
|
type: 'header',
|
|
108
110
|
name: 'X-Internal-Service-Key',
|
|
@@ -111,7 +113,7 @@ const strategy = new HttpRemoteStrategy({
|
|
|
111
113
|
})
|
|
112
114
|
```
|
|
113
115
|
|
|
114
|
-
## Push-mode broker
|
|
116
|
+
## Push-mode broker auth
|
|
115
117
|
|
|
116
118
|
When using a push-mode PubSub (like Google Cloud Pub/Sub), the broker POSTs events directly to the `/api/workflows/events` endpoint. The broker attaches its own credentials. For example, Google Cloud Pub/Sub sends a Google-signed OIDC token.
|
|
117
119
|
|
|
@@ -121,7 +123,7 @@ Your auth provider's `authenticateToken` callback must recognize whatever creden
|
|
|
121
123
|
|
|
122
124
|
- **Use different tokens for different worker types.** This lets you revoke access to one worker without affecting others.
|
|
123
125
|
- **Rotate tokens on a schedule.** Update the `WORKER_TOKEN` environment variable and restart the affected containers.
|
|
124
|
-
- **Use TLS in production.** Worker-to-API communication should go over HTTPS to protect tokens in transit.
|
|
126
|
+
- **Use TLS in production.** Worker-to-API communication should go over HTTPS to protect tokens in transit. This applies to all environments, including Kubernetes clusters and Docker networks. Use a service mesh (e.g., Istio, Linkerd) or TLS-terminating ingress to encrypt internal traffic.
|
|
125
127
|
- **Restrict network access.** The step execution and event endpoints are internal. If possible, keep them off the public internet using network policies or firewall rules.
|
|
126
128
|
|
|
127
129
|
## Related
|
|
@@ -69,6 +69,66 @@ The Mastra Client SDK exposes all resources served by the Mastra Server.
|
|
|
69
69
|
- **[Logs](https://mastra.ai/reference/client-js/logs)**: View logs and debug system behavior.
|
|
70
70
|
- **[Telemetry](https://mastra.ai/reference/client-js/telemetry)**: View app performance and trace activity.
|
|
71
71
|
|
|
72
|
+
## Create and run stored workflows
|
|
73
|
+
|
|
74
|
+
Use `upsertStoredWorkflow()` to create or replace a persisted workflow definition. A successful upsert validates the complete definition, registers it with the running Mastra instance, and makes it available through the standard workflow execution API.
|
|
75
|
+
|
|
76
|
+
The following example creates a mapping workflow, reads the stored definition, runs it, and then deletes it:
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
import { MastraClient } from '@mastra/client-js'
|
|
80
|
+
import type { UpsertStoredWorkflowParams } from '@mastra/client-js'
|
|
81
|
+
|
|
82
|
+
const client = new MastraClient({
|
|
83
|
+
baseUrl: process.env.MASTRA_API_URL || 'http://localhost:4111',
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
const definition = {
|
|
87
|
+
id: 'greeting-workflow',
|
|
88
|
+
description: 'Returns a greeting for the supplied name',
|
|
89
|
+
inputSchema: {
|
|
90
|
+
type: 'object',
|
|
91
|
+
properties: { name: { type: 'string' } },
|
|
92
|
+
required: ['name'],
|
|
93
|
+
},
|
|
94
|
+
outputSchema: {
|
|
95
|
+
type: 'object',
|
|
96
|
+
properties: { message: { type: 'string' } },
|
|
97
|
+
required: ['message'],
|
|
98
|
+
},
|
|
99
|
+
graph: [
|
|
100
|
+
{
|
|
101
|
+
type: 'mapping',
|
|
102
|
+
id: 'create-greeting',
|
|
103
|
+
mapConfig: JSON.stringify({
|
|
104
|
+
message: { template: 'Hello, ${initData.name}!' },
|
|
105
|
+
}),
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
} satisfies UpsertStoredWorkflowParams
|
|
109
|
+
|
|
110
|
+
await client.upsertStoredWorkflow(definition)
|
|
111
|
+
|
|
112
|
+
const storedWorkflow = client.getStoredWorkflow(definition.id)
|
|
113
|
+
const storedDefinition = await storedWorkflow.details()
|
|
114
|
+
|
|
115
|
+
const workflow = client.getWorkflow(storedDefinition.id)
|
|
116
|
+
const run = await workflow.createRun()
|
|
117
|
+
const result = await run.startAsync({ inputData: { name: 'Ada' } })
|
|
118
|
+
|
|
119
|
+
console.log(result)
|
|
120
|
+
|
|
121
|
+
await storedWorkflow.delete()
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Use `listStoredWorkflows()` to list persisted definitions. Calling `upsertStoredWorkflow()` again with the same `id` replaces the stored definition and live workflow registration.
|
|
125
|
+
|
|
126
|
+
> **Warning:** Durable storage requires a configured storage adapter that supports the `workflowDefinitions` domain. Without that domain, Core can register a workflow in memory, but the server's stored-workflow API can't preserve it across restarts.
|
|
127
|
+
>
|
|
128
|
+
> Stored definitions support declarative agent, tool, mapping, nested workflow, parallel, foreach, sleep, sleep-until, conditional, and loop entries. They can't contain JavaScript closures. Conditional and loop logic must use the declarative predicate format, and referenced agents, tools, and nested workflows must already be registered.
|
|
129
|
+
>
|
|
130
|
+
> Authenticated servers require `stored-workflows:read` or `stored-workflows:write` for definition operations and `workflows:execute` to run the workflow.
|
|
131
|
+
|
|
72
132
|
## Generating responses
|
|
73
133
|
|
|
74
134
|
Call `.generate()` with a string prompt:
|
|
@@ -124,6 +124,6 @@ Visit the [PubSub reference](https://mastra.ai/reference/pubsub/base) for the fu
|
|
|
124
124
|
|
|
125
125
|
- [PubSub reference](https://mastra.ai/reference/pubsub/base)
|
|
126
126
|
- [Mastra class](https://mastra.ai/reference/core/mastra-class)
|
|
127
|
+
- [Workers](https://mastra.ai/docs/deployment/workers): Run workflow orchestration and background tasks in dedicated processes using PubSub
|
|
127
128
|
- [Background task streaming](https://mastra.ai/docs/long-running-agents/background-tasks)
|
|
128
|
-
- [Scheduled workflows](https://mastra.ai/docs/workflows/scheduled-workflows)
|
|
129
|
-
- [Workers](https://mastra.ai/docs/deployment/workers): Run workflow orchestration and background tasks in dedicated processes using PubSub
|
|
129
|
+
- [Scheduled workflows](https://mastra.ai/docs/workflows/scheduled-workflows)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
2
|
|
|
3
|
-
# What
|
|
3
|
+
# What's Mastra?
|
|
4
4
|
|
|
5
|
-
Mastra is an open-source TypeScript framework for building AI applications and autonomous AI systems. Use it for anything from an AI feature inside an existing product to long-running agents that run entire processes on their own, such as a software factory that plans, builds, reviews, and
|
|
5
|
+
Mastra is an open-source TypeScript framework for building AI applications and autonomous AI systems. Use it for anything from an AI feature inside an existing product to long-running agents that run entire processes on their own, such as a software factory that plans, builds, reviews, and releases code.
|
|
6
6
|
|
|
7
|
-
Mastra gives you everything you need to build an agent harness out of the box. It's built on established patterns, so you make fewer integration decisions and spend more time on your product.
|
|
7
|
+
Mastra gives you everything you need to build an agent harness out of the box. It's built on established patterns, so you make fewer integration decisions and spend more time on your product. It also includes a [skill and CLI](https://mastra.ai/docs/getting-started/build-with-ai) that help your coding agent write accurate, up-to-date Mastra code.
|
|
8
8
|
|
|
9
9
|
Run Mastra standalone or inside your existing web server, and call your agents from your own code, over HTTP using the [Mastra client](https://mastra.ai/docs/server/mastra-client), or from channels (for example, Slack).
|
|
10
10
|
|
|
@@ -29,10 +29,10 @@ export const supportAgent = new Agent({
|
|
|
29
29
|
|
|
30
30
|
Then add the capabilities your agent needs:
|
|
31
31
|
|
|
32
|
-
- **Act in real environments**: Use [workspaces](https://mastra.ai/docs/workspace/overview) so agents can read and write files
|
|
32
|
+
- **Act in real environments**: Use [workspaces](https://mastra.ai/docs/workspace/overview) so agents can read and write files or run commands. They can also work inside a sandbox.
|
|
33
33
|
- **Bring the right context**: Use tools, [memory](https://mastra.ai/docs/memory/observational-memory), [skills](https://mastra.ai/docs/agents/skills), and domain knowledge so agents remember what matters and stay within the context window.
|
|
34
34
|
- **Coordinate complex work**: Run typed [workflows](https://mastra.ai/docs/workflows/overview), [tasks](https://mastra.ai/docs/agents/using-tools), and [subagents](https://mastra.ai/docs/agents/supervisor-agents) when work needs multiple steps or parallel execution.
|
|
35
|
-
- **Control the agent loop**: [Suspend](https://mastra.ai/docs/agents/agent-approval) for human approval
|
|
35
|
+
- **Control the agent loop**: [Suspend](https://mastra.ai/docs/agents/agent-approval) for human approval or steer an in-flight loop with [signals](https://mastra.ai/docs/long-running-agents/signals). You can also queue input for the next turn.
|
|
36
36
|
- **Meet users where they work**: Connect agents to Slack, Discord, GitHub, and other [channels](https://mastra.ai/docs/capabilities/channels/overview).
|
|
37
37
|
- **Manage risk and cost**: Configure authentication, multi-tenant isolation, and [guardrails](https://mastra.ai/docs/agents/guardrails), including [`CostGuardProcessor`](https://mastra.ai/reference/processors/cost-guard-processor).
|
|
38
38
|
|
|
@@ -42,13 +42,13 @@ See the left-hand sidebar for the full menu of features.
|
|
|
42
42
|
|
|
43
43
|

|
|
44
44
|
|
|
45
|
-
[Studio](https://mastra.ai/docs/studio/overview) is usually the first place you go after creating a Mastra app. It gives you a live environment
|
|
45
|
+
[Studio](https://mastra.ai/docs/studio/overview) is usually the first place you go after creating a Mastra app. It gives you a live environment where you can test agents and inspect runs as you iterate.
|
|
46
46
|
|
|
47
|
-
Studio isn't
|
|
47
|
+
Studio isn't limited to engineers. Deploy it and share it with your team, so collaborators can try an agent before it goes to production. With the [Editor](https://mastra.ai/docs/editor/overview) and [Agent Builder](https://mastra.ai/docs/agent-builder/overview), non-technical teammates can create and iterate on agents themselves, with every change versioned in code.
|
|
48
48
|
|
|
49
49
|
## Observability and evals
|
|
50
50
|
|
|
51
|
-

|
|
52
52
|
|
|
53
53
|
Mastra has built-in logs, traces, and metrics, so you can understand every run in development and production. See [Observability](https://mastra.ai/docs/observability/overview).
|
|
54
54
|
|
|
@@ -59,9 +59,9 @@ Evals close the loop. Score outputs with rule-based or LLM-as-judge [scorers](ht
|
|
|
59
59
|
Some agents finish in a single request. Others run for hours or days, like a sales agent that watches for signups or an SRE agent that handles incidents. Mastra supports [long-running agents](https://mastra.ai/docs/long-running-agents/durable-agents) with these capabilities:
|
|
60
60
|
|
|
61
61
|
- **Survive restarts and disconnects**: [Durable agents](https://mastra.ai/docs/long-running-agents/durable-agents) persist run state so work resumes and clients reconnect.
|
|
62
|
-
- **Wake and steer agents mid-run**: Send [messages and signals](https://mastra.ai/docs/long-running-agents/signals) to wake an agent
|
|
62
|
+
- **Wake and steer agents mid-run**: Send [messages and signals](https://mastra.ai/docs/long-running-agents/signals) to wake an agent or add context. You can also queue input.
|
|
63
63
|
- **Keep working toward a goal**: [Goals](https://mastra.ai/docs/long-running-agents/goals) persist an objective until it's met or the run budget is spent.
|
|
64
|
-
- **Run work outside the request**: Use [schedules](https://mastra.ai/docs/long-running-agents/schedules) and [background tasks](https://mastra.ai/docs/long-running-agents/background-tasks) for recurring jobs
|
|
64
|
+
- **Run work outside the request**: Use [schedules](https://mastra.ai/docs/long-running-agents/schedules) and [background tasks](https://mastra.ai/docs/long-running-agents/background-tasks) for recurring jobs or slow tools. They also handle work that shouldn't block the agent loop.
|
|
65
65
|
|
|
66
66
|
For long-running interactive applications, [AgentController](https://mastra.ai/docs/agent-controller/overview) manages threads, modes, tool approvals, and model switching. It powers [Mastra Code](https://code.mastra.ai/) and lets you build a Claude Code-style experience for your own domain.
|
|
67
67
|
|
|
@@ -545,5 +545,5 @@ For a closer look at workflows, see our [Workflow Guide](https://mastra.ai/guide
|
|
|
545
545
|
- [Control Flow](https://mastra.ai/docs/workflows/control-flow)
|
|
546
546
|
- [Suspend and Resume](https://mastra.ai/docs/workflows/suspend-and-resume)
|
|
547
547
|
- [Error Handling](https://mastra.ai/docs/workflows/error-handling)
|
|
548
|
-
- [Workers](https://mastra.ai/docs/deployment/workers):
|
|
548
|
+
- [Workers](https://mastra.ai/docs/deployment/workers): Run workflow execution in dedicated background processes
|
|
549
549
|
- 📹 [Agentic workflows with Mastra workshop](https://www.youtube.com/watch?v=HGt8pVPpX9g)
|
|
@@ -181,4 +181,5 @@ Manage Inngest schedules from the [Inngest dashboard](https://www.inngest.com/do
|
|
|
181
181
|
|
|
182
182
|
- [Workflow overview](https://mastra.ai/docs/workflows/overview)
|
|
183
183
|
- [Suspend and resume](https://mastra.ai/docs/workflows/suspend-and-resume)
|
|
184
|
+
- [Workers](https://mastra.ai/docs/deployment/workers): The [scheduler worker](https://mastra.ai/docs/deployment/workers) runs cron schedules in a dedicated process
|
|
184
185
|
- [Agent schedules](https://mastra.ai/docs/long-running-agents/schedules): Run an agent rather than a workflow on a cron schedule, and manage both schedule types at runtime through `mastra.schedules`.
|
|
@@ -294,5 +294,7 @@ The pod that handles the approval loads the suspended run from Postgres. It then
|
|
|
294
294
|
|
|
295
295
|
- [PubSub](https://mastra.ai/docs/server/pubsub)
|
|
296
296
|
- [Durable agents](https://mastra.ai/docs/long-running-agents/durable-agents)
|
|
297
|
+
- [Workers](https://mastra.ai/docs/deployment/workers): Split background processing into separate containers on Kubernetes
|
|
298
|
+
- [Worker deployment guide](https://mastra.ai/guides/deployment/mastra-workers): Full Kubernetes manifests for orchestration, scheduler, and background task workers
|
|
297
299
|
- [Mastra server](https://mastra.ai/docs/server/mastra-server)
|
|
298
300
|
- [Deployment overview](https://mastra.ai/docs/deployment/overview)
|