@mastra/mcp-docs-server 1.2.23-alpha.6 → 1.2.23-alpha.9
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/code-mode.md +1 -1
- package/.docs/docs/agents/human-in-the-loop.md +1 -1
- package/.docs/docs/agents/networks.md +1 -1
- package/.docs/docs/agents/processors.md +1 -1
- package/.docs/docs/agents/structured-output.md +1 -1
- package/.docs/docs/auth/fga.md +1 -1
- package/.docs/docs/channels.md +2 -2
- package/.docs/docs/connections/mcp.md +1 -1
- package/.docs/docs/datasets/running-experiments.md +1 -1
- package/.docs/docs/deployment/sandbox.md +2 -2
- package/.docs/docs/deployment/workers.md +2 -2
- package/.docs/docs/evals/custom-scorers.md +1 -1
- package/.docs/docs/evals/multi-turn.md +1 -1
- package/.docs/docs/evals/overview.md +2 -2
- package/.docs/docs/evals/quick-checks.md +1 -1
- package/.docs/docs/evals/vitest-integration.md +136 -0
- package/.docs/docs/guides/context-engineering.md +1 -1
- package/.docs/docs/guides/multi-agent-systems.md +1 -1
- package/.docs/docs/guides/streaming.md +72 -52
- package/.docs/docs/harness/agent-controller.md +1 -1
- package/.docs/docs/harness/background-tasks.md +1 -1
- package/.docs/docs/harness/durable-agents.md +1 -1
- package/.docs/docs/harness/schedules.md +1 -1
- package/.docs/docs/harness/signal-providers.md +1 -1
- package/.docs/docs/harness/signals.md +1 -1
- package/.docs/docs/index.md +1 -1
- package/.docs/docs/mastra-platform/deploy.md +15 -15
- package/.docs/docs/mastra-platform/environments.md +2 -2
- package/.docs/docs/mastra-platform/github.md +2 -2
- package/.docs/docs/mastra-platform/regions.md +1 -1
- package/.docs/docs/mastra-platform/server.md +4 -4
- package/.docs/docs/mastra-platform/studio.md +1 -1
- package/.docs/docs/mastra-platform/trace-intelligence.md +1 -1
- package/.docs/docs/mastra-platform/workspaces.md +1 -1
- package/.docs/docs/memory/message-history.md +3 -3
- package/.docs/docs/memory/observational-memory.md +18 -18
- package/.docs/docs/memory/overview.md +1 -1
- package/.docs/docs/memory/working-memory.md +1 -1
- package/.docs/docs/observability/feedback.md +1 -1
- package/.docs/docs/observability/logging.md +1 -1
- package/.docs/docs/observability/tracing/overview.md +1 -1
- package/.docs/docs/sandbox/lsp.md +1 -1
- package/.docs/docs/sandbox/overview.md +1 -1
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/overview.md +1 -1
- package/.docs/docs/server/pubsub.md +1 -1
- package/.docs/docs/server/request-context.md +2 -2
- package/.docs/docs/server/server-adapters.md +1 -1
- package/.docs/docs/skills.md +1 -1
- package/.docs/docs/studio/deployment.md +1 -1
- package/.docs/docs/studio/editor.md +1 -1
- package/.docs/docs/studio/overview.md +1 -1
- package/.docs/docs/subagents.md +2 -2
- package/.docs/docs/workflows/control-flow.md +1 -1
- package/.docs/docs/workflows/overview.md +1 -1
- package/.docs/docs/workflows/scheduled-workflows.md +1 -1
- package/.docs/docs/workflows/suspend-and-resume.md +2 -2
- package/.docs/integrations/sandboxes/agentcore.md +2 -0
- package/.docs/integrations/sandboxes/apple-container.md +5 -3
- package/.docs/integrations/sandboxes/blaxel.md +2 -0
- package/.docs/integrations/sandboxes/cloudflare-sandbox.md +1 -1
- package/.docs/integrations/sandboxes/daytona.md +2 -0
- package/.docs/integrations/sandboxes/docker.md +3 -1
- package/.docs/integrations/sandboxes/e2b.md +2 -0
- package/.docs/integrations/sandboxes/modal.md +3 -1
- package/.docs/integrations/sandboxes/railway.md +2 -0
- package/.docs/integrations/sandboxes/vercel.md +4 -0
- package/.docs/models/gateways/vercel.md +2 -1
- package/.docs/models/providers/chutes.md +1 -1
- package/.docs/models/providers/cortecs.md +3 -4
- package/.docs/models/providers/edenai.md +2 -1
- package/.docs/models/providers/iteracompute.md +8 -7
- package/.docs/models/providers/kilo.md +4 -4
- package/.docs/models/providers/vancine.md +4 -6
- package/.docs/reference/agent-controller/agent-controller-class.md +2 -2
- package/.docs/reference/agent-controller/session.md +3 -3
- package/.docs/reference/agents/durable-agent.md +1 -1
- package/.docs/reference/agents/getDefaultGenerateOptions.md +1 -1
- package/.docs/reference/agents/listSuspendedRuns.md +2 -2
- package/.docs/reference/ai-sdk/chat-route.md +1 -1
- package/.docs/reference/ai-sdk/network-route.md +1 -1
- package/.docs/reference/ai-sdk/workflow-route.md +1 -1
- package/.docs/reference/browser/browser-viewer.md +1 -1
- package/.docs/reference/cli/mastra.md +4 -4
- package/.docs/reference/core/mastra-class.md +1 -1
- package/.docs/reference/datasets/createExperiment.md +1 -1
- package/.docs/reference/editor/tool-provider.md +1 -1
- package/.docs/reference/editor/versioning.md +1 -1
- package/.docs/reference/evals/multi-turn-judge.md +1 -1
- package/.docs/reference/evals/rubric.md +1 -1
- package/.docs/reference/file-based-agents/schedules.md +2 -2
- package/.docs/reference/file-based-agents/workspace.md +1 -1
- package/.docs/reference/manual-install.md +3 -3
- package/.docs/reference/memory/observational-memory.md +4 -4
- package/.docs/reference/memory/settled.md +1 -1
- package/.docs/reference/migrations/mastra-cloud.md +9 -9
- package/.docs/reference/migrations/upgrade-to-v1/overview.md +1 -1
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +1 -1
- package/.docs/reference/processors/processor-interface.md +1 -1
- package/.docs/reference/processors/regex-filter-processor.md +3 -3
- package/.docs/reference/processors/token-cost-control.md +2 -2
- package/.docs/reference/processors/token-limiter-processor.md +1 -1
- package/.docs/reference/processors/tool-search-processor.md +1 -1
- package/.docs/reference/processors/working-memory-processor.md +1 -1
- package/.docs/reference/pubsub/base.md +2 -2
- package/.docs/reference/pubsub/lease-provider.md +2 -2
- package/.docs/reference/rag/vector-databases.md +33 -33
- package/.docs/reference/server/create-route.md +1 -1
- package/.docs/reference/signals/task-signal-provider.md +1 -1
- package/.docs/reference/storage/composite.md +1 -1
- package/.docs/reference/storage/retention.md +4 -4
- package/.docs/reference/streaming/ChunkType.md +1 -1
- package/.docs/reference/tools/isolated-vm-transport.md +1 -1
- package/.docs/reference/tools/mcp-client.md +2 -2
- package/.docs/reference/vectors/couchbase.md +1 -1
- package/.docs/reference/vectors/mongodb.md +2 -2
- package/.docs/reference/voice/overview.md +1 -1
- package/.docs/reference/workflows/workflow-methods/foreach.md +1 -1
- package/.docs/reference/workspace/platform-sandbox.md +3 -1
- package/.docs/reference/workspace/process-manager.md +1 -1
- package/.docs/reference/workspace/sandbox.md +20 -3
- package/.docs/reference/workspace/workspace-class.md +3 -3
- package/package.json +5 -6
- package/CHANGELOG.md +0 -5936
|
@@ -70,7 +70,7 @@ A durable agent adds three layers on top of a regular agent:
|
|
|
70
70
|
|
|
71
71
|
1. **Workflow execution**: `stream()` serializes the messages and options into a workflow input, then triggers the agentic loop inside a durable workflow. The workflow runs the same loop as `Agent.stream()` but each step can be memoized and replayed.
|
|
72
72
|
|
|
73
|
-
2. **PubSub streaming**:
|
|
73
|
+
2. **PubSub streaming**: The loop publishes chunks to a PubSub topic keyed by the run ID. The caller subscribes to that topic and pipes the chunks into a `ReadableStream`, while the cache replays any chunks missed during a disconnect.
|
|
74
74
|
|
|
75
75
|
3. **Cache layer**: An optional cache (in-memory by default, Redis or another backend in production) stores published events so that a late subscriber can catch up.
|
|
76
76
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
10
10
|
|
|
11
|
-
A schedule runs an agent on a cron cadence. On each fire, Mastra sends a prompt
|
|
11
|
+
A schedule runs an agent on a cron cadence. On each fire, Mastra sends a prompt either as a [signal](https://mastra.ai/docs/harness/signals) into a thread or as a threadless [`agent.generate()`](https://mastra.ai/reference/agents/generate) run. Use schedules for recurring work such as daily summaries and periodic checks, including scheduled nudges into a conversation.
|
|
12
12
|
|
|
13
13
|
Schedules are persisted, so they survive restarts and redeploys. Manage them at runtime through [`mastra.schedules`](https://mastra.ai/reference/schedules/overview), the canonical create, read, update, and delete (CRUD) surface. The same surface also manages [workflow schedules](https://mastra.ai/docs/workflows/scheduled-workflows) (pass `workflowId` instead of `agentId` to schedule a workflow).
|
|
14
14
|
|
|
@@ -130,7 +130,7 @@ Mastra calls `poll()` on the `pollInterval` with all active subscriptions. It sk
|
|
|
130
130
|
|
|
131
131
|
Use polling when the external source doesn't push events to your app. Set `pollInterval` and override `poll(subscriptions)`. Each subscription includes the thread target and the external resource id to inspect.
|
|
132
132
|
|
|
133
|
-
Use webhooks when the external source can call your app. Override `handleWebhook(request)
|
|
133
|
+
Use webhooks when the external source can call your app. Override `handleWebhook(request)` to parse the payload, then find matching subscriptions and call `notify()` for every match.
|
|
134
134
|
|
|
135
135
|
```typescript
|
|
136
136
|
import { SignalProvider } from '@mastra/core/signals'
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
10
10
|
|
|
11
|
-
Signals
|
|
11
|
+
Signals let you interact with an agent through a thread. Instead of starting every interaction with `agent.stream()`, subscribe to a thread and send messages or signals. Mastra wakes an idle agent or delivers input to its running loop; alternatively, it queues the input for the next turn.
|
|
12
12
|
|
|
13
13
|
Use message APIs for user-authored input. Use `sendSignal()` for lower-level system context, such as background task notifications, policy reminders, or processor-generated context.
|
|
14
14
|
|
package/.docs/docs/index.md
CHANGED
|
@@ -239,7 +239,7 @@ Templates: [GitHub PR Code Review](https://mastra.ai/templates/github-pr-code-re
|
|
|
239
239
|
<details>
|
|
240
240
|
**Sales and go-to-market workflows**
|
|
241
241
|
|
|
242
|
-
Turn customer conversations into structured tasks
|
|
242
|
+
Turn customer conversations into structured tasks or generate investment memos. You can also automate outreach sequences.
|
|
243
243
|
|
|
244
244
|
Used by [Kestral](https://mastra.ai/blog/kestral), [Orange Collective](https://mastra.ai/blog/orange-collective-vc-operating-system), [WorkOS](https://mastra.ai/blog/workos-teaching-mastra)
|
|
245
245
|
|
|
@@ -42,17 +42,17 @@ A local `.env` file is optional. Environment variables stored on the platform ar
|
|
|
42
42
|
Preflight needs TURSO_DATABASE_URL for the production environment. Create a managed turso database now and attach it? (Y/n)
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Accept the prompt and provisioning takes a few seconds
|
|
45
|
+
Accept the prompt, and provisioning takes a few seconds. The database's connection variables are injected into your deploys automatically, so you don't need to copy them into an `.env` file. If you decline the prompt or use a non-interactive shell (CI, `--yes`), the CLI falls back to printing the exact command for you to run.
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
48
|
mastra env db create production --kind turso
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
The environment slug (`production` above) matches the environment the CLI would have deployed to
|
|
51
|
+
The environment slug (`production` above) matches the environment the CLI would have deployed to. The `mastra env db create` command requires an environment argument in non-interactive shells when the project has more than one environment.
|
|
52
52
|
|
|
53
|
-
Preflight also catches database URLs that point at your local machine. A `.env` file with `REDIS_URL=redis://localhost:6379` works during development, but the deployed server can't reach your laptop
|
|
53
|
+
Preflight also catches database URLs that point at your local machine. A `.env` file with `REDIS_URL=redis://localhost:6379` works during development, but the deployed server can't reach your laptop. The CLI therefore warns and offers the same managed provisioning. If you decline, the deploy continues with your value as-is; if you accept, the managed database's connection variables take precedence at deploy time while your local `.env` keeps working for development.
|
|
54
54
|
|
|
55
|
-
> **Note:** If preflight reports a hard-coded local path instead (`Build contains a host-local storage URL`), it can't offer the inline fix
|
|
55
|
+
> **Note:** If preflight reports a hard-coded local path instead (`Build contains a host-local storage URL`), it can't offer the inline fix. Guard the path with an environment variable first so the file is only used during local development:
|
|
56
56
|
>
|
|
57
57
|
> ```ts
|
|
58
58
|
> new LibSQLStore({
|
|
@@ -69,7 +69,7 @@ A local `.env` file is optional. Environment variables stored on the platform ar
|
|
|
69
69
|
|
|
70
70
|
> **Warning:** Set up [authentication](https://mastra.ai/docs/auth/overview) before exposing your endpoints publicly.
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
Replacing the running server process during each deploy can interrupt agent turns that are still streaming when the new version goes live because Mastra Platform doesn't currently let you configure or rely on guaranteed extra time before termination. Don't rely on a raised `server.drainTimeout` for turns that may outlast the default drain window. Use [durable agents](https://mastra.ai/docs/harness/durable-agents) with persistent storage and cache when turns must survive a deploy, or handle an interrupted stream in the client. The available strategies are documented in [graceful shutdown and rolling deploys](https://mastra.ai/docs/deployment/mastra-server).
|
|
73
73
|
|
|
74
74
|
The first deploy writes a `.mastra-project.json` file linking your directory to the platform project. Commit it so later deploys, CI runs, and [`mastra env`](https://mastra.ai/docs/mastra-platform/environments) commands target the same project without extra flags.
|
|
75
75
|
|
|
@@ -93,7 +93,7 @@ Pass `--region` when a deploy creates a new environment to control where it runs
|
|
|
93
93
|
mastra deploy --env production --region eu
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
The region is fixed when the environment is created. Databases attached to an environment are placed near that environment's region automatically, and observability data is routed to the ingest region that matches the environment's residency zone. See [Regions](https://mastra.ai/docs/mastra-platform/regions) for the full list of supported regions
|
|
96
|
+
The region is fixed when the environment is created. Databases attached to an environment are placed near that environment's region automatically, and observability data is routed to the ingest region that matches the environment's residency zone. See [Regions](https://mastra.ai/docs/mastra-platform/regions) for the full list of supported regions and database placement, along with observability co-location.
|
|
97
97
|
|
|
98
98
|
## Preflight checks
|
|
99
99
|
|
|
@@ -151,7 +151,7 @@ Projects that depend on packages from a private registry install them during the
|
|
|
151
151
|
//npm.pkg.github.com/:_authToken=${NPM_TOKEN}
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
-
Keep the `${NPM_TOKEN}` reference literal. The package manager resolves it at install time, so the token itself never
|
|
154
|
+
Keep the `${NPM_TOKEN}` reference literal. The package manager resolves it at install time, so the token itself is never written to your repository.
|
|
155
155
|
|
|
156
156
|
3. Deploy as usual:
|
|
157
157
|
|
|
@@ -229,14 +229,14 @@ The deploy log is the source of truth: the legacy pipeline prints a deprecation
|
|
|
229
229
|
Check whether this project is ready for the Mastra Platform environment pipeline.
|
|
230
230
|
|
|
231
231
|
1. Find the installed version of `@mastra/core` (check package.json and the
|
|
232
|
-
lockfile for the version that actually resolved,
|
|
233
|
-
2. If it
|
|
234
|
-
3. If it
|
|
232
|
+
lockfile for the version that actually resolved, rather than only the range).
|
|
233
|
+
2. If it's >= 1.44.0, tell me I'm good. No further action is needed.
|
|
234
|
+
3. If it's < 1.44.0:
|
|
235
235
|
a. Fetch the `@mastra/core` changelog from
|
|
236
236
|
https://github.com/mastra-ai/mastra/blob/main/packages/core/CHANGELOG.md
|
|
237
237
|
and read every entry between my installed version and the latest release.
|
|
238
238
|
b. Scan my project (agents, workflows, tools, memory, storage, deployers,
|
|
239
|
-
telemetry
|
|
239
|
+
telemetry, anywhere `@mastra/core`, `@mastra/*`, or `mastra` is imported)
|
|
240
240
|
and list every Mastra API surface I actually use.
|
|
241
241
|
c. For each used API, cross-reference the changelog and produce a table of:
|
|
242
242
|
API I use → breaking change → severity (breaks build / breaks runtime /
|
|
@@ -248,11 +248,11 @@ The deploy log is the source of truth: the legacy pipeline prints a deprecation
|
|
|
248
248
|
versions, then run typecheck and tests. Report anything still failing.
|
|
249
249
|
4. Search my scripts, package.json, Dockerfiles, and CI config for
|
|
250
250
|
`mastra server deploy` and `mastra studio deploy`. Replace each
|
|
251
|
-
occurrence with `mastra deploy
|
|
251
|
+
occurrence with `mastra deploy`. This is the unified command required
|
|
252
252
|
by the environment pipeline.
|
|
253
253
|
|
|
254
|
-
|
|
255
|
-
variable values
|
|
254
|
+
don't restructure my CI, provision new infra, or change my environment
|
|
255
|
+
variable values. Change only the Mastra usage in my code and the deploy command
|
|
256
256
|
itself.
|
|
257
257
|
```
|
|
258
258
|
|
|
@@ -264,7 +264,7 @@ The deploy log is the source of truth: the legacy pipeline prints a deprecation
|
|
|
264
264
|
+ mastra deploy
|
|
265
265
|
```
|
|
266
266
|
|
|
267
|
-
`mastra deploy` builds once and deploys both the server and the Studio UI shell for the target environment.
|
|
267
|
+
`mastra deploy` builds once and deploys both the server and the Studio UI shell for the target environment. It's supported by every recent `mastra` CLI; otherwise, upgrade with `npm install -g mastra@latest`.
|
|
268
268
|
|
|
269
269
|
3. Deploy once. Your project is auto-adopted onto the environment pipeline and the `production` environment is created on first deploy. See [Environments](https://mastra.ai/docs/mastra-platform/environments) for the full model.
|
|
270
270
|
|
|
@@ -32,7 +32,7 @@ mastra deploy --env staging
|
|
|
32
32
|
mastra env create eu-preview --type preview --region eu
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Each project has a single `production` environment, created by your first deploy. The region is fixed at creation.
|
|
35
|
+
Each project has a single `production` environment, created by your first deploy. The region is fixed at creation. Attached databases are placed near the environment automatically, while observability data goes to the ingest region for the matching residency zone. See [Regions](https://mastra.ai/docs/mastra-platform/regions) for supported regions and database placement, along with observability co-location. The number of environments per project depends on your plan.
|
|
36
36
|
|
|
37
37
|
## List environments
|
|
38
38
|
|
|
@@ -92,7 +92,7 @@ mastra env db create staging --kind turso --name my-project-staging-db
|
|
|
92
92
|
|
|
93
93
|
If you'd rather share one database across every environment, attach it with `--shared` instead: `mastra env db create --kind turso --shared`.
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
Each environment can use one database per provider. An existing shared (`--shared`) database from the same provider creates a variable-name conflict with an environment-scoped database. Export any data you need to keep before running `mastra env db delete`, because this command destroys the shared provider database and its data. See [Hosted databases](https://mastra.ai/docs/mastra-platform/database) for the full scoping model.
|
|
96
96
|
|
|
97
97
|
## Delete an environment
|
|
98
98
|
|
|
@@ -65,7 +65,7 @@ Templates are the fastest way to get started. The platform creates a new reposit
|
|
|
65
65
|
|
|
66
66
|
4. Add any template-specific environment variables (for example, AI provider API keys). The platform seeds `MASTRA_GATEWAY_API_KEY` and `MASTRA_PLATFORM_ACCESS_TOKEN` automatically so that template code that talks to the Gateway works on the first deploy.
|
|
67
67
|
|
|
68
|
-
5. Select **Create project**. The platform creates the repository
|
|
68
|
+
5. Select **Create project**. The platform creates the repository with a `.mastra-project.json` config file, provisions its managed databases, then triggers the initial Studio and Server deploys.
|
|
69
69
|
|
|
70
70
|
The initial deploy waits for managed databases to finish provisioning before it starts, so the template's first build sees the database connection environment variables.
|
|
71
71
|
|
|
@@ -109,7 +109,7 @@ Only one build per deploy target runs at a time. If a new push arrives while a b
|
|
|
109
109
|
|
|
110
110
|
### Manual GitHub deploys
|
|
111
111
|
|
|
112
|
-
You can also trigger a deploy from the dashboard without pushing. Open the project
|
|
112
|
+
You can also trigger a deploy from the dashboard without pushing. Open the project and select **Deploy from GitHub**. Choose the target (Studio, Server, or both) together with a branch, then submit. The platform runs the deploy against the head commit of that branch and records the trigger as a **GitHub Workflow** deploy.
|
|
113
113
|
|
|
114
114
|
## Track deploys
|
|
115
115
|
|
|
@@ -65,7 +65,7 @@ Observability ingest runs in two regions today: **US** (Iowa, `us-central1`) and
|
|
|
65
65
|
| `pdx`, `iad`, `sfo`, `us` shorthand | US (Iowa) |
|
|
66
66
|
| `ams`, `eu` shorthand | EU (Amsterdam) |
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
Railway and database providers offer more regions than observability ingest, so some combinations can't be fully co-located. Environments in the `us` zone always send telemetry to US ingest, while those in the `eu` zone use EU ingest. This routing applies even when the underlying Railway region is a city without a dedicated ingest endpoint. Data residency is preserved at the zone level. Telemetry from an `eu` environment never crosses into the US.
|
|
69
69
|
|
|
70
70
|
## Related
|
|
71
71
|
|
|
@@ -48,7 +48,7 @@ You get a stable API endpoint with environment variable management and custom do
|
|
|
48
48
|
|
|
49
49
|
If you're not already authenticated, the CLI prompts you to log in. It stores your credentials locally and any subsequent CLI commands use these credentials.
|
|
50
50
|
|
|
51
|
-
The command runs `mastra build
|
|
51
|
+
The command runs `mastra build` and uploads its artifact, then builds and deploys a Docker image. On first deploy, the CLI creates a `.mastra-project.json` file linking your local project to the platform. Commit this file so subsequent deploys and CI/CD target the same project.
|
|
52
52
|
|
|
53
53
|
> **Note:** Environment variables from `.env`, `.env.local`, and `.env.production` are included automatically. On the first deploy, these seed the project if no env vars are set yet. After that, manage env vars through the web dashboard. Review and sanitize these files before first deploy to avoid uploading development-only or personal secrets.
|
|
54
54
|
|
|
@@ -60,7 +60,7 @@ You get a stable API endpoint with environment variable management and custom do
|
|
|
60
60
|
|
|
61
61
|
## Deploy lifecycle
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
Each project runs one build at a time as its deploy transitions through **queued → uploading → building → deploying → running** (or **failed**, **cancelled**, **crashed**, or **stopped**). When multiple deploys queue up, the latest proceeds and the rest are cancelled. Builds running longer than 15 minutes are automatically failed. The first deploy provisions infrastructure and seeds environment variables from your local `.env`. Your server URL remains stable across deploys.
|
|
64
64
|
|
|
65
65
|
## Idle behavior
|
|
66
66
|
|
|
@@ -146,9 +146,9 @@ Automate deployments from GitHub Actions, GitLab CI, or any CI provider. After y
|
|
|
146
146
|
mastra auth tokens create ci-deploy
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
The CLI prints the token once. Copy it immediately
|
|
149
|
+
The CLI prints the token once. Copy it immediately because it can't be retrieved again.
|
|
150
150
|
|
|
151
|
-
2. Add the token as a secret in your CI provider. In GitHub Actions, go to **Settings → Secrets and variables → Actions** and create
|
|
151
|
+
2. Add the token as a secret in your CI provider. In GitHub Actions, go to **Settings → Secrets and variables → Actions** and create the `MASTRA_API_TOKEN` secret.
|
|
152
152
|
|
|
153
153
|
3. Ensure your `.mastra-project.json` file is committed to the repository. The CLI reads the `organizationId` and `projectId` from this file to target the correct project during CI deploys.
|
|
154
154
|
|
|
@@ -70,7 +70,7 @@ To run the same codebase across `production` and `staging`, use [`mastra deploy
|
|
|
70
70
|
|
|
71
71
|
## Create a new project non-interactively
|
|
72
72
|
|
|
73
|
-
`mastra deploy` can create a project
|
|
73
|
+
On its first run, `mastra deploy` can create a project. When `--project <name>` doesn't match an existing project, the CLI treats the value as a new project name and creates it after confirmation. Add `--yes` to make this flow fully scriptable:
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
76
|
mastra deploy --project "my-new-project" --yes
|
|
@@ -74,7 +74,7 @@ A theme can persist, disappear, split, merge, or return across snapshots. Treat
|
|
|
74
74
|
|
|
75
75
|
## Use the Trace Intelligence page
|
|
76
76
|
|
|
77
|
-
1. Use the **Agent** selector to switch between agents
|
|
77
|
+
1. Use the **Agent** selector to switch between agents after their first themes are ready and analysis becomes available.
|
|
78
78
|
2. Select a theme in the flow to open its details and filter every column to traces containing that theme.
|
|
79
79
|
3. The details panel shows the theme's description, its share of the snapshot, paged example summaries, and a trend of its trace count over time.
|
|
80
80
|
4. Select **Clear filter** to restore the complete flow.
|
|
@@ -85,7 +85,7 @@ export const mastra = new Mastra({
|
|
|
85
85
|
- `stop()` tears down the remote sandbox while preserving its recovery checkpoint when it has one.
|
|
86
86
|
- `destroy()` also releases the recovery checkpoint associated with a caller-supplied recovery `id`.
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
A statically configured `PlatformSandbox` is shared across every request and agent using that configuration rather than creating separate sandboxes for requests or memory threads. `PlatformFilesystem` is also a separate provider: configuring both providers doesn't mount the environment bucket inside the sandbox.
|
|
89
89
|
|
|
90
90
|
When your agent needs another isolated environment, for example a per-task sandbox, a per-user tenant, or a background job that shouldn't touch shared shell state, construct another `PlatformSandbox`:
|
|
91
91
|
|
|
@@ -119,8 +119,8 @@ await agent.stream('Hello', {
|
|
|
119
119
|
|
|
120
120
|
You can use this history in two ways:
|
|
121
121
|
|
|
122
|
-
- **Automatic inclusion**: Mastra automatically
|
|
123
|
-
- [**Manual querying**](#querying): For more control,
|
|
122
|
+
- **Automatic inclusion**: Mastra automatically includes recent messages in the context window. The default of 10 messages keeps agents grounded in the conversation. Adjust it with `lastMessages` when needed.
|
|
123
|
+
- [**Manual querying**](#querying): For more control, query threads and messages directly with `recall()`. Use the results to choose which memories enter the context window or to render conversation history in your UI.
|
|
124
124
|
|
|
125
125
|
> **Tip:** When memory is enabled, [Studio](https://mastra.ai/docs/studio/overview) uses message history to display past conversations in the chat sidebar.
|
|
126
126
|
|
|
@@ -230,7 +230,7 @@ const thread = await memory.getThreadById({ threadId: 'thread-123' })
|
|
|
230
230
|
|
|
231
231
|
### Messages
|
|
232
232
|
|
|
233
|
-
Once you have a thread, use [`recall()`](https://mastra.ai/reference/memory/recall) to retrieve its messages. It supports pagination
|
|
233
|
+
Once you have a thread, use [`recall()`](https://mastra.ai/reference/memory/recall) to retrieve its messages. It supports pagination and [semantic search](https://mastra.ai/docs/memory/semantic-recall), with optional date filtering.
|
|
234
234
|
|
|
235
235
|
Basic recall returns all messages from a thread:
|
|
236
236
|
|
|
@@ -31,7 +31,7 @@ export const agent = new Agent({
|
|
|
31
31
|
|
|
32
32
|
**For AI agents:** Using Observational Memory requires a storage provider! You either need to set it on the Mastra instance at `src/mastra/index.ts` or pass it to the Agent constructor.
|
|
33
33
|
|
|
34
|
-
The following script creates a local LibSQL database
|
|
34
|
+
The following script creates a local LibSQL database and enables Observational Memory before using one resource and thread across two agent calls:
|
|
35
35
|
|
|
36
36
|
```typescript
|
|
37
37
|
import { Agent } from '@mastra/core/agent'
|
|
@@ -214,11 +214,11 @@ When message history tokens exceed a threshold (default: 30,000), the Observer c
|
|
|
214
214
|
|
|
215
215
|
OM uses fast local token estimation for this thresholding work. Text is estimated with `tokenx`, while image parts use provider-aware heuristics so multimodal conversations still trigger observation at the right time. The same applies to image-like `file` parts when a transport normalizes an uploaded image as a file instead of an image part. For example, OpenAI image detail settings can materially change when OM decides to observe.
|
|
216
216
|
|
|
217
|
-
The Observer can also see attachments in the history it reviews. OM keeps
|
|
217
|
+
The Observer can also see attachments in the history it reviews. For readability, OM keeps placeholders such as `[Image #1: reference-board.png]` or `[File #1: floorplan.pdf]` in the transcript while forwarding the actual attachments beside the text. When possible, image-like `file` parts become image inputs for the Observer. Other attachments remain file parts and use normalized token counting. This applies to both normal thread observation and batched resource-scope observation.
|
|
218
218
|
|
|
219
219
|
### Extractors
|
|
220
220
|
|
|
221
|
-
Use extractors when you want OM to persist specific values alongside observations. Built-in values
|
|
221
|
+
Use extractors when you want OM to persist specific values alongside observations. Built-in values use the same extraction pipeline as custom values. They include **current task** and **suggested response**, along with **thread title**.
|
|
222
222
|
|
|
223
223
|
The following example extracts a compact user profile from observations:
|
|
224
224
|
|
|
@@ -380,7 +380,7 @@ new Agent({
|
|
|
380
380
|
})
|
|
381
381
|
```
|
|
382
382
|
|
|
383
|
-
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'`
|
|
383
|
+
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'` so Mastra consults the provider capabilities registry. It forwards attachments when the Observer model supports multimodal input and drops them otherwise. If capability data is unavailable for the model, the setting falls back to `true`.
|
|
384
384
|
|
|
385
385
|
```md
|
|
386
386
|
Date: 2026-01-15
|
|
@@ -426,7 +426,7 @@ With [`shareTokenBudget`](https://mastra.ai/reference/memory/observational-memor
|
|
|
426
426
|
|
|
427
427
|
### Retrieval mode
|
|
428
428
|
|
|
429
|
-
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.
|
|
429
|
+
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. The agent can call a `recall` tool to recover source details compressed by the summary, including exact wording and tool output as well as chronology.
|
|
430
430
|
|
|
431
431
|
#### Browsing only
|
|
432
432
|
|
|
@@ -716,23 +716,23 @@ When message tokens reach the `messageTokens` threshold, buffered chunks activat
|
|
|
716
716
|
|
|
717
717
|
Buffered observations also include continuation hints, a suggested next response and the current task, so the main agent maintains conversational continuity after activation shrinks the context window.
|
|
718
718
|
|
|
719
|
-
|
|
719
|
+
When message production outpaces the Observer, the `blockAfter` safety threshold allows activation to overshoot the retention target instead of using fewer chunks. Activation still uses no more chunks than needed to reach the target, and the default settings remain unaffected. A synchronous observation runs when the `messageTokens` threshold is reached and buffered activation didn't happen. Buffered activation usually preserves a minimum remaining context (the smaller of \~1k tokens or the configured retention floor), but a single buffered chunk that covers the whole pending window still activates and can leave less.
|
|
720
720
|
|
|
721
721
|
Reflection works similarly, the Reflector runs in the background when observations reach a fraction of the reflection threshold.
|
|
722
722
|
|
|
723
723
|
### Settings
|
|
724
724
|
|
|
725
|
-
| Setting | Default | What it controls
|
|
726
|
-
| ------------------------------------- | ------- |
|
|
727
|
-
| `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`).
|
|
728
|
-
| `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.
|
|
729
|
-
| `observation.blockAfter` | `1.2` | Safety net if buffering can't keep up. Values from 1 up to (but not including) 100 multiply `messageTokens
|
|
730
|
-
| `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.
|
|
731
|
-
| `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.
|
|
732
|
-
| `reflection.bufferActivation` | `0.5` | When to start background reflection. `0.5` means reflection begins when observations reach 50% of the `observationTokens` threshold.
|
|
733
|
-
| `reflection.activateAfterIdle` | none | Opts buffered reflections into idle activation. Reflections don't inherit top-level `activateAfterIdle`.
|
|
734
|
-
| `reflection.activateOnProviderChange` | `false` | Opts buffered reflections into provider-change activation. Reflections don't inherit top-level `activateOnProviderChange`.
|
|
735
|
-
| `reflection.blockAfter` | `1.2` | Safety threshold for reflection. Same value format as observation (absolute values must be greater than `observationTokens`), but above it reflection runs synchronously when no buffered reflection is ready to activate.
|
|
725
|
+
| Setting | Default | What it controls |
|
|
726
|
+
| ------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
727
|
+
| `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`). |
|
|
728
|
+
| `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. |
|
|
729
|
+
| `observation.blockAfter` | `1.2` | Safety net if buffering can't keep up. Values from 1 up to (but not including) 100 multiply `messageTokens`. For example, `1.2` creates a threshold of 36k tokens (1.2 × 30k), above which activation may overshoot the retention target rather than use fewer chunks. Values of 100 or more are absolute token counts (e.g. `50_000`) and must be greater than `messageTokens`. |
|
|
730
|
+
| `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. |
|
|
731
|
+
| `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. |
|
|
732
|
+
| `reflection.bufferActivation` | `0.5` | When to start background reflection. `0.5` means reflection begins when observations reach 50% of the `observationTokens` threshold. |
|
|
733
|
+
| `reflection.activateAfterIdle` | none | Opts buffered reflections into idle activation. Reflections don't inherit top-level `activateAfterIdle`. |
|
|
734
|
+
| `reflection.activateOnProviderChange` | `false` | Opts buffered reflections into provider-change activation. Reflections don't inherit top-level `activateOnProviderChange`. |
|
|
735
|
+
| `reflection.blockAfter` | `1.2` | Safety threshold for reflection. Same value format as observation (absolute values must be greater than `observationTokens`), but above it reflection runs synchronously when no buffered reflection is ready to activate. |
|
|
736
736
|
|
|
737
737
|
If you're relying on prompt caching, set `activateAfterIdle` to `"auto"` or to a specific cache TTL. That way, once a thread has been idle long enough for the cache to expire, the next request can activate buffered observations first and send a smaller compressed context window.
|
|
738
738
|
|
|
@@ -784,7 +784,7 @@ const memory = new Memory({
|
|
|
784
784
|
|
|
785
785
|
Setting `bufferTokens: false` disables both observation and reflection async buffering. See [async buffering configuration](https://mastra.ai/reference/memory/observational-memory) for the full API.
|
|
786
786
|
|
|
787
|
-
> **Note:**
|
|
787
|
+
> **Note:** Resource scope automatically disables async buffering.
|
|
788
788
|
|
|
789
789
|
## Observer Context Optimization
|
|
790
790
|
|
|
@@ -116,7 +116,7 @@ Use memory when your agent needs to maintain multi-turn conversations that refer
|
|
|
116
116
|
|
|
117
117
|
Visit [Memory Class](https://mastra.ai/reference/memory/memory-class) for a full list of configuration options.
|
|
118
118
|
|
|
119
|
-
5. Call your agent, for example in [Studio](https://mastra.ai/docs/studio/overview). Inside Studio, start a new chat with your agent and take a look at the right sidebar. It'll now display
|
|
119
|
+
5. Call your agent, for example in [Studio](https://mastra.ai/docs/studio/overview). Inside Studio, start a new chat with your agent and take a look at the right sidebar. It'll now display memory details.
|
|
120
120
|
|
|
121
121
|
## Message history
|
|
122
122
|
|
|
@@ -275,7 +275,7 @@ Schema-based working memory uses **merge semantics**, meaning the agent only nee
|
|
|
275
275
|
## Choosing between template and schema
|
|
276
276
|
|
|
277
277
|
- Use a **template** (Markdown) if you want the agent to maintain memory as a free-form text block, such as a user profile or scratchpad. Templates use **replace semantics**: the agent must provide the complete memory content on each update.
|
|
278
|
-
- Use a **schema**
|
|
278
|
+
- Use a **schema** for structured, type-safe JSON data that supports validation and programmatic access. The `workingMemory.schema` field accepts any `PublicSchema`-compatible schema, such as Zod v3 or v4. JSON Schema and already-standard schemas are also supported. **Merge semantics** preserve existing fields when the agent provides only the fields to update.
|
|
279
279
|
- Only one mode can be active at a time: setting both `template` and `schema` isn't supported.
|
|
280
280
|
|
|
281
281
|
## Example: Multi-step retention
|
|
@@ -155,7 +155,7 @@ The local runtime exposes the list route at `/api/observability/feedback` and an
|
|
|
155
155
|
|
|
156
156
|
[`MastraPlatformExporter`](https://mastra.ai/reference/observability/tracing/exporters/mastra-platform-exporter) forwards emitted feedback events to Mastra Platform automatically because the hosted query API doesn't provide a creation route.
|
|
157
157
|
|
|
158
|
-
If your application adds feedback after an agent or workflow response using only its `traceId`, configure `MastraStorageExporter` alongside `MastraPlatformExporter`. The storage exporter keeps the trace available for `addFeedback()` to rehydrate,
|
|
158
|
+
If your application adds feedback after an agent or workflow response using only its `traceId`, configure `MastraStorageExporter` alongside `MastraPlatformExporter`. The storage exporter keeps the trace available for `addFeedback()` to rehydrate, while the Platform exporter forwards the resulting feedback event without adding the trace to the application's local storage.
|
|
159
159
|
|
|
160
160
|
See [Observability on Mastra Platform](https://mastra.ai/docs/mastra-platform/observability) for the combined exporter configuration.
|
|
161
161
|
|
|
@@ -78,7 +78,7 @@ export const mastra = new Mastra({
|
|
|
78
78
|
|
|
79
79
|
### Custom loggers
|
|
80
80
|
|
|
81
|
-
Custom `IMastraLogger` implementations keep working: Mastra
|
|
81
|
+
Custom `IMastraLogger` implementations keep working: Mastra uses a deprecated dual-write fallback that forwards log calls to observability without adding `trace_id` or `span_id` to the logger's native output. To get trace-correlated output, implement the `__attachObservability()` adapter hook from `@mastra/core/logger`:
|
|
82
82
|
|
|
83
83
|
```typescript
|
|
84
84
|
import { MastraLogger, buildLogRecordData } from '@mastra/core/logger'
|
|
@@ -144,7 +144,7 @@ export const mastra = new Mastra({
|
|
|
144
144
|
})
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
If `environment` isn't set, Mastra falls back to `process.env.NODE_ENV`. If
|
|
147
|
+
If `environment` isn't set, runs started through `mastra dev` resolve to `development` (even though the dev server itself runs with `NODE_ENV=production`); otherwise Mastra falls back to `process.env.NODE_ENV`. If none of these are set, the field is left undefined rather than guessed.
|
|
148
148
|
|
|
149
149
|
Per-call `tracingOptions.metadata.environment` always takes precedence, so individual calls can override the value when needed.
|
|
150
150
|
|
|
@@ -149,7 +149,7 @@ lsp: {
|
|
|
149
149
|
},
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
`binaryOverrides` maps a built-in server ID to its full startup command. `searchPaths` adds package roots whose `node_modules` may contain
|
|
152
|
+
`binaryOverrides` maps a built-in server ID to its full startup command. `searchPaths` adds package roots whose `node_modules` may contain required modules or binaries. As a last-resort fallback, you can set a `packageRunner` such as `pnpm dlx`. Package-runner fallback is disabled by default because it may install software or hang in some project layouts.
|
|
153
153
|
|
|
154
154
|
`diagnosticTimeout` controls how long the direct `getDiagnostics()` and `getDiagnosticsMulti()` APIs wait for diagnostics. The agent inspection tool currently waits up to five seconds.
|
|
155
155
|
|
|
@@ -264,7 +264,7 @@ The example mounts the filesystem inside the resolver because static `mounts` ca
|
|
|
264
264
|
|
|
265
265
|
With a static sandbox, Mastra knows which capabilities the backend supports and only gives the agent the corresponding tools. Application code should also check that an optional capability is available before using it.
|
|
266
266
|
|
|
267
|
-
|
|
267
|
+
Because a [resolver-backed sandbox](#sandboxes-per-user-or-thread) isn't known until request time, Mastra initially exposes every sandbox tool. Calling one unsupported by the resolved backend fails with `SandboxFeatureNotSupportedError`.
|
|
268
268
|
|
|
269
269
|
## Background processes
|
|
270
270
|
|
|
@@ -305,7 +305,7 @@ export const colorAgent = new Agent({
|
|
|
305
305
|
|
|
306
306
|
## Use MastraClient on the server
|
|
307
307
|
|
|
308
|
-
|
|
308
|
+
Server-side API routes and serverless functions, including actions, can also use `MastraClient`. The usage is unchanged, although you may need to recreate the response for your client:
|
|
309
309
|
|
|
310
310
|
```typescript
|
|
311
311
|
export async function action() {
|
|
@@ -66,7 +66,7 @@ Mastra exposes OpenAI-compatible Responses and Conversations routes that let you
|
|
|
66
66
|
|
|
67
67
|
These APIs are currently experimental.
|
|
68
68
|
|
|
69
|
-
Use `agent_id` to select the Mastra agent that should handle the request. Initial requests target an agent directly
|
|
69
|
+
Use `agent_id` to select the Mastra agent that should handle the request. Initial requests target an agent directly. Stored follow-up turns can continue through `previous_response_id`. Pass `model` to override the configured model for one request, or omit it to use the agent's existing model.
|
|
70
70
|
|
|
71
71
|
The Responses routes support streaming, function calling (tools), stored continuations with `previous_response_id`, conversation threads through `conversation_id`, provider-specific passthrough with `providerOptions`, and JSON output through `text.format`.
|
|
72
72
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Mastra uses a publish/subscribe (pub/sub) system as its internal event bus. Components publish events to topics, and other components subscribe to those topics to react. The backend you configure decides how far those events travel: within one process or across processes on one host, or alternatively across separate instances.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Set the backend once on the `Mastra` instance for use throughout the system. The default is an in-process backend that requires no setup.
|
|
10
10
|
|
|
11
11
|
## How Mastra uses PubSub
|
|
12
12
|
|
|
@@ -152,7 +152,7 @@ You can also use `requestContext` with other options like `agents`, `workflows`,
|
|
|
152
152
|
|
|
153
153
|
### Dynamic instructions
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
Provide agent instructions through an async function to resolve prompts at runtime. Together with `requestContext`, this supports patterns like:
|
|
156
156
|
|
|
157
157
|
- **Personalization**: Tailor instructions based on user attributes, preferences, or tier
|
|
158
158
|
- **Localization**: Adjust tone, language, or behavior based on locale
|
|
@@ -270,7 +270,7 @@ auth: {
|
|
|
270
270
|
}
|
|
271
271
|
```
|
|
272
272
|
|
|
273
|
-
When the resource ID is derived this way, clients can omit `memory.resource` from agent generate and stream request bodies
|
|
273
|
+
When the resource ID is derived this way, clients can omit `memory.resource` from agent generate and stream request bodies. The server-derived value is used instead and always takes precedence over a client-provided value. If a request uses memory and neither the body nor the request context provides a resource ID, the server responds with a 400 error.
|
|
274
274
|
|
|
275
275
|
You can also set these keys manually in middleware:
|
|
276
276
|
|
|
@@ -337,7 +337,7 @@ bun add @mastra/nestjs@latest
|
|
|
337
337
|
|
|
338
338
|
## Configuration
|
|
339
339
|
|
|
340
|
-
Initialize your app as usual, then create a `MastraServer` by passing in the `app` and your main `mastra` instance from `src/mastra/index.ts`. Calling `init()` automatically registers Mastra middleware and all available endpoints.
|
|
340
|
+
Initialize your app as usual, then create a `MastraServer` by passing in the `app` and your main `mastra` instance from `src/mastra/index.ts`. Calling `init()` automatically registers Mastra middleware and all available endpoints. Continue adding your own routes either before or after `init()`. They run alongside Mastra’s endpoints.
|
|
341
341
|
|
|
342
342
|
**Elysia**:
|
|
343
343
|
|
package/.docs/docs/skills.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Skills are reusable instructions that teach agents how to perform specific tasks. They follow the [Agent Skills specification](https://agentskills.io).
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Attach skills directly through an agent's `skills` config, or configure them on a [workspace](https://mastra.ai/docs/sandbox/skills). Agent-level skills belong to one agent and can be defined in code without a workspace, while workspace skills are discovered from the filesystem and shared by every agent using that workspace. This page explains how to define and load agent-level skills with per-request resolution.
|
|
10
10
|
|
|
11
11
|
## When to use agent-level skills
|
|
12
12
|
|
|
@@ -51,7 +51,7 @@ Run the `mastra studio` command:
|
|
|
51
51
|
mastra studio
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
Open [localhost:3000](http://localhost:3000) in your browser to see the Studio UI. By default, it
|
|
54
|
+
Open [localhost:3000](http://localhost:3000) in your browser to see the Studio UI. By default, it connects to a Mastra server at `http://localhost:4111`; when no server is available, the UI displays a form for entering your Mastra instance URL and API prefix.
|
|
55
55
|
|
|
56
56
|
The command uses Node's built-in `http` module and [`serve-handler`](https://www.npmjs.com/package/serve-handler) to serve the static files.
|
|
57
57
|
|
|
@@ -77,7 +77,7 @@ An instruction block can include values from the current request. For example, `
|
|
|
77
77
|
|
|
78
78
|
### Prompt blocks
|
|
79
79
|
|
|
80
|
-
A prompt block is a saved piece of instruction text that can be used by more than one agent. Create one under **Prompts
|
|
80
|
+
A prompt block is a saved piece of instruction text that can be used by more than one agent. Create and publish one under **Prompts**. Then open an agent's **Instructions** section and select **Add block**.
|
|
81
81
|
|
|
82
82
|
For example, agents for support, returns, and order status may all need the same refund policy. Save the policy as a prompt block and add it to each agent. When the policy changes, update and publish the block once instead of editing three agents.
|
|
83
83
|
|
|
@@ -41,7 +41,7 @@ Once the server is running, you can:
|
|
|
41
41
|
- Open the Studio UI at [`localhost:4111`](http://localhost:4111/) to interact with your agents, workflows, and tools.
|
|
42
42
|
- Visit [`localhost:4111/swagger-ui`](http://localhost:4111/swagger-ui) to discover and interact with the underlying REST API.
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Studio lets you edit your [agents](https://mastra.ai/docs/agents/overview), [workflows](https://mastra.ai/docs/workflows/overview), and other parts of your Mastra application in real time.
|
|
45
45
|
|
|
46
46
|
## Deploy Studio
|
|
47
47
|
|