@mastra/mcp-docs-server 1.3.5-alpha.1 → 1.3.5-alpha.11
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 +0 -2
- package/.docs/docs/channels.md +5 -1
- package/.docs/docs/develop.md +1 -3
- package/.docs/docs/guides/context-engineering.md +0 -2
- package/.docs/docs/harness/agent-controller.md +0 -2
- package/.docs/docs/harness/durable-agents.md +2 -0
- package/.docs/docs/harness/goals.md +1 -3
- package/.docs/docs/harness/schedules.md +0 -2
- package/.docs/docs/harness/signal-providers.md +1 -3
- package/.docs/docs/harness/signals.md +15 -3
- package/.docs/docs/memory/observational-memory.md +1 -1
- package/.docs/docs/memory/semantic-recall.md +35 -1
- package/.docs/docs/storage.md +1 -0
- package/.docs/docs/workflows/error-handling.md +2 -0
- package/.docs/docs/workflows/scheduled-workflows.md +2 -2
- package/.docs/integrations/databases/clickhouse-managed-postgres.md +82 -0
- package/.docs/integrations.md +1 -0
- package/.docs/models/environment-variables.md +1 -0
- package/.docs/models/gateways/merge-gateway.md +3 -1
- package/.docs/models/gateways/neon.md +2 -1
- package/.docs/models/gateways/netlify.md +3 -1
- package/.docs/models/gateways/openrouter.md +2 -1
- package/.docs/models/gateways/vercel.md +1 -1
- package/.docs/models/index.md +2 -1
- package/.docs/models/providers/aiand.md +17 -15
- package/.docs/models/providers/blueclaw.md +8 -9
- package/.docs/models/providers/coralbricks.md +6 -4
- package/.docs/models/providers/cortecs.md +5 -11
- package/.docs/models/providers/crossmodel.md +2 -1
- package/.docs/models/providers/deepinfra.md +57 -60
- package/.docs/models/providers/deepseek.md +1 -1
- package/.docs/models/providers/edenai.md +5 -3
- package/.docs/models/providers/engy.md +84 -0
- package/.docs/models/providers/kilo.md +17 -16
- package/.docs/models/providers/llmgateway-providers.md +12 -3
- package/.docs/models/providers/llmgateway.md +2 -2
- package/.docs/models/providers/nano-gpt.md +7 -5
- package/.docs/models/providers/opencode.md +2 -1
- package/.docs/models/providers/privatemode-ai.md +5 -5
- package/.docs/models/providers/requesty.md +2 -1
- package/.docs/models/providers/subconscious.md +8 -8
- package/.docs/models/providers/synthetic.md +2 -1
- package/.docs/models/providers/togetherai.md +21 -28
- package/.docs/models/providers/umans-ai-coding-plan.md +2 -1
- package/.docs/models/providers/umans-ai.md +2 -1
- package/.docs/models/providers/xai.md +3 -2
- package/.docs/models/providers.md +1 -0
- package/.docs/reference/agent-controller/agent-controller-class.md +2 -2
- package/.docs/reference/agent-controller/session.md +8 -2
- package/.docs/reference/agents/channels.md +2 -1
- package/.docs/reference/agents/durable-agent.md +12 -7
- package/.docs/reference/client-js/agents.md +1 -1
- package/.docs/reference/client-js/observability.md +28 -0
- package/.docs/reference/code-sdk/acp-server.md +19 -2
- package/.docs/reference/code-sdk/mount-agent-controller.md +0 -2
- package/.docs/reference/configuration.md +1 -1
- package/.docs/reference/editor/mastra-editor.md +28 -0
- package/.docs/reference/file-based-agents/config.md +0 -2
- package/.docs/reference/file-based-agents/instructions.md +0 -2
- package/.docs/reference/file-based-agents/logger.md +0 -2
- package/.docs/reference/file-based-agents/memory.md +0 -2
- package/.docs/reference/file-based-agents/observability.md +0 -2
- package/.docs/reference/file-based-agents/processors.md +0 -2
- package/.docs/reference/file-based-agents/schedules.md +2 -4
- package/.docs/reference/file-based-agents/scorers.md +0 -2
- package/.docs/reference/file-based-agents/server.md +0 -2
- package/.docs/reference/file-based-agents/skills.md +0 -2
- package/.docs/reference/file-based-agents/storage.md +0 -2
- package/.docs/reference/file-based-agents/studio.md +0 -2
- package/.docs/reference/file-based-agents/subagents.md +0 -2
- package/.docs/reference/file-based-agents/tools.md +0 -2
- package/.docs/reference/file-based-agents/workflows.md +0 -2
- package/.docs/reference/file-based-agents/workspace.md +0 -2
- package/.docs/reference/memory/observational-memory.md +2 -2
- package/.docs/reference/observability/tracing/interfaces.md +62 -2
- package/.docs/reference/observability/tracing/trace-query.md +113 -2
- package/.docs/reference/schedules/overview.md +3 -5
- package/.docs/reference/server/elysia-adapter.md +18 -0
- package/.docs/reference/signals/create-notification-inbox-tool.md +0 -2
- package/.docs/reference/signals/signal-provider.md +1 -3
- package/.docs/reference/signals/task-signal-provider.md +1 -1
- package/.docs/reference/signals/webhook-signal-provider.md +1 -3
- package/.docs/reference/streaming/ChunkType.md +2 -0
- package/.docs/reference/tools/create-code-mode.md +0 -2
- package/.docs/reference/tools/mcp-client.md +17 -0
- package/package.json +5 -5
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# NanoGPT
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 602 NanoGPT models through Mastra's model router. Authentication is handled automatically using the `NANO_GPT_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [NanoGPT documentation](https://docs.nano-gpt.com).
|
|
10
10
|
|
|
@@ -114,7 +114,7 @@ for await (const chunk of stream) {
|
|
|
114
114
|
| `nano-gpt/cohere/command-r-plus-08-2024` | 128K | | | | | | $3 | $14 |
|
|
115
115
|
| `nano-gpt/command-a-reasoning-08-2025` | 256K | | | | | | $3 | $10 |
|
|
116
116
|
| `nano-gpt/deepcogito/cogito-v1-preview-qwen-32B` | 128K | | | | | | $2 | $2 |
|
|
117
|
-
| `nano-gpt/deepseek-ai/DeepSeek-R1-0528` | 164K | | | | | | $0.
|
|
117
|
+
| `nano-gpt/deepseek-ai/DeepSeek-R1-0528` | 164K | | | | | | $0.50 | $2 |
|
|
118
118
|
| `nano-gpt/deepseek-ai/DeepSeek-V3.1` | 128K | | | | | | $0.20 | $0.70 |
|
|
119
119
|
| `nano-gpt/deepseek-ai/DeepSeek-V3.1-Terminus` | 128K | | | | | | $0.25 | $0.70 |
|
|
120
120
|
| `nano-gpt/deepseek-ai/DeepSeek-V3.1-Terminus:thinking` | 128K | | | | | | $0.25 | $0.70 |
|
|
@@ -265,7 +265,6 @@ for await (const chunk of stream) {
|
|
|
265
265
|
| `nano-gpt/inference-net/schematron-v2-turbo` | 128K | | | | | | $0.03 | $0.15 |
|
|
266
266
|
| `nano-gpt/inflatebot/MN-12B-Mag-Mell-R1` | 16K | | | | | | $0.49 | $0.49 |
|
|
267
267
|
| `nano-gpt/kimi-k2-instruct-fast` | 131K | | | | | | $0.40 | $2 |
|
|
268
|
-
| `nano-gpt/kitani/clover-1-150b` | 200K | | | | | | $0.15 | $0.80 |
|
|
269
268
|
| `nano-gpt/LatitudeGames/Wayfarer-Large-70B-Llama-3.3` | 33K | | | | | | $0.70 | $0.70 |
|
|
270
269
|
| `nano-gpt/lightonai/LightOnOCR-2-1B` | 33K | | | | | | $0.18 | $0.35 |
|
|
271
270
|
| `nano-gpt/liquid/lfm-2.5-2.6b` | 128K | | | | | | $0.10 | $0.20 |
|
|
@@ -504,6 +503,7 @@ for await (const chunk of stream) {
|
|
|
504
503
|
| `nano-gpt/sakana/fugu-max` | 1.0M | | | | | | $2 | $6 |
|
|
505
504
|
| `nano-gpt/sakana/fugu-ultra` | 1.0M | | | | | | $5 | $30 |
|
|
506
505
|
| `nano-gpt/sakana/fugu-ultra-v1.1` | 1.0M | | | | | | $5 | $30 |
|
|
506
|
+
| `nano-gpt/sakana/sakana-namazu` | 262K | | | | | | $0.95 | $4 |
|
|
507
507
|
| `nano-gpt/Salesforce/Llama-xLAM-2-70b-fc-r` | 128K | | | | | | $3 | $3 |
|
|
508
508
|
| `nano-gpt/Sao10K/L3-8B-Stheno-v3.2` | 16K | | | | | | $0.20 | $0.20 |
|
|
509
509
|
| `nano-gpt/Sao10K/L3.1-70B-Euryale-v2.2` | 20K | | | | | | $0.31 | $0.36 |
|
|
@@ -614,12 +614,12 @@ for await (const chunk of stream) {
|
|
|
614
614
|
| `nano-gpt/z-ai/glm-4.6:thinking` | 200K | | | | | | $0.35 | $1 |
|
|
615
615
|
| `nano-gpt/z-ai/glm-4.6v` | 128K | | | | | | $0.30 | $0.90 |
|
|
616
616
|
| `nano-gpt/z-ai/glm-4.6v-original` | 128K | | | | | | $0.60 | $0.90 |
|
|
617
|
-
| `nano-gpt/z-ai/glm-4.7` | 200K | | | | | | $0.
|
|
617
|
+
| `nano-gpt/z-ai/glm-4.7` | 200K | | | | | | $0.40 | $2 |
|
|
618
618
|
| `nano-gpt/z-ai/glm-4.7-flash` | 200K | | | | | | $0.07 | $0.40 |
|
|
619
619
|
| `nano-gpt/z-ai/glm-4.7-flash:thinking` | 200K | | | | | | $0.07 | $0.40 |
|
|
620
620
|
| `nano-gpt/z-ai/glm-4.7-original` | 200K | | | | | | $0.60 | $2 |
|
|
621
621
|
| `nano-gpt/z-ai/glm-4.7-original:thinking` | 200K | | | | | | $0.60 | $2 |
|
|
622
|
-
| `nano-gpt/z-ai/glm-4.7:thinking` | 200K | | | | | | $0.
|
|
622
|
+
| `nano-gpt/z-ai/glm-4.7:thinking` | 200K | | | | | | $0.40 | $2 |
|
|
623
623
|
| `nano-gpt/z-ai/glm-5` | 200K | | | | | | $0.50 | $3 |
|
|
624
624
|
| `nano-gpt/z-ai/glm-5-original` | 200K | | | | | | $1 | $3 |
|
|
625
625
|
| `nano-gpt/z-ai/glm-5-original:thinking` | 200K | | | | | | $1 | $3 |
|
|
@@ -631,6 +631,8 @@ for await (const chunk of stream) {
|
|
|
631
631
|
| `nano-gpt/z-ai/glm-5.2:thinking` | 1.0M | | | | | | $0.42 | $1 |
|
|
632
632
|
| `nano-gpt/z-ai/glm-5.3` | 1.0M | | | | | | $1 | $3 |
|
|
633
633
|
| `nano-gpt/z-ai/glm-5.3-flash` | 1.0M | | | | | | $0.10 | $0.30 |
|
|
634
|
+
| `nano-gpt/z-ai/glm-5.3-flash-apex` | 1.0M | | | | | | $0.15 | $0.50 |
|
|
635
|
+
| `nano-gpt/z-ai/glm-5.3-flash-apex-abliterated` | 1.0M | | | | | | $0.15 | $0.50 |
|
|
634
636
|
| `nano-gpt/z-ai/glm-5.3-flash-cybersecurity` | 1.0M | | | | | | $0.15 | $0.50 |
|
|
635
637
|
| `nano-gpt/z-ai/glm-5.3-flash-uncensored` | 1.0M | | | | | | $0.20 | $0.80 |
|
|
636
638
|
| `nano-gpt/z-ai/glm-5.3-uncensored` | 1.0M | | | | | | $1 | $2 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# OpenCode Zen
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 116 OpenCode Zen models through Mastra's model router. Authentication is handled automatically using the `OPENCODE_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [OpenCode Zen documentation](https://opencode.ai/docs/zen).
|
|
10
10
|
|
|
@@ -103,6 +103,7 @@ for await (const chunk of stream) {
|
|
|
103
103
|
| `opencode/kimi-k2.7-code` | 262K | | | | | | $0.95 | $4 |
|
|
104
104
|
| `opencode/kimi-k3` | 1.0M | | | | | | $3 | $15 |
|
|
105
105
|
| `opencode/ling-3.0-flash-fin-free` | 262K | | | | | | — | — |
|
|
106
|
+
| `opencode/ling-3.1-flash-free` | 262K | | | | | | — | — |
|
|
106
107
|
| `opencode/longcat-2.5-preview-free` | 1.0M | | | | | | — | — |
|
|
107
108
|
| `opencode/mimo-v2.6-flash-free` | 200K | | | | | | — | — |
|
|
108
109
|
| `opencode/minimax-m2.5` | 205K | | | | | | $0.30 | $1 |
|
|
@@ -39,11 +39,11 @@ for await (const chunk of stream) {
|
|
|
39
39
|
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
40
40
|
| ----------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
41
41
|
| `privatemode-ai/deepseek-ocr-2` | 8K | | | | | | $0.89 | $1 |
|
|
42
|
-
| `privatemode-ai/glm-5.3` |
|
|
43
|
-
| `privatemode-ai/glm-5.3-flash` |
|
|
44
|
-
| `privatemode-ai/glm-flash-latest` |
|
|
45
|
-
| `privatemode-ai/glm-latest` |
|
|
46
|
-
| `privatemode-ai/gpt-oss-120b` | 128K | | | | | | $0.
|
|
42
|
+
| `privatemode-ai/glm-5.3` | 1.0M | | | | | | $2 | $7 |
|
|
43
|
+
| `privatemode-ai/glm-5.3-flash` | 1.0M | | | | | | $0.23 | $0.75 |
|
|
44
|
+
| `privatemode-ai/glm-flash-latest` | 1.0M | | | | | | $0.23 | $0.75 |
|
|
45
|
+
| `privatemode-ai/glm-latest` | 1.0M | | | | | | $2 | $7 |
|
|
46
|
+
| `privatemode-ai/gpt-oss-120b` | 128K | | | | | | $0.23 | $0.75 |
|
|
47
47
|
| `privatemode-ai/qwen3-embedding-4b` | 32K | | | | | | $0.15 | — |
|
|
48
48
|
| `privatemode-ai/voxtral-mini-3b` | 32K | | | | | | $0.00 | — |
|
|
49
49
|
| `privatemode-ai/whisper-large-v3` | 448 | | | | | | $0.02 | — |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Requesty
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 166 Requesty models through Mastra's model router. Authentication is handled automatically using the `REQUESTY_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Requesty documentation](https://requesty.ai/solution/llm-routing/models).
|
|
10
10
|
|
|
@@ -140,6 +140,7 @@ for await (const chunk of stream) {
|
|
|
140
140
|
| `requesty/grok-4.3` | 1.0M | | | | | | $1 | $3 |
|
|
141
141
|
| `requesty/grok-4.5` | 500K | | | | | | $2 | $6 |
|
|
142
142
|
| `requesty/grok-4.6` | 500K | | | | | | $2 | $6 |
|
|
143
|
+
| `requesty/grok-4.7` | 500K | | | | | | $2 | $6 |
|
|
143
144
|
| `requesty/grok-build-0.1` | 256K | | | | | | $1 | $2 |
|
|
144
145
|
| `requesty/hy3` | 262K | | | | | | $0.14 | $0.58 |
|
|
145
146
|
| `requesty/inkling` | 66K | | | | | | $2 | $5 |
|
|
@@ -19,7 +19,7 @@ const agent = new Agent({
|
|
|
19
19
|
id: "my-agent",
|
|
20
20
|
name: "My Agent",
|
|
21
21
|
instructions: "You are a helpful assistant",
|
|
22
|
-
model: "subconscious/subconscious/
|
|
22
|
+
model: "subconscious/subconscious/deepseek-v4.1-flash-marathon"
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
// Generate a response
|
|
@@ -36,10 +36,10 @@ for await (const chunk of stream) {
|
|
|
36
36
|
|
|
37
37
|
## Models
|
|
38
38
|
|
|
39
|
-
| Model
|
|
40
|
-
|
|
|
41
|
-
| `subconscious/subconscious/
|
|
42
|
-
| `subconscious/subconscious/
|
|
39
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
40
|
+
| -------------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
41
|
+
| `subconscious/subconscious/deepseek-v4.1-flash-marathon` | 5.0M | | | | | | $0.14 | $0.28 |
|
|
42
|
+
| `subconscious/subconscious/glm-5.3-marathon` | 5.0M | | | | | | $1 | $4 |
|
|
43
43
|
|
|
44
44
|
Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
|
|
45
45
|
|
|
@@ -53,7 +53,7 @@ const agent = new Agent({
|
|
|
53
53
|
name: "custom-agent",
|
|
54
54
|
model: {
|
|
55
55
|
url: "https://api.subconscious.dev/v1",
|
|
56
|
-
id: "subconscious/subconscious/
|
|
56
|
+
id: "subconscious/subconscious/deepseek-v4.1-flash-marathon",
|
|
57
57
|
apiKey: process.env.SUBCONSCIOUS_API_KEY,
|
|
58
58
|
headers: {
|
|
59
59
|
"X-Custom-Header": "value"
|
|
@@ -71,8 +71,8 @@ const agent = new Agent({
|
|
|
71
71
|
model: ({ requestContext }) => {
|
|
72
72
|
const useAdvanced = requestContext.task === "complex";
|
|
73
73
|
return useAdvanced
|
|
74
|
-
? "subconscious/subconscious/
|
|
75
|
-
: "subconscious/subconscious/
|
|
74
|
+
? "subconscious/subconscious/glm-5.3-marathon"
|
|
75
|
+
: "subconscious/subconscious/deepseek-v4.1-flash-marathon";
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
```
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Synthetic
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 11 Synthetic models through Mastra's model router. Authentication is handled automatically using the `SYNTHETIC_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Synthetic documentation](https://synthetic.new/pricing).
|
|
10
10
|
|
|
@@ -47,6 +47,7 @@ for await (const chunk of stream) {
|
|
|
47
47
|
| `synthetic/hf:Qwen/Qwen3.6-27B` | 262K | | | | | | $0.45 | $4 |
|
|
48
48
|
| `synthetic/hf:zai-org/GLM-4.7-Flash` | 197K | | | | | | $0.10 | $0.50 |
|
|
49
49
|
| `synthetic/hf:zai-org/GLM-5.2` | 524K | | | | | | $1 | $4 |
|
|
50
|
+
| `synthetic/hf:zai-org/GLM-5.3` | 524K | | | | | | $1 | $4 |
|
|
50
51
|
| `synthetic/hf:zai-org/GLM-5.3-Flash` | 524K | | | | | | $0.15 | $0.50 |
|
|
51
52
|
|
|
52
53
|
Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Together AI
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 29 Together AI models through Mastra's model router. Authentication is handled automatically using the `TOGETHER_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Together AI documentation](https://docs.together.ai/docs/serverless-models).
|
|
10
10
|
|
|
@@ -34,33 +34,26 @@ for await (const chunk of stream) {
|
|
|
34
34
|
|
|
35
35
|
## Models
|
|
36
36
|
|
|
37
|
-
| Model
|
|
38
|
-
|
|
|
39
|
-
| `togetherai/
|
|
40
|
-
| `togetherai/deepseek-ai/DeepSeek-V4-
|
|
41
|
-
| `togetherai/deepseek-ai/DeepSeek-V4-
|
|
42
|
-
| `togetherai/
|
|
43
|
-
| `togetherai/
|
|
44
|
-
| `togetherai/
|
|
45
|
-
| `togetherai/
|
|
46
|
-
| `togetherai/
|
|
47
|
-
| `togetherai/
|
|
48
|
-
| `togetherai/
|
|
49
|
-
| `togetherai/
|
|
50
|
-
| `togetherai/
|
|
51
|
-
| `togetherai/
|
|
52
|
-
| `togetherai/
|
|
53
|
-
| `togetherai/
|
|
54
|
-
| `togetherai/
|
|
55
|
-
| `togetherai/
|
|
56
|
-
| `togetherai/
|
|
57
|
-
| `togetherai/Qwen/Qwen3.5-9B` | 262K | | | | | | $0.17 | $0.25 |
|
|
58
|
-
| `togetherai/Qwen/Qwen3.6-Plus` | 1.0M | | | | | | $0.50 | $3 |
|
|
59
|
-
| `togetherai/Qwen/Qwen3.7-Max` | 1.0M | | | | | | $1 | $4 |
|
|
60
|
-
| `togetherai/thinkingmachines/Inkling` | 524K | | | | | | $1 | $4 |
|
|
61
|
-
| `togetherai/zai-org/GLM-5.2` | 1.0M | | | | | | $1 | $4 |
|
|
62
|
-
| `togetherai/zai-org/GLM-5.3` | 1.0M | | | | | | $1 | $4 |
|
|
63
|
-
| `togetherai/zai-org/GLM-5.3-Flash` | 1.0M | | | | | | $0.15 | $0.50 |
|
|
37
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
|
+
| ---------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
+
| `togetherai/deepseek-ai/DeepSeek-V4-Flash-0731` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
40
|
+
| `togetherai/deepseek-ai/DeepSeek-V4-Pro-0813` | 1.0M | | | | | | $1 | $4 |
|
|
41
|
+
| `togetherai/deepseek-ai/DeepSeek-V4.1-Flash` | 1.0M | | | | | | $0.30 | $1 |
|
|
42
|
+
| `togetherai/LiquidAI/LFM2-24B-A2B` | 33K | | | | | | $0.03 | $0.12 |
|
|
43
|
+
| `togetherai/meta-llama/Llama-3.3-70B-Instruct-Turbo` | 131K | | | | | | $1 | $1 |
|
|
44
|
+
| `togetherai/MiniMaxAI/MiniMax-M2.7` | 197K | | | | | | $0.30 | $1 |
|
|
45
|
+
| `togetherai/MiniMaxAI/MiniMax-M3` | 524K | | | | | | $0.30 | $1 |
|
|
46
|
+
| `togetherai/moonshotai/Kimi-K3` | 1.0M | | | | | | $3 | $15 |
|
|
47
|
+
| `togetherai/nvidia/nemotron-3-ultra-550b-a55b` | 512K | | | | | | $0.60 | $4 |
|
|
48
|
+
| `togetherai/openai/gpt-oss-120b` | 131K | | | | | | $0.15 | $0.60 |
|
|
49
|
+
| `togetherai/Qwen/Qwen2.5-7B-Instruct-Turbo` | 33K | | | | | | $0.30 | $0.30 |
|
|
50
|
+
| `togetherai/Qwen/Qwen3.5-9B` | 262K | | | | | | $0.17 | $0.25 |
|
|
51
|
+
| `togetherai/Qwen/Qwen3.6-Plus` | 1.0M | | | | | | $0.50 | $3 |
|
|
52
|
+
| `togetherai/Qwen/Qwen3.7-Max` | 1.0M | | | | | | $1 | $4 |
|
|
53
|
+
| `togetherai/thinkingmachines/Inkling` | 524K | | | | | | $1 | $4 |
|
|
54
|
+
| `togetherai/zai-org/GLM-5.2` | 1.0M | | | | | | $1 | $4 |
|
|
55
|
+
| `togetherai/zai-org/GLM-5.3` | 1.0M | | | | | | $1 | $4 |
|
|
56
|
+
| `togetherai/zai-org/GLM-5.3-Flash` | 1.0M | | | | | | $0.15 | $0.50 |
|
|
64
57
|
|
|
65
58
|
Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
|
|
66
59
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Umans AI Coding Plan
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 8 Umans AI Coding Plan models through Mastra's model router. Authentication is handled automatically using the `UMANS_AI_CODING_PLAN_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Umans AI Coding Plan documentation](https://app.umans.ai/offers/code/docs).
|
|
10
10
|
|
|
@@ -42,6 +42,7 @@ for await (const chunk of stream) {
|
|
|
42
42
|
| `umans-ai-coding-plan/umans-deepseek-v4-flash-0731` | 1.0M | | | | | | — | — |
|
|
43
43
|
| `umans-ai-coding-plan/umans-deepseek-v4.1-flash` | 1.0M | | | | | | — | — |
|
|
44
44
|
| `umans-ai-coding-plan/umans-flash` | 262K | | | | | | — | — |
|
|
45
|
+
| `umans-ai-coding-plan/umans-glm-5.3` | 1.0M | | | | | | — | — |
|
|
45
46
|
| `umans-ai-coding-plan/umans-glm-5.3-flash` | 1.0M | | | | | | — | — |
|
|
46
47
|
| `umans-ai-coding-plan/umans-kimi-k3` | 1.0M | | | | | | — | — |
|
|
47
48
|
| `umans-ai-coding-plan/umans-qwen3.6-35b-a3b` | 262K | | | | | | — | — |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Umans AI
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 7 Umans AI models through Mastra's model router. Authentication is handled automatically using the `UMANS_AI_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Umans AI documentation](https://app.umans.ai/offers/code/docs/orgs).
|
|
10
10
|
|
|
@@ -42,6 +42,7 @@ for await (const chunk of stream) {
|
|
|
42
42
|
| `umans-ai/umans-deepseek-v4-flash-0731` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
43
43
|
| `umans-ai/umans-deepseek-v4.1-flash` | 1.0M | | | | | | $0.15 | $0.60 |
|
|
44
44
|
| `umans-ai/umans-flash` | 262K | | | | | | $0.15 | $1 |
|
|
45
|
+
| `umans-ai/umans-glm-5.3` | 1.0M | | | | | | $1 | $4 |
|
|
45
46
|
| `umans-ai/umans-glm-5.3-flash` | 1.0M | | | | | | $0.15 | $0.50 |
|
|
46
47
|
| `umans-ai/umans-kimi-k3` | 1.0M | | | | | | $3 | $15 |
|
|
47
48
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# xAI
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 13 xAI models through Mastra's model router. Authentication is handled automatically using the `XAI_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [xAI documentation](https://docs.x.ai/docs/models).
|
|
10
10
|
|
|
@@ -48,6 +48,7 @@ for await (const chunk of stream) {
|
|
|
48
48
|
| `xai/grok-imagine-image-quality` | 16K | | | | | | — | — |
|
|
49
49
|
| `xai/grok-imagine-video` | 1K | | | | | | — | — |
|
|
50
50
|
| `xai/grok-imagine-video-1.5` | 1K | | | | | | — | — |
|
|
51
|
+
| `xai/grok-imagine-video-1.5-lite` | 1K | | | | | | — | — |
|
|
51
52
|
|
|
52
53
|
Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
|
|
53
54
|
|
|
@@ -78,7 +79,7 @@ const agent = new Agent({
|
|
|
78
79
|
model: ({ requestContext }) => {
|
|
79
80
|
const useAdvanced = requestContext.task === "complex";
|
|
80
81
|
return useAdvanced
|
|
81
|
-
? "xai/grok-imagine-video-1.5"
|
|
82
|
+
? "xai/grok-imagine-video-1.5-lite"
|
|
82
83
|
: "xai/grok-4.20-0309-non-reasoning";
|
|
83
84
|
}
|
|
84
85
|
});
|
|
@@ -68,6 +68,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
68
68
|
- [Echo](https://mastra.ai/models/providers/echo)
|
|
69
69
|
- [Eden AI](https://mastra.ai/models/providers/edenai)
|
|
70
70
|
- [EmpirioLabs AI](https://mastra.ai/models/providers/empiriolabs)
|
|
71
|
+
- [engy](https://mastra.ai/models/providers/engy)
|
|
71
72
|
- [evroc](https://mastra.ai/models/providers/evroc)
|
|
72
73
|
- [FastRouter](https://mastra.ai/models/providers/fastrouter)
|
|
73
74
|
- [Fireworks AI](https://mastra.ai/models/providers/fireworks-ai)
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
# AgentController
|
|
6
6
|
|
|
7
|
-
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
8
|
-
|
|
9
7
|
The `AgentController` class is a shared host for one or more [`Session`](https://mastra.ai/reference/agent-controller/session) instances. Initialize the controller, create a session, then use `session.*` APIs for conversation state and run control.
|
|
10
8
|
|
|
11
9
|
For a guided introduction, see the [AgentController overview](https://mastra.ai/docs/harness/agent-controller).
|
|
@@ -178,6 +176,8 @@ The same `resourceId` and `scope` return the same `Session` instance. A differen
|
|
|
178
176
|
|
|
179
177
|
**threadId** (`string`): Exact thread to bind. Missing threads are created with this identifier.
|
|
180
178
|
|
|
179
|
+
**createInitialThread** (`boolean`): Create a thread when no existing thread matches. Set false to start the session without a thread; the first message or session.thread.ensureId() creates it, so unused sessions leave no empty thread behind. (Default: `true`)
|
|
180
|
+
|
|
181
181
|
**id** (`string`): Stable session identifier. Defaults to the controller id.
|
|
182
182
|
|
|
183
183
|
**ownerId** (`string`): Stable session owner identifier. Defaults to id.
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
# Session
|
|
6
6
|
|
|
7
|
-
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
8
|
-
|
|
9
7
|
A `Session` is the isolated runtime for one resource and optional scope. It owns its event bus, thread binding, state, mode and model selections, run control, approvals, suspensions, follow-ups, and display state. The [`AgentController`](https://mastra.ai/reference/agent-controller/agent-controller-class) supplies shared agents, configuration, storage, workspaces, and services.
|
|
10
8
|
|
|
11
9
|
Create sessions through `controller.createSession()`. Direct construction and controller wiring methods aren't application APIs.
|
|
@@ -351,6 +349,14 @@ Return the active thread ID, or `null` when no thread is bound.
|
|
|
351
349
|
const threadId = session.thread.getId()
|
|
352
350
|
```
|
|
353
351
|
|
|
352
|
+
### `session.thread.ensureId({ requestContext? })`
|
|
353
|
+
|
|
354
|
+
Return the active thread ID, creating and binding a new thread when none is bound. Concurrent calls share one thread. Use it with sessions created with `createInitialThread: false`.
|
|
355
|
+
|
|
356
|
+
```typescript
|
|
357
|
+
const threadId = await session.thread.ensureId()
|
|
358
|
+
```
|
|
359
|
+
|
|
354
360
|
### `session.thread.list(options?)`
|
|
355
361
|
|
|
356
362
|
List threads from storage. By default only threads for the current resource are returned, and transient forked subagent threads are hidden.
|
|
@@ -202,7 +202,8 @@ Override built-in event handlers. Each handler can be:
|
|
|
202
202
|
|
|
203
203
|
- **Omitted**: uses the default Mastra handler (routes the message through the agent and posts the response)
|
|
204
204
|
- **`false`**: disables the handler entirely
|
|
205
|
-
- **A function** `(thread, message, defaultHandler) => Promise<void>`: wraps or replaces the default
|
|
205
|
+
- **A function** `(thread, message, defaultHandler, ctx) => Promise<void>`: wraps or replaces the default
|
|
206
|
+
- When a `chatOptions.concurrency` strategy batches messages from several senders into one dispatch, the function is called once per sender's turn, each with its own `ctx`; `ctx.skipped` holds that turn's earlier batched messages
|
|
206
207
|
|
|
207
208
|
```typescript
|
|
208
209
|
import { Agent } from '@mastra/core/agent'
|
|
@@ -179,17 +179,22 @@ Returns: [`Promise<DurableAgentStreamResult>`](#durableagentstreamresult)
|
|
|
179
179
|
|
|
180
180
|
#### `observe(runId, options?)`
|
|
181
181
|
|
|
182
|
-
Reconnects to an existing run
|
|
182
|
+
Reconnects to an existing run. Use this after a network disconnection. For the supported general reconnect flow, omit `offset` to replay all available cached events before receiving live events.
|
|
183
183
|
|
|
184
184
|
```typescript
|
|
185
|
-
const { output
|
|
186
|
-
offset: 0,
|
|
185
|
+
const { output } = await durableAgent.observe(runId, {
|
|
187
186
|
onChunk: chunk => console.log(chunk),
|
|
188
187
|
})
|
|
189
188
|
|
|
190
189
|
await output.text
|
|
191
190
|
```
|
|
192
191
|
|
|
192
|
+
The `offset` option is an inclusive, zero-based PubSub event index. It counts every cached event published to the run topic, including lifecycle events, so it isn't a chunk count. Public stream chunks and callbacks don't expose the PubSub index. Only pass an offset when another integration already tracks the transport position.
|
|
193
|
+
|
|
194
|
+
A non-zero offset can skip earlier events. Aggregated values are built only from chunks delivered to that observer. If the offset skips earlier text deltas, `output.text` is partial and structured output may be incomplete or fail validation or parsing.
|
|
195
|
+
|
|
196
|
+
When the PubSub transport supports numeric offsets, an offset beyond the highest retained index replays nothing and also skips live events with lower indexes. The observer receives events only when the published index reaches the requested offset. If the index counter restarts below that offset, the observer can wait indefinitely. On a transport without numeric offset support, providing an offset starts with new live events and doesn't replay cached events. Replay is limited to events still available in the configured cache. Events can't be replayed when caching is disabled, `shouldCache` excludes the run topic, a cache write fails, or retained events have been cleared.
|
|
197
|
+
|
|
193
198
|
By default `observe()` waits indefinitely for events. If the process running the run stops unexpectedly, the run stops producing events but never emits a completion event, so the observed stream would wait forever. Pass `idleTimeoutMs` to end the stream after a bounded period of silence. Before timing out, `observe()` can consult an optional `isAlive` check. Return `true` while work continues, such as during a long-running tool call or a pause for human input. A `false` result ends the stream with an error, as does omitting `isAlive`. A transient throw from `isAlive` is treated as "still alive", so a momentary check failure never ends a live stream.
|
|
194
199
|
|
|
195
200
|
```typescript
|
|
@@ -235,7 +240,7 @@ interface PrepareResult {
|
|
|
235
240
|
|
|
236
241
|
#### `abortRunStream(runId)`
|
|
237
242
|
|
|
238
|
-
Stops a run by ID from any process that shares the agent's [PubSub](https://mastra.ai/docs/server/pubsub). Only the `runId` from `stream()` or `prepare()` is needed, so a later request can stop a run it didn't start. The run ends the same way as `abort()` on the stream result: the
|
|
243
|
+
Stops a run by ID from any process that shares the agent's [PubSub](https://mastra.ai/docs/server/pubsub). Only the `runId` from `stream()` or `prepare()` is needed, so a later request can stop a run it didn't start. The run ends the same way as `abort()` on the stream result: the stream emits an `abort` chunk, `onAbort` fires, and `observe()` consumers see the stream end.
|
|
239
244
|
|
|
240
245
|
```typescript
|
|
241
246
|
const { runId } = await durableAgent.stream('Summarize the document')
|
|
@@ -426,7 +431,7 @@ Returns: [`Promise<DurableAgentStreamResult>`](#durableagentstreamresult)
|
|
|
426
431
|
|
|
427
432
|
**onStepFinish** (`(result: AgentStepFinishEventData) => void | Promise<void>`): Called when a step in the agentic loop finishes.
|
|
428
433
|
|
|
429
|
-
**onFinish** (`(result: AgentFinishEventData) => void | Promise<void>`): Called when the run
|
|
434
|
+
**onFinish** (`(result: AgentFinishEventData) => void | Promise<void>`): Called when the run completes successfully. Aborted runs call onAbort; failed runs call onError.
|
|
430
435
|
|
|
431
436
|
**onError** (`(error: Error) => void | Promise<void>`): Called when the run errors.
|
|
432
437
|
|
|
@@ -434,9 +439,9 @@ Returns: [`Promise<DurableAgentStreamResult>`](#durableagentstreamresult)
|
|
|
434
439
|
|
|
435
440
|
**onAbort** (`AgentExecutionOptions['onAbort']`): Called when the run is aborted via abortSignal, result.abort(), abortRunStream(), or abortThreadStream(). Receives the steps completed before the abort and, in text, the assistant text streamed so far.
|
|
436
441
|
|
|
437
|
-
**onIterationComplete** (`AgentExecutionOptions['onIterationComplete']`): Called after every agentic-loop iteration with the latest messageList, finishReason, and isFinal flag.
|
|
442
|
+
**onIterationComplete** (`AgentExecutionOptions['onIterationComplete']`): Called after every agentic-loop iteration with the latest messageList, finishReason, and isFinal flag. Return continue: true to request another iteration or continue: false to stop. Feedback is added as a synthetic assistant message when the loop runs another iteration. If the model has stopped, feedback alone or continue: false with feedback does not start another iteration. When the loop was already going to continue, continue: false with feedback runs one final feedback-guided iteration before stopping.
|
|
438
443
|
|
|
439
|
-
`resume()` and `
|
|
444
|
+
`resume()`, `observe()`, and `recover()` accept the same lifecycle callbacks (`onChunk`, `onStepFinish`, `onFinish`, `onError`, `onAbort`, `onSuspended`). `observe()` also accepts an `offset` to control where replay starts.
|
|
440
445
|
|
|
441
446
|
## DurableAgentStreamResult
|
|
442
447
|
|
|
@@ -1040,7 +1040,7 @@ console.log(diff.changes) // Fields that changed between versions
|
|
|
1040
1040
|
In the React SDK, pass an `agentVersionId` through `requestContext` when using the `useChat` hook:
|
|
1041
1041
|
|
|
1042
1042
|
```typescript
|
|
1043
|
-
import { useChat } from '@mastra/react'
|
|
1043
|
+
import { useChat } from '@mastra/react/chat'
|
|
1044
1044
|
|
|
1045
1045
|
function Chat() {
|
|
1046
1046
|
const { messages, input, handleInputChange, handleSubmit } = useChat({
|
|
@@ -217,6 +217,34 @@ The API limits predicate depth, nodes, related clauses, set members, literal byt
|
|
|
217
217
|
|
|
218
218
|
See [Advanced trace queries](https://mastra.ai/reference/observability/tracing/trace-query) for the complete limits, request fields, predicates, thread qualification semantics, cursor pagination, response shapes, and errors.
|
|
219
219
|
|
|
220
|
+
## Querying spans
|
|
221
|
+
|
|
222
|
+
`querySpans()` returns one row per matching completed span across traces. Use it to list the spans themselves. `queryTraces()` with a `spans.some` predicate returns the traces that contain a matching span instead. Every query requires an ISO timestamp range of at most 31 days.
|
|
223
|
+
|
|
224
|
+
```typescript
|
|
225
|
+
const result = await mastraClient.querySpans({
|
|
226
|
+
timeRange: {
|
|
227
|
+
from: '2026-10-01T00:00:00.000Z',
|
|
228
|
+
to: '2026-10-02T00:00:00.000Z',
|
|
229
|
+
},
|
|
230
|
+
where: {
|
|
231
|
+
op: 'eq',
|
|
232
|
+
left: { path: 'spanType' },
|
|
233
|
+
right: { literal: 'tool_call' },
|
|
234
|
+
},
|
|
235
|
+
orderBy: [{ field: 'startedAt', direction: 'desc' }],
|
|
236
|
+
page: { limit: 50 },
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
// { spans: [{ traceId, spanId, name, spanType, status, durationMs, cost, ... }], page: { next } }
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Pass `result.page.next` back as `page.after` with the same time range, filter, and ordering to load the next page. Each row contains identifiers, display fields, input and output previews, and the span's model cost. Use `getSpan()` to load the full span.
|
|
243
|
+
|
|
244
|
+
Span queries are optional for observability stores. Check `capabilities.spanQuery` from `getObservabilityCapabilities()` before calling `querySpans()`, and treat a missing value as unsupported. Unsupported servers reject with `501 SPAN_QUERY_UNSUPPORTED`.
|
|
245
|
+
|
|
246
|
+
See [Query individual spans](https://mastra.ai/reference/observability/tracing/trace-query) for filters, ordering, cursors, cost states, limits, and errors.
|
|
247
|
+
|
|
220
248
|
## Deleting traces
|
|
221
249
|
|
|
222
250
|
Delete traces and their associated spans, metrics, logs, scores, and feedback:
|
|
@@ -25,10 +25,27 @@ A client that accepts command and argument fields can use:
|
|
|
25
25
|
}
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
Configure provider authentication in Mastra Code before starting the client, or supply API keys in the server process's environment. ACP sessions don't load project `.env` files into the shared process environment. The server doesn't offer interactive ACP authentication.
|
|
29
|
-
|
|
30
28
|
After initialization, the client calls `session/new` with an absolute `cwd` and an `mcpServers` array. The response includes the session ID and configuration choices. Send that ID with subsequent prompts and configuration requests.
|
|
31
29
|
|
|
30
|
+
## Authentication
|
|
31
|
+
|
|
32
|
+
`session/new` returns an `auth_required` error when no model provider is configured, so clients can offer the methods from the `initialize` response:
|
|
33
|
+
|
|
34
|
+
| Method ID | Type | Behavior |
|
|
35
|
+
| ------------------ | -------- | ---------------------------------------------------------------------------------------------- |
|
|
36
|
+
| `openai-codex` | Agent | Opens the browser to sign in with a ChatGPT Plus or Pro subscription. |
|
|
37
|
+
| `kimi-for-coding` | Agent | Opens the browser to approve a Kimi For Coding device sign-in. |
|
|
38
|
+
| `xai` | Agent | Opens the browser to approve an xAI device sign-in. |
|
|
39
|
+
| `anthropic` | Terminal | Runs `mastracode login --provider anthropic` to sign in with a Claude Pro or Max subscription. |
|
|
40
|
+
| `github-copilot` | Terminal | Runs `mastracode login --provider github-copilot` to sign in with GitHub Copilot. |
|
|
41
|
+
| `mastracode-login` | Terminal | Runs `mastracode login` to choose any provider or save an API key. |
|
|
42
|
+
|
|
43
|
+
Terminal methods are offered only to clients that advertise terminal authentication.
|
|
44
|
+
|
|
45
|
+
For agent methods, `authenticate` runs the sign-in inside the server process and returns after the credentials are saved. If a provider needs typed input, such as a code to paste, the request fails and asks you to run `mastracode login` in a terminal.
|
|
46
|
+
|
|
47
|
+
API keys in the server process's environment also count as a configured provider. ACP sessions don't load project `.env` files into the shared process environment. New sessions pick up saved credentials without restarting the server. When the default model's provider isn't configured, a new session starts on the default model of a provider that is, such as `anthropic/claude-fable-5` after an Anthropic sign-in.
|
|
48
|
+
|
|
32
49
|
## `acpMain(options?)`
|
|
33
50
|
|
|
34
51
|
To start the same server from an SDK entry point:
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
# mountAgentControllerOnMastra()
|
|
6
6
|
|
|
7
|
-
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
8
|
-
|
|
9
7
|
The `mountAgentControllerOnMastra()` function builds the Mastra Code agent controller (the coding agent behind [Mastra Code](https://code.mastra.ai), with its modes, tools, memory, and thread management) and registers it on a server-owned [Mastra](https://mastra.ai/reference/core/mastra-class) instance. Use it to serve the Mastra Code agent to your own UI (web app, editor, bot): each client creates or resumes its own isolated session through the returned [`AgentController`](https://mastra.ai/reference/agent-controller/agent-controller-class).
|
|
10
8
|
|
|
11
9
|
To construct the `Mastra` instance yourself (for example in a deployable entry file), use `prepareAgentControllerMount()` from the same package, which returns the constructor args plus a `finalize()` callback.
|
|
@@ -244,7 +244,7 @@ export const mastra = new Mastra({
|
|
|
244
244
|
|
|
245
245
|
**Type:** `Record<string, MastraMemory>`
|
|
246
246
|
|
|
247
|
-
A registry of memory instances that can be referenced by agents
|
|
247
|
+
A registry of memory instances that can be referenced by agents, including stored agents that use `{ type: 'id', memoryId: '<key>' }`. Memory gives agents coherence across interactions by retaining relevant information from past conversations. Mastra supports message history for recent messages and working memory for persistent user-specific details. Semantic recall retrieves older messages based on relevance.
|
|
248
248
|
|
|
249
249
|
Visit the [Memory documentation](https://mastra.ai/docs/memory/overview) to learn more.
|
|
250
250
|
|
|
@@ -192,6 +192,34 @@ await editor.agent.create({
|
|
|
192
192
|
})
|
|
193
193
|
```
|
|
194
194
|
|
|
195
|
+
### Stored agent memory
|
|
196
|
+
|
|
197
|
+
The `memory` field of a stored agent accepts one of these shapes:
|
|
198
|
+
|
|
199
|
+
- `{ type: 'id', memoryId: string }`: Uses a memory instance registered on the Mastra instance. The editor looks up `memoryId` as a registry key first, then as the memory instance's `id`. The agent uses that exact instance, including its storage, processors, and working memory settings.
|
|
200
|
+
- `{ type: 'inline', config: SerializedMemoryConfig }`: Builds a new memory instance from a serializable config.
|
|
201
|
+
- `SerializedMemoryConfig`: The untagged inline config. Existing stored agents use this shape and keep working.
|
|
202
|
+
|
|
203
|
+
Reference a registered memory instance so many stored agents share one configuration:
|
|
204
|
+
|
|
205
|
+
```typescript
|
|
206
|
+
import { mastra } from '../mastra'
|
|
207
|
+
|
|
208
|
+
const editor = mastra.getEditor()!
|
|
209
|
+
|
|
210
|
+
await editor.agent.create({
|
|
211
|
+
id: 'support-agent',
|
|
212
|
+
name: 'Support agent',
|
|
213
|
+
instructions: 'You are a friendly support agent for Acme.',
|
|
214
|
+
model: { provider: 'openai', name: 'gpt-5' },
|
|
215
|
+
memory: { type: 'id', memoryId: 'supportMemory' },
|
|
216
|
+
})
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
The reference is resolved when the editor loads the agent. If no registered memory matches `memoryId`, the agent loads without memory and the editor logs a warning that names the missing key. The stored reference isn't changed. In conditional memory, a variant whose reference isn't registered is skipped. If you register memory with `mastra.addMemory()` after an agent has loaded, call `editor.agent.clearCache(id)` so the next load picks it up. Renaming or removing a key in the Mastra `memory` config detaches memory from every stored agent that references it, so keep keys stable across deployments.
|
|
220
|
+
|
|
221
|
+
`editor.agent.clone()` stores a reference when the source agent uses a registered memory instance, and an inline config otherwise.
|
|
222
|
+
|
|
195
223
|
## Methods
|
|
196
224
|
|
|
197
225
|
### Provider access
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
# config.ts
|
|
6
6
|
|
|
7
|
-
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
8
|
-
|
|
9
7
|
An agent's `config.ts` sets its model and runtime options. Use it for options that belong to the [`Agent`](https://mastra.ai/reference/agents/agent) itself, while sibling files provide instructions, tools, skills, et cetera.
|
|
10
8
|
|
|
11
9
|
## What belongs in `config.ts`
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
# Instructions
|
|
6
6
|
|
|
7
|
-
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
8
|
-
|
|
9
7
|
An agent's instructions hold its always-on system prompt: the model reads it on every turn. Use them to define the agent's identity, tone, role, and standing rules.
|
|
10
8
|
|
|
11
9
|
Write them in one of two files at the agent root. Use `instructions.md` when the prompt is fixed text. Use `instructions.ts` when the prompt needs code, for example when it's built from shared constants or resolved per request.
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
# Logger
|
|
6
6
|
|
|
7
|
-
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
8
|
-
|
|
9
7
|
Mastra sets the project's [logger](https://mastra.ai/docs/observability/logging) from a `logger.ts` file directly under `src/mastra/`. The file default-exports a logger, which replaces the built-in `ConsoleLogger` used across agents, workflows, and other components.
|
|
10
8
|
|
|
11
9
|
Use this page for the file-based convention. For log levels, transports, and provider details, see [logging](https://mastra.ai/docs/observability/logging).
|