@mastra/mcp-docs-server 1.2.7-alpha.4 → 1.2.7-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/docs/agent-builder/overview.md +4 -3
- package/.docs/docs/agent-controller/overview.md +2 -1
- package/.docs/docs/agents/a2a.md +2 -1
- package/.docs/docs/agents/guardrails.md +2 -1
- package/.docs/docs/agents/overview.md +2 -2
- package/.docs/docs/agents/skills.md +1 -1
- package/.docs/docs/agents/supervisor-agents.md +2 -1
- package/.docs/docs/browser/overview.md +2 -1
- package/.docs/docs/capabilities/channels/discord.md +98 -0
- package/.docs/docs/capabilities/channels/other-adapters.md +68 -0
- package/.docs/docs/capabilities/channels/overview.md +257 -0
- package/.docs/docs/capabilities/channels/slack.md +225 -0
- package/.docs/docs/capabilities/channels/teams.md +100 -0
- package/.docs/docs/capabilities/channels/telegram.md +98 -0
- package/.docs/docs/capabilities/channels/whatsapp.md +99 -0
- package/.docs/docs/evals/datasets/overview.md +2 -1
- package/.docs/docs/evals/datasets/running-experiments.md +2 -0
- package/.docs/docs/evals/overview.md +4 -1
- package/.docs/docs/getting-started/file-based-agents.md +114 -0
- package/.docs/docs/long-running-agents/signals.md +4 -1
- package/.docs/docs/mastra-platform/observability.md +5 -1
- package/.docs/docs/memory/observational-memory.md +2 -1
- package/.docs/docs/memory/overview.md +2 -0
- package/.docs/docs/memory/semantic-recall.md +1 -1
- package/.docs/docs/memory/working-memory.md +3 -3
- package/.docs/docs/studio/overview.md +1 -1
- package/.docs/docs/workflows/control-flow.md +0 -2
- package/.docs/docs/workflows/overview.md +2 -3
- package/.docs/docs/workspace/overview.md +2 -1
- package/.docs/docs/workspace/sandbox.md +2 -0
- package/.docs/guides/getting-started/quickstart.md +3 -1
- package/.docs/guides/guide/chef-michel.md +0 -2
- package/.docs/guides/guide/slack-assistant.md +2 -2
- package/.docs/guides/guide/stock-agent.md +0 -2
- package/.docs/models/environment-variables.md +2 -0
- package/.docs/models/gateways/netlify.md +4 -1
- package/.docs/models/gateways/openrouter.md +7 -6
- package/.docs/models/gateways/vercel.md +5 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/crossmodel.md +109 -0
- package/.docs/models/providers/llmgateway.md +185 -181
- package/.docs/models/providers/meta.md +101 -0
- package/.docs/models/providers/nano-gpt.md +2 -2
- package/.docs/models/providers/neon.md +40 -29
- package/.docs/models/providers/openai.md +5 -1
- package/.docs/models/providers/poolside.md +6 -5
- package/.docs/models/providers/routing-run.md +20 -34
- package/.docs/models/providers/the-grid-ai.md +3 -3
- package/.docs/models/providers.md +2 -0
- package/.docs/reference/agents/channels.md +2 -2
- package/.docs/reference/channels/channel-provider.md +1 -1
- package/.docs/reference/channels/slack-provider.md +2 -2
- package/.docs/reference/cli/mastra.md +1 -0
- package/.docs/reference/file-based-agents/config.md +97 -0
- package/.docs/reference/file-based-agents/instructions.md +54 -0
- package/.docs/reference/file-based-agents/memory.md +58 -0
- package/.docs/reference/file-based-agents/observability.md +32 -0
- package/.docs/reference/file-based-agents/processors.md +56 -0
- package/.docs/reference/file-based-agents/server.md +37 -0
- package/.docs/reference/file-based-agents/skills.md +56 -0
- package/.docs/reference/file-based-agents/storage.md +30 -0
- package/.docs/reference/file-based-agents/studio.md +56 -0
- package/.docs/reference/file-based-agents/subagents.md +123 -0
- package/.docs/reference/file-based-agents/tools.md +63 -0
- package/.docs/reference/file-based-agents/workflows.md +52 -0
- package/.docs/reference/file-based-agents/workspace.md +74 -0
- package/.docs/reference/index.md +13 -0
- package/.docs/reference/memory/memory-class.md +1 -1
- package/.docs/reference/memory/serialized-memory-config.md +1 -1
- package/.docs/reference/project-structure.md +1 -1
- package/.docs/reference/pubsub/lease-provider.md +1 -1
- package/.docs/reference/storage/clickhouse.md +32 -0
- package/.docs/reference/storage/composite.md +27 -1
- package/.docs/reference/storage/retention.md +11 -0
- package/CHANGELOG.md +14 -0
- package/package.json +4 -4
- package/.docs/docs/agents/channels.md +0 -225
- package/.docs/docs/agents/file-based-agents.md +0 -297
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Neon
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 36 Neon models through Mastra's model router. Authentication is handled automatically using the `NEON_AI_GATEWAY_TOKEN` environment variable. Configure `NEON_AI_GATEWAY_BASE_URL` as well.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Neon documentation](https://neon.com/docs).
|
|
8
8
|
|
|
@@ -35,33 +35,44 @@ for await (const chunk of stream) {
|
|
|
35
35
|
|
|
36
36
|
## Models
|
|
37
37
|
|
|
38
|
-
| Model
|
|
39
|
-
|
|
|
40
|
-
| `neon/claude-haiku-4-5`
|
|
41
|
-
| `neon/claude-opus-4-1`
|
|
42
|
-
| `neon/claude-opus-4-5`
|
|
43
|
-
| `neon/claude-opus-4-6`
|
|
44
|
-
| `neon/claude-opus-4-7`
|
|
45
|
-
| `neon/claude-
|
|
46
|
-
| `neon/claude-sonnet-4
|
|
47
|
-
| `neon/claude-sonnet-4-
|
|
48
|
-
| `neon/
|
|
49
|
-
| `neon/gemini-2-5-
|
|
50
|
-
| `neon/gemini-
|
|
51
|
-
| `neon/gemini-3-1-
|
|
52
|
-
| `neon/gemini-3-
|
|
53
|
-
| `neon/gemini-3-
|
|
54
|
-
| `neon/
|
|
55
|
-
| `neon/
|
|
56
|
-
| `neon/
|
|
57
|
-
| `neon/gpt-5
|
|
58
|
-
| `neon/gpt-5-
|
|
59
|
-
| `neon/gpt-5-
|
|
60
|
-
| `neon/gpt-5-
|
|
61
|
-
| `neon/gpt-5-
|
|
62
|
-
| `neon/gpt-5-
|
|
63
|
-
| `neon/gpt-
|
|
64
|
-
| `neon/gpt-
|
|
38
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
39
|
+
| ---------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
40
|
+
| `neon/claude-haiku-4-5` | 200K | | | | | | $1 | $5 |
|
|
41
|
+
| `neon/claude-opus-4-1` | 200K | | | | | | $15 | $75 |
|
|
42
|
+
| `neon/claude-opus-4-5` | 200K | | | | | | $5 | $25 |
|
|
43
|
+
| `neon/claude-opus-4-6` | 1.0M | | | | | | $5 | $25 |
|
|
44
|
+
| `neon/claude-opus-4-7` | 1.0M | | | | | | $5 | $25 |
|
|
45
|
+
| `neon/claude-opus-4-8` | 1.0M | | | | | | $5 | $25 |
|
|
46
|
+
| `neon/claude-sonnet-4` | 200K | | | | | | $3 | $15 |
|
|
47
|
+
| `neon/claude-sonnet-4-5` | 200K | | | | | | $3 | $15 |
|
|
48
|
+
| `neon/claude-sonnet-4-6` | 1.0M | | | | | | $3 | $15 |
|
|
49
|
+
| `neon/gemini-2-5-flash` | 1.0M | | | | | | $0.30 | $3 |
|
|
50
|
+
| `neon/gemini-2-5-pro` | 1.0M | | | | | | $1 | $10 |
|
|
51
|
+
| `neon/gemini-3-1-flash-lite` | 1.0M | | | | | | $0.25 | $2 |
|
|
52
|
+
| `neon/gemini-3-1-pro` | 1.0M | | | | | | $2 | $12 |
|
|
53
|
+
| `neon/gemini-3-5-flash` | 1.0M | | | | | | $2 | $9 |
|
|
54
|
+
| `neon/gemini-3-flash` | 1.0M | | | | | | $0.50 | $3 |
|
|
55
|
+
| `neon/gemini-3-pro` | 1.0M | | | | | | $2 | $12 |
|
|
56
|
+
| `neon/gemma-3-12b` | 131K | | | | | | $0.15 | $0.50 |
|
|
57
|
+
| `neon/gpt-5` | 400K | | | | | | $1 | $10 |
|
|
58
|
+
| `neon/gpt-5-1` | 400K | | | | | | $1 | $10 |
|
|
59
|
+
| `neon/gpt-5-1-codex-max` | 400K | | | | | | $1 | $10 |
|
|
60
|
+
| `neon/gpt-5-1-codex-mini` | 400K | | | | | | $0.25 | $2 |
|
|
61
|
+
| `neon/gpt-5-2` | 400K | | | | | | $2 | $14 |
|
|
62
|
+
| `neon/gpt-5-2-codex` | 400K | | | | | | $2 | $14 |
|
|
63
|
+
| `neon/gpt-5-3-codex` | 400K | | | | | | $2 | $14 |
|
|
64
|
+
| `neon/gpt-5-4` | 1.1M | | | | | | $3 | $15 |
|
|
65
|
+
| `neon/gpt-5-4-mini` | 400K | | | | | | $0.75 | $5 |
|
|
66
|
+
| `neon/gpt-5-4-nano` | 400K | | | | | | $0.20 | $1 |
|
|
67
|
+
| `neon/gpt-5-mini` | 400K | | | | | | $0.25 | $2 |
|
|
68
|
+
| `neon/gpt-5-nano` | 400K | | | | | | $0.05 | $0.40 |
|
|
69
|
+
| `neon/gpt-oss-120b` | 131K | | | | | | $0.07 | $0.28 |
|
|
70
|
+
| `neon/gpt-oss-20b` | 131K | | | | | | $0.05 | $0.20 |
|
|
71
|
+
| `neon/llama-4-maverick` | 1.0M | | | | | | $0.50 | $2 |
|
|
72
|
+
| `neon/meta-llama-3-1-8b-instruct` | 131K | | | | | | $0.15 | $0.45 |
|
|
73
|
+
| `neon/meta-llama-3-3-70b-instruct` | 128K | | | | | | $0.50 | $2 |
|
|
74
|
+
| `neon/qwen3-next-80b-a3b-instruct` | 131K | | | | | | $0.15 | $1 |
|
|
75
|
+
| `neon/qwen35-122b-a10b` | 262K | | | | | | $0.22 | $2 |
|
|
65
76
|
|
|
66
77
|
## Advanced configuration
|
|
67
78
|
|
|
@@ -91,7 +102,7 @@ const agent = new Agent({
|
|
|
91
102
|
model: ({ requestContext }) => {
|
|
92
103
|
const useAdvanced = requestContext.task === "complex";
|
|
93
104
|
return useAdvanced
|
|
94
|
-
? "neon/
|
|
105
|
+
? "neon/qwen35-122b-a10b"
|
|
95
106
|
: "neon/claude-haiku-4-5";
|
|
96
107
|
}
|
|
97
108
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# OpenAI
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 55 OpenAI models through Mastra's model router. Authentication is handled automatically using the `OPENAI_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [OpenAI documentation](https://platform.openai.com/docs/models).
|
|
8
8
|
|
|
@@ -70,6 +70,10 @@ for await (const chunk of stream) {
|
|
|
70
70
|
| `openai/gpt-5.4-pro` | 1.1M | | | | | | $30 | $180 |
|
|
71
71
|
| `openai/gpt-5.5` | 1.1M | | | | | | $5 | $30 |
|
|
72
72
|
| `openai/gpt-5.5-pro` | 1.1M | | | | | | $30 | $180 |
|
|
73
|
+
| `openai/gpt-5.6` | 1.1M | | | | | | $5 | $30 |
|
|
74
|
+
| `openai/gpt-5.6-luna` | 1.1M | | | | | | $1 | $6 |
|
|
75
|
+
| `openai/gpt-5.6-sol` | 1.1M | | | | | | $5 | $30 |
|
|
76
|
+
| `openai/gpt-5.6-terra` | 1.1M | | | | | | $3 | $15 |
|
|
73
77
|
| `openai/gpt-image-1` | — | | | | | | — | — |
|
|
74
78
|
| `openai/gpt-image-1-mini` | — | | | | | | — | — |
|
|
75
79
|
| `openai/gpt-image-1.5` | — | | | | | | — | — |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Poolside
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 3 Poolside models through Mastra's model router. Authentication is handled automatically using the `POOLSIDE_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Poolside documentation](https://platform.poolside.ai).
|
|
8
8
|
|
|
@@ -34,10 +34,11 @@ for await (const chunk of stream) {
|
|
|
34
34
|
|
|
35
35
|
## Models
|
|
36
36
|
|
|
37
|
-
| Model
|
|
38
|
-
|
|
|
39
|
-
| `poolside/poolside/laguna-m.1`
|
|
40
|
-
| `poolside/poolside/laguna-xs.
|
|
37
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
|
+
| --------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
+
| `poolside/poolside/laguna-m.1` | 262K | | | | | | — | — |
|
|
40
|
+
| `poolside/poolside/laguna-xs-2.1` | 262K | | | | | | — | — |
|
|
41
|
+
| `poolside/poolside/laguna-xs.2` | 262K | | | | | | — | — |
|
|
41
42
|
|
|
42
43
|
## Advanced configuration
|
|
43
44
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# routing.run
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 12 routing.run models through Mastra's model router. Authentication is handled automatically using the `ROUTING_RUN_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [routing.run documentation](https://docs.routing.run).
|
|
8
8
|
|
|
@@ -17,7 +17,7 @@ const agent = new Agent({
|
|
|
17
17
|
id: "my-agent",
|
|
18
18
|
name: "My Agent",
|
|
19
19
|
instructions: "You are a helpful assistant",
|
|
20
|
-
model: "routing-run/
|
|
20
|
+
model: "routing-run/claude-opus-4-8"
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
// Generate a response
|
|
@@ -34,34 +34,20 @@ for await (const chunk of stream) {
|
|
|
34
34
|
|
|
35
35
|
## Models
|
|
36
36
|
|
|
37
|
-
| Model
|
|
38
|
-
|
|
|
39
|
-
| `routing-run/
|
|
40
|
-
| `routing-run/
|
|
41
|
-
| `routing-run/
|
|
42
|
-
| `routing-run/
|
|
43
|
-
| `routing-run/
|
|
44
|
-
| `routing-run/
|
|
45
|
-
| `routing-run/
|
|
46
|
-
| `routing-run/
|
|
47
|
-
| `routing-run/
|
|
48
|
-
| `routing-run/
|
|
49
|
-
| `routing-run/
|
|
50
|
-
| `routing-run/
|
|
51
|
-
| `routing-run/route/mimo-v2.5-pro` | 1.0M | | | | | | $0.45 | $1 |
|
|
52
|
-
| `routing-run/route/mimo-v2.5-pro-6bit` | 1.0M | | | | | | $0.45 | $1 |
|
|
53
|
-
| `routing-run/route/minimax-m2.5` | 100K | | | | | | $0.19 | $1 |
|
|
54
|
-
| `routing-run/route/minimax-m2.5-highspeed` | 100K | | | | | | $0.19 | $1 |
|
|
55
|
-
| `routing-run/route/minimax-m2.7` | 100K | | | | | | $0.33 | $1 |
|
|
56
|
-
| `routing-run/route/minimax-m2.7-highspeed` | 100K | | | | | | $0.33 | $1 |
|
|
57
|
-
| `routing-run/route/mistral-large-3` | 128K | | | | | | $0.50 | $2 |
|
|
58
|
-
| `routing-run/route/mistral-medium-2505` | 128K | | | | | | $0.40 | $2 |
|
|
59
|
-
| `routing-run/route/mistral-small-2503` | 128K | | | | | | $0.15 | $0.60 |
|
|
60
|
-
| `routing-run/route/qwen3.6-27b` | 202K | | | | | | $1 | $3 |
|
|
61
|
-
| `routing-run/route/qwen3.6-27b-202k` | 202K | | | | | | $1 | $3 |
|
|
62
|
-
| `routing-run/route/step-3.5-flash` | 262K | | | | | | $0.10 | $0.29 |
|
|
63
|
-
| `routing-run/route/step-3.5-flash-2603` | 262K | | | | | | $0.10 | $0.30 |
|
|
64
|
-
| `routing-run/route/stepfun-3.5-flash` | 262K | | | | | | $0.10 | $0.29 |
|
|
37
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
|
+
| ---------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
+
| `routing-run/claude-opus-4-8` | 1.0M | | | | | | $5 | $25 |
|
|
40
|
+
| `routing-run/claude-sonnet-4-6` | 1.0M | | | | | | $3 | $15 |
|
|
41
|
+
| `routing-run/deepseek-v4-flash` | 1.0M | | | | | | $0.11 | $0.22 |
|
|
42
|
+
| `routing-run/deepseek-v4-pro` | 1.0M | | | | | | $0.35 | $0.70 |
|
|
43
|
+
| `routing-run/glm-5.2` | 200K | | | | | | $0.80 | $2 |
|
|
44
|
+
| `routing-run/glm-5.2-nitro` | 200K | | | | | | $0.80 | $2 |
|
|
45
|
+
| `routing-run/kimi-k2.6` | 200K | | | | | | $0.28 | $1 |
|
|
46
|
+
| `routing-run/kimi-k2.6-nitro` | 200K | | | | | | $0.28 | $1 |
|
|
47
|
+
| `routing-run/kimi-k2.7-code` | 200K | | | | | | $0.28 | $1 |
|
|
48
|
+
| `routing-run/kimi-k2.7-code-nitro` | 200K | | | | | | $0.28 | $1 |
|
|
49
|
+
| `routing-run/nemotron-3-ultra` | 131K | | | | | | $0.10 | $0.10 |
|
|
50
|
+
| `routing-run/qwen3.5-9b` | 262K | | | | | | $0.16 | $0.48 |
|
|
65
51
|
|
|
66
52
|
## Advanced configuration
|
|
67
53
|
|
|
@@ -72,8 +58,8 @@ const agent = new Agent({
|
|
|
72
58
|
id: "custom-agent",
|
|
73
59
|
name: "custom-agent",
|
|
74
60
|
model: {
|
|
75
|
-
url: "https://
|
|
76
|
-
id: "routing-run/
|
|
61
|
+
url: "https://api.routing.run/v1",
|
|
62
|
+
id: "routing-run/claude-opus-4-8",
|
|
77
63
|
apiKey: process.env.ROUTING_RUN_API_KEY,
|
|
78
64
|
headers: {
|
|
79
65
|
"X-Custom-Header": "value"
|
|
@@ -91,8 +77,8 @@ const agent = new Agent({
|
|
|
91
77
|
model: ({ requestContext }) => {
|
|
92
78
|
const useAdvanced = requestContext.task === "complex";
|
|
93
79
|
return useAdvanced
|
|
94
|
-
? "routing-run/
|
|
95
|
-
: "routing-run/
|
|
80
|
+
? "routing-run/qwen3.5-9b"
|
|
81
|
+
: "routing-run/claude-opus-4-8";
|
|
96
82
|
}
|
|
97
83
|
});
|
|
98
84
|
```
|
|
@@ -37,13 +37,13 @@ for await (const chunk of stream) {
|
|
|
37
37
|
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
38
|
| ---------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
39
|
| `the-grid-ai/agent-max` | 1.0M | | | | | | — | — |
|
|
40
|
-
| `the-grid-ai/agent-prime` |
|
|
40
|
+
| `the-grid-ai/agent-prime` | 197K | | | | | | — | — |
|
|
41
41
|
| `the-grid-ai/agent-standard` | 128K | | | | | | — | — |
|
|
42
42
|
| `the-grid-ai/code-max` | 1.0M | | | | | | — | — |
|
|
43
|
-
| `the-grid-ai/code-prime` |
|
|
43
|
+
| `the-grid-ai/code-prime` | 197K | | | | | | — | — |
|
|
44
44
|
| `the-grid-ai/code-standard` | 128K | | | | | | — | — |
|
|
45
45
|
| `the-grid-ai/text-max` | 1.0M | | | | | | — | — |
|
|
46
|
-
| `the-grid-ai/text-prime` |
|
|
46
|
+
| `the-grid-ai/text-prime` | 197K | | | | | | — | — |
|
|
47
47
|
| `the-grid-ai/text-standard` | 128K | | | | | | — | — |
|
|
48
48
|
|
|
49
49
|
## Advanced configuration
|
|
@@ -35,6 +35,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
35
35
|
- [Cloudflare Workers AI](https://mastra.ai/models/providers/cloudflare-workers-ai)
|
|
36
36
|
- [Cortecs](https://mastra.ai/models/providers/cortecs)
|
|
37
37
|
- [CrofAI](https://mastra.ai/models/providers/crof)
|
|
38
|
+
- [CrossModel](https://mastra.ai/models/providers/crossmodel)
|
|
38
39
|
- [D.Run (China)](https://mastra.ai/models/providers/drun)
|
|
39
40
|
- [Databricks](https://mastra.ai/models/providers/databricks)
|
|
40
41
|
- [Deep Infra](https://mastra.ai/models/providers/deepinfra)
|
|
@@ -69,6 +70,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
69
70
|
- [LongCat](https://mastra.ai/models/providers/longcat)
|
|
70
71
|
- [LucidQuery](https://mastra.ai/models/providers/lucidquery)
|
|
71
72
|
- [Meganova](https://mastra.ai/models/providers/meganova)
|
|
73
|
+
- [Meta](https://mastra.ai/models/providers/meta)
|
|
72
74
|
- [MiniMax (minimax.io)](https://mastra.ai/models/providers/minimax)
|
|
73
75
|
- [MiniMax (minimaxi.com)](https://mastra.ai/models/providers/minimax-cn)
|
|
74
76
|
- [MiniMax Token Plan (minimax.io)](https://mastra.ai/models/providers/minimax-coding-plan)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**Added in:** `@mastra/core@1.22.0`
|
|
6
6
|
|
|
7
|
-
Channels connect agents to messaging platforms. Configure them via the `channels` property on the `Agent` constructor. The object you pass is a `ChannelConfig`. See the [Channels
|
|
7
|
+
Channels connect agents to messaging platforms. Configure them via the `channels` property on the `Agent` constructor. The object you pass is a `ChannelConfig`. See the [Channels overview](https://mastra.ai/docs/capabilities/channels/overview) for concepts and platform setup instructions.
|
|
8
8
|
|
|
9
9
|
## Usage example
|
|
10
10
|
|
|
@@ -291,6 +291,6 @@ type InlineLinkEntry =
|
|
|
291
291
|
|
|
292
292
|
## Related
|
|
293
293
|
|
|
294
|
-
- [Channels
|
|
294
|
+
- [Channels overview](https://mastra.ai/docs/capabilities/channels/overview): Concepts, quickstart, and platform setup
|
|
295
295
|
- [Agent class](https://mastra.ai/reference/agents/agent): Constructor parameters and methods
|
|
296
296
|
- [Chat SDK adapters](https://chat-sdk.dev/adapters): Adapter configuration and platform setup
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# SlackProvider
|
|
4
4
|
|
|
5
|
-
`SlackProvider` is the managed path for connecting agents to Slack. Register it on `Mastra.channels` and it provisions Slack apps via the Manifest API, runs the OAuth install flow, rotates configuration tokens, and routes Slack events to your agents. Use it when you want Mastra to own app creation and installation. For the lower-level path where you create the Slack app and configure scopes and webhooks yourself, use [`createSlackAdapter`](https://mastra.ai/docs/
|
|
5
|
+
`SlackProvider` is the managed path for connecting agents to Slack. Register it on `Mastra.channels` and it provisions Slack apps via the Manifest API, runs the OAuth install flow, rotates configuration tokens, and routes Slack events to your agents. Use it when you want Mastra to own app creation and installation. For the lower-level path where you create the Slack app and configure scopes and webhooks yourself, use [`createSlackAdapter`](https://mastra.ai/docs/capabilities/channels/slack) on the agent's `channels.adapters` instead.
|
|
6
6
|
|
|
7
7
|
## Usage example
|
|
8
8
|
|
|
@@ -224,5 +224,5 @@ const result = await slack.connect('support-agent')
|
|
|
224
224
|
## Related
|
|
225
225
|
|
|
226
226
|
- [ChannelProvider](https://mastra.ai/reference/channels/channel-provider): the interface `SlackProvider` implements
|
|
227
|
-
- [Channels](https://mastra.ai/docs/
|
|
227
|
+
- [Channels](https://mastra.ai/docs/capabilities/channels/overview): concepts, platform setup, and the `createSlackAdapter` path
|
|
228
228
|
- [Channels reference](https://mastra.ai/reference/agents/channels): the `channels` config on the `Agent` constructor
|
|
@@ -736,6 +736,7 @@ Runs database migrations to update your storage schema. This command is useful w
|
|
|
736
736
|
The command bundles your project, connects to your configured storage backend, and executes any pending migrations. Currently supports:
|
|
737
737
|
|
|
738
738
|
- **Duplicate spans migration**: Removes duplicate `(traceId, spanId)` entries and adds a unique constraint to ensure data integrity.
|
|
739
|
+
- **ClickHouse legacy-to-vNext span migration**: Copies historical spans from the legacy `mastra_ai_spans` table to the vNext `mastra_span_events` schema. Runs in batches to stay within memory limits. See the [ClickHouse storage reference](https://mastra.ai/reference/storage/clickhouse) for details.
|
|
739
740
|
|
|
740
741
|
```bash
|
|
741
742
|
mastra migrate
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# config.ts
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
## What belongs in `config.ts`
|
|
8
|
+
|
|
9
|
+
`config.ts` is the required entry point for a file-based agent's model and runtime options. Put agent-level settings here when they don't need their own file, such as the model, description, default execution options, retry behavior, scorers, and display identity.
|
|
10
|
+
|
|
11
|
+
Keep adjacent concerns in sibling files when you want file-based routing to merge them into the agent. For example, use `instructions.md` for the always-on prompt and `tools/` for model-callable actions.
|
|
12
|
+
|
|
13
|
+
## Quickstart
|
|
14
|
+
|
|
15
|
+
The following `config.ts` plus an `instructions.md` file creates a working file-based agent:
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { agentConfig } from '@mastra/core/agent'
|
|
19
|
+
|
|
20
|
+
export default agentConfig({
|
|
21
|
+
model: 'openai/gpt-5.5',
|
|
22
|
+
})
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```markdown
|
|
26
|
+
You are a helpful weather assistant. Answer questions about current conditions and forecasts.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Mastra uses the `weather` directory name as the default agent `id` and `name`. The sibling `instructions.md` supplies the required instructions.
|
|
30
|
+
|
|
31
|
+
## Set the model
|
|
32
|
+
|
|
33
|
+
The `model` field is the only required field in `agentConfig()`. The build fails when an agent directory doesn't provide a model. Other capabilities either come from sibling files or have defaults.
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { agentConfig } from '@mastra/core/agent'
|
|
37
|
+
|
|
38
|
+
export default agentConfig({
|
|
39
|
+
model: 'openai/gpt-5.5',
|
|
40
|
+
})
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Identity from the directory
|
|
44
|
+
|
|
45
|
+
A file-based agent's `id` and `name` default to the directory name. For `src/mastra/agents/weather/`, Mastra registers the agent as `weather` unless you override those fields.
|
|
46
|
+
|
|
47
|
+
Override `id` or `name` when the stable routing key and the display name should differ.
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import { agentConfig } from '@mastra/core/agent'
|
|
51
|
+
|
|
52
|
+
export default agentConfig({
|
|
53
|
+
id: 'weather-assistant',
|
|
54
|
+
name: 'Weather Assistant',
|
|
55
|
+
model: 'openai/gpt-5.5',
|
|
56
|
+
})
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Set runtime options
|
|
60
|
+
|
|
61
|
+
`agentConfig()` accepts [`Agent` constructor options](https://mastra.ai/reference/agents/agent), except that `id`, `name`, and sibling-file fields can be supplied by the file-based convention. Use the Agent reference for the full option list.
|
|
62
|
+
|
|
63
|
+
Please note:
|
|
64
|
+
|
|
65
|
+
- File-based subagents require a non-empty `description` because the parent model uses it for delegation routing.
|
|
66
|
+
- `defaultOptions`, `maxRetries`, `scorers`, and other Agent options can live in `config.ts` when they don't need their own file.
|
|
67
|
+
|
|
68
|
+
## Where adjacent settings live
|
|
69
|
+
|
|
70
|
+
Keep `config.ts` focused on runtime options. Use sibling files for concerns that benefit from their own location.
|
|
71
|
+
|
|
72
|
+
| Setting | File or folder | Why it lives there |
|
|
73
|
+
| ------------ | ------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
|
|
74
|
+
| Instructions | [`instructions.md`](https://mastra.ai/reference/file-based-agents/instructions) | Keeps the always-on prompt readable as markdown |
|
|
75
|
+
| Tools | [`tools/`](https://mastra.ai/reference/file-based-agents/tools) | Gives each callable action its own typed module |
|
|
76
|
+
| Skills | [`skills/`](https://mastra.ai/reference/file-based-agents/skills) | Keeps load-on-demand procedures separate from always-on instructions |
|
|
77
|
+
| Memory | [`memory.ts`](https://mastra.ai/reference/file-based-agents/memory) | Configures persistent memory without crowding runtime options |
|
|
78
|
+
| Workspace | [`workspace.ts`](https://mastra.ai/reference/file-based-agents/workspace) | Configures files and sandbox behavior separately from model settings |
|
|
79
|
+
| Processors | [`processors/`](https://mastra.ai/reference/file-based-agents/processors) | Separates input and output processing pipelines |
|
|
80
|
+
| Subagents | [`subagents/`](https://mastra.ai/reference/file-based-agents/subagents) | Gives each specialist child agent its own directory |
|
|
81
|
+
|
|
82
|
+
## Precedence
|
|
83
|
+
|
|
84
|
+
`config.ts` merges with the agent's other files according to these rules:
|
|
85
|
+
|
|
86
|
+
| Domain | Source A | Source B | Winner |
|
|
87
|
+
| ------------ | ----------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------- |
|
|
88
|
+
| Instructions | Dynamic `config.instructions` | [`instructions.md`](https://mastra.ai/reference/file-based-agents/instructions) | Dynamic `config.instructions` |
|
|
89
|
+
| Instructions | Static `config.instructions` | [`instructions.md`](https://mastra.ai/reference/file-based-agents/instructions) | `instructions.md` |
|
|
90
|
+
| Tools | `config.tools` | [`tools/`](https://mastra.ai/reference/file-based-agents/tools) | Both merge; `config.tools` wins on key collisions |
|
|
91
|
+
| Tools | Function `config.tools` | [`tools/`](https://mastra.ai/reference/file-based-agents/tools) | Function `config.tools`; discovered tools are ignored |
|
|
92
|
+
| Skills | `config.skills` | [`skills/`](https://mastra.ai/reference/file-based-agents/skills) | Both merge; `config.skills` wins on name collisions |
|
|
93
|
+
| Skills | Function `config.skills` | [`skills/`](https://mastra.ai/reference/file-based-agents/skills) | Function `config.skills`; discovered skills are ignored |
|
|
94
|
+
| Memory | `config.memory` | [`memory.ts`](https://mastra.ai/reference/file-based-agents/memory) | `config.memory` |
|
|
95
|
+
| Workspace | `config.workspace` | [`workspace.ts`](https://mastra.ai/reference/file-based-agents/workspace) | `config.workspace` |
|
|
96
|
+
|
|
97
|
+
Missing both `instructions.md` and `config.instructions` fails the build. Missing both `config.memory` and `memory.ts` leaves the agent without memory.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Instructions
|
|
4
|
+
|
|
5
|
+
An agent's `instructions.md` holds its always-on system prompt: the model reads it on every turn. Use it to define the agent's identity, tone, role, and standing rules.
|
|
6
|
+
|
|
7
|
+
Instructions are always in context, so keep them for stable behavior that applies to every request. Move anything conditional, large, or action-oriented out of `instructions.md` and into [`tools/`](https://mastra.ai/reference/file-based-agents/tools) or [`skills/`](https://mastra.ai/reference/file-based-agents/skills), which the model uses only when relevant.
|
|
8
|
+
|
|
9
|
+
## Quickstart
|
|
10
|
+
|
|
11
|
+
Add an `instructions.md` at the agent root. Whatever you write becomes the prompt, so the shortest version is a single sentence.
|
|
12
|
+
|
|
13
|
+
```markdown
|
|
14
|
+
You are a helpful weather assistant. Answer questions about current conditions and forecasts.
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## What goes in instructions
|
|
18
|
+
|
|
19
|
+
Effective instructions cover the parts of an agent's behavior that don't change between requests:
|
|
20
|
+
|
|
21
|
+
- Role and identity
|
|
22
|
+
- Tone and style
|
|
23
|
+
- Standing rules
|
|
24
|
+
- Output format
|
|
25
|
+
|
|
26
|
+
Move conditional, large, or action-oriented guidance into [`tools/`](https://mastra.ai/reference/file-based-agents/tools) or [`skills/`](https://mastra.ai/reference/file-based-agents/skills), which the model uses only when relevant.
|
|
27
|
+
|
|
28
|
+
## Dynamic instructions
|
|
29
|
+
|
|
30
|
+
When the prompt needs to change per request, for example based on the current user or runtime context, set a dynamic `instructions` function in [`config.ts`](https://mastra.ai/reference/file-based-agents/config) instead of using `instructions.md`. A function `instructions` wins over `instructions.md`, so the static file is ignored when both are present.
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { agentConfig } from '@mastra/core/agent'
|
|
34
|
+
|
|
35
|
+
export default agentConfig({
|
|
36
|
+
model: 'openai/gpt-5.5',
|
|
37
|
+
instructions: ({ runtimeContext }) => {
|
|
38
|
+
const tier = runtimeContext.get('tier') ?? 'standard'
|
|
39
|
+
return `You are a support agent. Treat this as a ${tier}-tier customer.`
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Build-time behavior
|
|
45
|
+
|
|
46
|
+
Mastra reads `instructions.md` and inlines its contents into the generated code when the bundler builds your project. The deployed agent doesn't read the file at runtime, so changes to `instructions.md` take effect only after the next build.
|
|
47
|
+
|
|
48
|
+
## Precedence with config
|
|
49
|
+
|
|
50
|
+
Instructions can come from `instructions.md` or from the `instructions` field in [`config.ts`](https://mastra.ai/reference/file-based-agents/config):
|
|
51
|
+
|
|
52
|
+
- A dynamic (function) `instructions` in `config.ts` wins over `instructions.md`.
|
|
53
|
+
- Otherwise `instructions.md` wins over a static `instructions` string.
|
|
54
|
+
- If neither is present, the build fails and names the agent directory.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Memory
|
|
4
|
+
|
|
5
|
+
A file-based agent gets [memory](https://mastra.ai/docs/memory/overview) from a `memory.ts` file that default-exports a [`Memory`](https://mastra.ai/reference/memory/memory-class) instance. Use this page for the file-based convention; use the memory docs for message history, semantic recall, storage, and processors.
|
|
6
|
+
|
|
7
|
+
Without `memory.ts` or `config.memory`, the agent has no memory by default. Each `generate()` or `stream()` call starts without remembered conversation state unless you pass the prior context yourself.
|
|
8
|
+
|
|
9
|
+
## Quickstart
|
|
10
|
+
|
|
11
|
+
Create `memory.ts` next to the agent's `config.ts`:
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Memory } from '@mastra/memory'
|
|
15
|
+
|
|
16
|
+
export default new Memory()
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The exported instance becomes the agent's `memory`. If your app configures a storage provider on the main Mastra instance, memory data is stored there. See [storage](https://mastra.ai/docs/storage/overview) for more information.
|
|
20
|
+
|
|
21
|
+
Use the same `resource` and `thread` values when calling the agent to continue a conversation:
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
const response = await weatherAgent.generate('Remember that I prefer Celsius.', {
|
|
25
|
+
memory: {
|
|
26
|
+
resource: 'user-123',
|
|
27
|
+
thread: 'weather-chat',
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Configure memory
|
|
33
|
+
|
|
34
|
+
Pass options to `new Memory()` when the default behavior isn't enough.
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { Memory } from '@mastra/memory'
|
|
38
|
+
|
|
39
|
+
export default new Memory({
|
|
40
|
+
options: {
|
|
41
|
+
lastMessages: 20,
|
|
42
|
+
workingMemory: {
|
|
43
|
+
enabled: true,
|
|
44
|
+
scope: 'resource',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
})
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Visit the [`Memory` reference](https://mastra.ai/reference/memory/memory-class) for constructor options. Use these pages for related memory features:
|
|
51
|
+
|
|
52
|
+
- [Storage](https://mastra.ai/docs/storage/overview): configure persistence for memory data.
|
|
53
|
+
- [Semantic recall](https://mastra.ai/docs/memory/semantic-recall): retrieve relevant past messages by semantic meaning.
|
|
54
|
+
- [Memory processors](https://mastra.ai/docs/memory/memory-processors): filter, trim, or transform messages before memory adds them to model context.
|
|
55
|
+
|
|
56
|
+
## Precedence with config
|
|
57
|
+
|
|
58
|
+
`config.memory` wins over `memory.ts`. If neither is present, the assembled file-based agent has no memory. See [`config.ts` precedence](https://mastra.ai/reference/file-based-agents/config) for the full merge table.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Observability
|
|
4
|
+
|
|
5
|
+
Mastra configures [observability](https://mastra.ai/docs/observability/overview) from an `observability.ts` file directly under `src/mastra/`. The file default-exports an `Observability` instance that sets up tracing, logging, metrics, and feedback for the project.
|
|
6
|
+
|
|
7
|
+
Use this page for the file-based convention. For the signal model, exporters, storage, and multi-config setup, see [Observability overview](https://mastra.ai/docs/observability/overview) and [Observability configuration](https://mastra.ai/docs/observability/config).
|
|
8
|
+
|
|
9
|
+
## Quickstart
|
|
10
|
+
|
|
11
|
+
Create `src/mastra/observability.ts` and default-export an `Observability` instance:
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { MastraStorageExporter, Observability } from '@mastra/observability'
|
|
15
|
+
|
|
16
|
+
export default new Observability({
|
|
17
|
+
configs: {
|
|
18
|
+
default: {
|
|
19
|
+
serviceName: 'mastra',
|
|
20
|
+
exporters: [new MastraStorageExporter()],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Observability and storage
|
|
27
|
+
|
|
28
|
+
`observability.ts` configures which signals are collected and where they're exported. [`storage.ts`](https://mastra.ai/reference/file-based-agents/storage) configures the project store that can persist observability records. For storage support by signal, see [Observability storage](https://mastra.ai/docs/observability/storage).
|
|
29
|
+
|
|
30
|
+
## Precedence with code
|
|
31
|
+
|
|
32
|
+
Code-registered observability wins over `observability.ts`. Use `observability.ts` when one project-wide configuration is enough; use code registration when setup depends on runtime wiring in `src/mastra/index.ts`.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Processors
|
|
4
|
+
|
|
5
|
+
A file-based agent discovers [processors](https://mastra.ai/docs/agents/processors) from its `processors/` directory. Use this page for the file-based convention; use the processors guide for built-in processors, custom processors, streaming behavior, and advanced patterns.
|
|
6
|
+
|
|
7
|
+
Files under `processors/input/` run before messages reach the model. Files under `processors/output/` run after the model responds. Each file default-exports one [`Processor`](https://mastra.ai/reference/processors/processor-interface), and the filename becomes its discovery key.
|
|
8
|
+
|
|
9
|
+
## Quickstart
|
|
10
|
+
|
|
11
|
+
Add an input processor by placing a processor file under `processors/input/`:
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { PIIDetector } from '@mastra/core/processors'
|
|
15
|
+
|
|
16
|
+
export default new PIIDetector({
|
|
17
|
+
strategy: 'block',
|
|
18
|
+
})
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This processor runs before user messages reach the model.
|
|
22
|
+
|
|
23
|
+
## Add an output processor
|
|
24
|
+
|
|
25
|
+
Output processors are good for filtering or transforming model responses before they're returned. This example redacts PII from the final response.
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { PIIDetector } from '@mastra/core/processors'
|
|
29
|
+
|
|
30
|
+
export default new PIIDetector({
|
|
31
|
+
strategy: 'redact',
|
|
32
|
+
})
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Ordering
|
|
36
|
+
|
|
37
|
+
Discovered processors are added after any processors defined in [`config.ts`](https://mastra.ai/reference/file-based-agents/config). That means config processors run first.
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
config.inputProcessors → processors/input/* → model
|
|
41
|
+
model → config.outputProcessors → processors/output/* → response
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If `config.inputProcessors` or `config.outputProcessors` is a function, discovered processors of that type are ignored with a warning because function-valued processors can't be statically merged.
|
|
45
|
+
|
|
46
|
+
## Precedence with config
|
|
47
|
+
|
|
48
|
+
Use `config.ts` for processors that need to be created dynamically or shared across agents. Use file-based processors for static, per-agent processors that should be reviewed alongside the agent.
|
|
49
|
+
|
|
50
|
+
Precedence is:
|
|
51
|
+
|
|
52
|
+
1. Function-valued `config.inputProcessors` or `config.outputProcessors`
|
|
53
|
+
2. Array-valued `config.inputProcessors` or `config.outputProcessors`
|
|
54
|
+
3. Discovered files under `processors/input/` or `processors/output/`
|
|
55
|
+
|
|
56
|
+
Visit the [`Processor` reference](https://mastra.ai/reference/processors/processor-interface) for the full interface.
|