@mastra/mcp-docs-server 1.2.24-alpha.16 → 1.2.24-alpha.18
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/harness/durable-agents.md +11 -0
- package/.docs/models/gateways/openrouter.md +1 -3
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/edenai.md +4 -4
- package/.docs/models/providers/fireworks-ai.md +2 -1
- package/.docs/models/providers/hyper.md +3 -3
- package/.docs/models/providers/kilo.md +3 -5
- package/.docs/models/providers/nano-gpt.md +5 -4
- package/.docs/models/providers/vivgrid.md +8 -4
- package/.docs/reference/agents/durable-agent.md +7 -1
- package/.docs/reference/tools/graph-rag-tool.md +3 -1
- package/.docs/reference/tools/vector-query-tool.md +4 -2
- package/package.json +5 -5
|
@@ -189,6 +189,17 @@ export const durableAgent = createDurableAgent({
|
|
|
189
189
|
|
|
190
190
|
`createInngestAgent()` doesn't enable caching by default. Pass a `cache` option or register the agent with a `Mastra` instance that has a `serverCache` configured to enable resumable streams.
|
|
191
191
|
|
|
192
|
+
For cached topics, each published event is recorded in the cache before it's delivered live, so publish latency is bounded by the round-trip to the cache. If the cache write fails, the event is still delivered live but can't be replayed. `@mastra/redis` and `@mastra/valkey` record each event in a single round-trip using a Lua script. `@mastra/redis` falls back to separate commands when the client has no `evalScript` or when Redis Cluster rejects the multi-key script. Per-run workflow watch events (`workflow.events.v2.*`) are never cached. If the cache is remote (for example, in another region) and you don't need to resume a topic, use `shouldCache` to publish that topic straight through:
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
export const durableAgent = createDurableAgent({
|
|
196
|
+
agent,
|
|
197
|
+
cache,
|
|
198
|
+
// Skip the replay cache for the per-chunk stream topic; other topics stay resumable.
|
|
199
|
+
shouldCache: topic => !topic.startsWith('agent.stream.'),
|
|
200
|
+
})
|
|
201
|
+
```
|
|
202
|
+
|
|
192
203
|
## Streaming with background tasks
|
|
193
204
|
|
|
194
205
|
Durable agents support the same [`untilIdle`](https://mastra.ai/reference/streaming/agents/stream) option as regular agents. When `untilIdle` is set, `stream()` keeps the connection open across background-task continuations until the agent is idle:
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# OpenRouter
|
|
6
6
|
|
|
7
|
-
OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access
|
|
7
|
+
OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 358 models through Mastra's model router.
|
|
8
8
|
|
|
9
9
|
Learn more in the [OpenRouter documentation](https://openrouter.ai/models).
|
|
10
10
|
|
|
@@ -174,9 +174,7 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
174
174
|
| `minimax/minimax-m2.1` |
|
|
175
175
|
| `minimax/minimax-m2.5` |
|
|
176
176
|
| `minimax/minimax-m2.7` |
|
|
177
|
-
| `minimax/minimax-m2.7:free` |
|
|
178
177
|
| `minimax/minimax-m3` |
|
|
179
|
-
| `minimax/minimax-m3:free` |
|
|
180
178
|
| `mistralai/codestral-2508` |
|
|
181
179
|
| `mistralai/devstral-2512` |
|
|
182
180
|
| `mistralai/ministral-14b-2512` |
|
package/.docs/models/index.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Model Providers
|
|
6
6
|
|
|
7
|
-
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to
|
|
7
|
+
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 7098 models from 200 providers through a single API.
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
@@ -111,7 +111,7 @@ for await (const chunk of stream) {
|
|
|
111
111
|
| `edenai/fireworks_ai/accounts/fireworks/models/inkling` | 1.0M | | | | | | $1 | $4 |
|
|
112
112
|
| `edenai/fireworks_ai/accounts/fireworks/models/muse-glimmer-30b` | 131K | | | | | | $0.35 | $2 |
|
|
113
113
|
| `edenai/fireworks_ai/gpt-oss-120b` | 131K | | | | | | $0.15 | $0.60 |
|
|
114
|
-
| `edenai/flexai/
|
|
114
|
+
| `edenai/flexai/DeepSeek-V4-Flash-0731` | 786K | | | | | | $0.03 | $0.10 |
|
|
115
115
|
| `edenai/flexai/gpt-oss-120b` | 131K | | | | | | $0.04 | $0.10 |
|
|
116
116
|
| `edenai/flexai/gpt-oss-20b` | 131K | | | | | | $0.02 | $0.10 |
|
|
117
117
|
| `edenai/flexai/Muse-Glimmer-30B` | 131K | | | | | | $0.30 | $1 |
|
|
@@ -147,7 +147,7 @@ for await (const chunk of stream) {
|
|
|
147
147
|
| `edenai/mistral/codestral-latest` | 256K | | | | | | $0.30 | $0.90 |
|
|
148
148
|
| `edenai/mistral/devstral-2512` | 262K | | | | | | $0.40 | $2 |
|
|
149
149
|
| `edenai/mistral/devstral-medium-latest` | 262K | | | | | | $0.40 | $2 |
|
|
150
|
-
| `edenai/mistral/magistral-medium-latest` | 262K | | | | | | $2 | $
|
|
150
|
+
| `edenai/mistral/magistral-medium-latest` | 262K | | | | | | $2 | $8 |
|
|
151
151
|
| `edenai/mistral/mistral-large-2512` | 262K | | | | | | $0.50 | $2 |
|
|
152
152
|
| `edenai/mistral/mistral-large-latest` | 262K | | | | | | $2 | $6 |
|
|
153
153
|
| `edenai/mistral/mistral-medium-2505` | 131K | | | | | | $0.40 | $2 |
|
|
@@ -208,8 +208,8 @@ for await (const chunk of stream) {
|
|
|
208
208
|
| `edenai/perplexityai/sonar-deep-research` | 128K | | | | | | $2 | $8 |
|
|
209
209
|
| `edenai/perplexityai/sonar-pro` | 200K | | | | | | $3 | $15 |
|
|
210
210
|
| `edenai/perplexityai/sonar-reasoning-pro` | 128K | | | | | | $2 | $8 |
|
|
211
|
-
| `edenai/qwen/deepseek-v4-flash-0731` | 1.0M | | | | | | $0.
|
|
212
|
-
| `edenai/qwen/deepseek-v4-pro-0813` | 1.0M | | | | | | $
|
|
211
|
+
| `edenai/qwen/deepseek-v4-flash-0731` | 1.0M | | | | | | $0.18 | $0.53 |
|
|
212
|
+
| `edenai/qwen/deepseek-v4-pro-0813` | 1.0M | | | | | | $0.58 | $2 |
|
|
213
213
|
| `edenai/qwen/qwen-max` | 33K | | | | | | $2 | $6 |
|
|
214
214
|
| `edenai/qwen/qwen-vl-max` | 131K | | | | | | $0.80 | $3 |
|
|
215
215
|
| `edenai/qwen/qwen-vl-plus` | 131K | | | | | | $0.21 | $0.63 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Fireworks AI
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 21 Fireworks AI models through Mastra's model router. Authentication is handled automatically using the `FIREWORKS_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Fireworks AI documentation](https://fireworks.ai/docs/).
|
|
10
10
|
|
|
@@ -57,6 +57,7 @@ for await (const chunk of stream) {
|
|
|
57
57
|
| `fireworks-ai/accounts/fireworks/models/qwen3p8-2p4t-a95b` | 262K | | | | | | $2 | $6 |
|
|
58
58
|
| `fireworks-ai/accounts/fireworks/models/qwen3p8-max` | 262K | | | | | | $2 | $6 |
|
|
59
59
|
| `fireworks-ai/accounts/fireworks/routers/glm-5p2-fast` | 1.0M | | | | | | $2 | $7 |
|
|
60
|
+
| `fireworks-ai/accounts/fireworks/routers/glm-5p3-fast` | 1.0M | | | | | | $2 | $7 |
|
|
60
61
|
| `fireworks-ai/accounts/fireworks/routers/kimi-k3-fast` | 1.0M | | | | | | $5 | $23 |
|
|
61
62
|
|
|
62
63
|
Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
|
|
@@ -42,7 +42,7 @@ for await (const chunk of stream) {
|
|
|
42
42
|
| `hyper/deepseek-v4-flash-0731` | 1.0M | | | | | | $0.44 | $1 |
|
|
43
43
|
| `hyper/deepseek-v4-pro` | 1.0M | | | | | | $2 | $5 |
|
|
44
44
|
| `hyper/deepseek-v4-pro-0813` | 1.0M | | | | | | $1 | $4 |
|
|
45
|
-
| `hyper/gemma-4-26b-a4b-it` | 256K | | | | | | $0.11 | $0.
|
|
45
|
+
| `hyper/gemma-4-26b-a4b-it` | 256K | | | | | | $0.11 | $0.41 |
|
|
46
46
|
| `hyper/glm-5` | 203K | | | | | | $0.86 | $3 |
|
|
47
47
|
| `hyper/glm-5.1` | 203K | | | | | | $1 | $4 |
|
|
48
48
|
| `hyper/glm-5.2` | 1.0M | | | | | | $2 | $5 |
|
|
@@ -51,13 +51,13 @@ for await (const chunk of stream) {
|
|
|
51
51
|
| `hyper/gpt-oss-120b` | 128K | | | | | | $0.19 | $0.70 |
|
|
52
52
|
| `hyper/inkling` | 1.0M | | | | | | $1 | $4 |
|
|
53
53
|
| `hyper/kimi-k2-thinking` | 262K | | | | | | $0.60 | $3 |
|
|
54
|
-
| `hyper/kimi-k2.5` | 262K | | | | | | $0.
|
|
54
|
+
| `hyper/kimi-k2.5` | 262K | | | | | | $0.56 | $3 |
|
|
55
55
|
| `hyper/kimi-k2.6` | 262K | | | | | | $1 | $4 |
|
|
56
56
|
| `hyper/kimi-k2.7-code` | 262K | | | | | | $1 | $4 |
|
|
57
57
|
| `hyper/kimi-k3` | 1.0M | | | | | | $3 | $16 |
|
|
58
58
|
| `hyper/llama-3.3-70b-instruct` | 128K | | | | | | $0.61 | $1 |
|
|
59
59
|
| `hyper/llama-4-maverick-17b-128e-instruct-fp8` | 430K | | | | | | $0.27 | $0.90 |
|
|
60
|
-
| `hyper/minimax-m2.7` | 262K | | | | | | $0.
|
|
60
|
+
| `hyper/minimax-m2.7` | 262K | | | | | | $0.47 | $2 |
|
|
61
61
|
| `hyper/minimax-m3` | 512K | | | | | | $0.33 | $1 |
|
|
62
62
|
| `hyper/qwen3-coder-480b-a35b-instruct-int4-mixed-ar` | 106K | | | | | | $0.45 | $2 |
|
|
63
63
|
| `hyper/qwen3-next-80b-a3b-instruct` | 262K | | | | | | $0.12 | $1 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Kilo Gateway
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 367 Kilo Gateway models through Mastra's model router. Authentication is handled automatically using the `KILO_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Kilo Gateway documentation](https://kilo.ai).
|
|
10
10
|
|
|
@@ -45,7 +45,7 @@ for await (const chunk of stream) {
|
|
|
45
45
|
| `kilo/~deepseek/deepseek-v4-flash-latest` | 1.0M | | | | | | $0.05 | $0.16 |
|
|
46
46
|
| `kilo/~google/gemini-flash-latest` | 1.0M | | | | | | $0.75 | $4 |
|
|
47
47
|
| `kilo/~google/gemini-pro-latest` | 1.0M | | | | | | $2 | $12 |
|
|
48
|
-
| `kilo/~moonshotai/kimi-latest` | 1.0M | | | | | | $3 | $
|
|
48
|
+
| `kilo/~moonshotai/kimi-latest` | 1.0M | | | | | | $3 | $14 |
|
|
49
49
|
| `kilo/~openai/gpt-latest` | 1.1M | | | | | | $2 | $10 |
|
|
50
50
|
| `kilo/~openai/gpt-mini-latest` | 400K | | | | | | $0.75 | $5 |
|
|
51
51
|
| `kilo/~x-ai/grok-latest` | 500K | | | | | | $2 | $6 |
|
|
@@ -177,9 +177,7 @@ for await (const chunk of stream) {
|
|
|
177
177
|
| `kilo/minimax/minimax-m2.1` | 205K | | | | | | $0.30 | $1 |
|
|
178
178
|
| `kilo/minimax/minimax-m2.5` | 200K | | | | | | $0.30 | $1 |
|
|
179
179
|
| `kilo/minimax/minimax-m2.7` | 205K | | | | | | $0.30 | $1 |
|
|
180
|
-
| `kilo/minimax/minimax-m2.7:free` | 197K | | | | | | — | — |
|
|
181
180
|
| `kilo/minimax/minimax-m3` | 524K | | | | | | $0.30 | $1 |
|
|
182
|
-
| `kilo/minimax/minimax-m3:free` | 1.0M | | | | | | — | — |
|
|
183
181
|
| `kilo/mistralai/codestral-2508` | 256K | | | | | | $0.30 | $0.90 |
|
|
184
182
|
| `kilo/mistralai/devstral-2512` | 262K | | | | | | $0.40 | $2 |
|
|
185
183
|
| `kilo/mistralai/ministral-14b-2512` | 262K | | | | | | $0.20 | $0.20 |
|
|
@@ -371,7 +369,7 @@ for await (const chunk of stream) {
|
|
|
371
369
|
| `kilo/tencent/hy-mt2-1.8b` | 8K | | | | | | $0.04 | $0.18 |
|
|
372
370
|
| `kilo/tencent/hy-mt2-30b-a3b` | 8K | | | | | | $0.07 | $0.29 |
|
|
373
371
|
| `kilo/tencent/hy-mt2-7b` | 8K | | | | | | $0.07 | $0.29 |
|
|
374
|
-
| `kilo/tencent/hy3` | 262K | | | | | | $0.
|
|
372
|
+
| `kilo/tencent/hy3` | 262K | | | | | | $0.08 | $0.33 |
|
|
375
373
|
| `kilo/tencent/hy3-preview` | 262K | | | | | | $0.18 | $0.60 |
|
|
376
374
|
| `kilo/tencent/hy4-preview` | 1.0M | | | | | | $0.83 | $3 |
|
|
377
375
|
| `kilo/thedrummer/cydonia-24b-v4.1` | 131K | | | | | | $0.30 | $0.50 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# NanoGPT
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 593 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
|
|
|
@@ -427,6 +427,7 @@ for await (const chunk of stream) {
|
|
|
427
427
|
| `nano-gpt/pokee-isaac` | 10.0M | | | | | | $0.15 | $1 |
|
|
428
428
|
| `nano-gpt/poolside/laguna-s-2.1` | 1.0M | | | | | | $0.10 | $0.20 |
|
|
429
429
|
| `nano-gpt/poolside/laguna-s-2.1:thinking` | 1.0M | | | | | | $0.10 | $0.20 |
|
|
430
|
+
| `nano-gpt/poolside/laguna-xs-2.1` | 262K | | | | | | $0.06 | $0.13 |
|
|
430
431
|
| `nano-gpt/qvq-max` | 128K | | | | | | $1 | $5 |
|
|
431
432
|
| `nano-gpt/qwen-3.6-plus` | 992K | | | | | | $0.33 | $2 |
|
|
432
433
|
| `nano-gpt/qwen-long` | 10.0M | | | | | | $0.10 | $0.41 |
|
|
@@ -530,8 +531,8 @@ for await (const chunk of stream) {
|
|
|
530
531
|
| `nano-gpt/TEE/gemma4-31b:thinking` | 262K | | | | | | $0.40 | $1 |
|
|
531
532
|
| `nano-gpt/TEE/glm-5.1` | 203K | | | | | | $2 | $5 |
|
|
532
533
|
| `nano-gpt/TEE/glm-5.1-thinking` | 203K | | | | | | $2 | $5 |
|
|
533
|
-
| `nano-gpt/TEE/glm-5.2` | 1.0M | | | | | | $1 | $
|
|
534
|
-
| `nano-gpt/TEE/glm-5.2:thinking` | 1.0M | | | | | | $1 | $
|
|
534
|
+
| `nano-gpt/TEE/glm-5.2` | 1.0M | | | | | | $1 | $4 |
|
|
535
|
+
| `nano-gpt/TEE/glm-5.2:thinking` | 1.0M | | | | | | $1 | $4 |
|
|
535
536
|
| `nano-gpt/TEE/glm-5.3` | 1.0M | | | | | | $1 | $4 |
|
|
536
537
|
| `nano-gpt/TEE/glm-5.3-flash` | 1.0M | | | | | | $0.15 | $0.50 |
|
|
537
538
|
| `nano-gpt/TEE/gpt-oss-120b` | 131K | | | | | | $2 | $2 |
|
|
@@ -625,7 +626,7 @@ for await (const chunk of stream) {
|
|
|
625
626
|
| `nano-gpt/z-ai/glm-5.2:thinking` | 1.0M | | | | | | $0.42 | $1 |
|
|
626
627
|
| `nano-gpt/z-ai/glm-5.3` | 1.0M | | | | | | $1 | $3 |
|
|
627
628
|
| `nano-gpt/z-ai/glm-5.3-flash` | 1.0M | | | | | | $0.07 | $0.25 |
|
|
628
|
-
| `nano-gpt/z-ai/glm-5.3-flash-uncensored` | 1.0M | | | | | | $0.
|
|
629
|
+
| `nano-gpt/z-ai/glm-5.3-flash-uncensored` | 1.0M | | | | | | $0.07 | $0.21 |
|
|
629
630
|
| `nano-gpt/z-ai/glm-5.3:thinking` | 1.0M | | | | | | $1 | $3 |
|
|
630
631
|
| `nano-gpt/z-ai/glm-5v-turbo` | 203K | | | | | | $1 | $4 |
|
|
631
632
|
| `nano-gpt/z-ai/glm-5v-turbo:thinking` | 203K | | | | | | $1 | $4 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Vivgrid
|
|
6
6
|
|
|
7
|
-
Access
|
|
7
|
+
Access 27 Vivgrid models through Mastra's model router. Authentication is handled automatically using the `VIVGRID_API_KEY` environment variable.
|
|
8
8
|
|
|
9
9
|
Learn more in the [Vivgrid documentation](https://docs.vivgrid.com/models).
|
|
10
10
|
|
|
@@ -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: "vivgrid/
|
|
22
|
+
model: "vivgrid/claude-fable-5"
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
// Generate a response
|
|
@@ -38,12 +38,16 @@ for await (const chunk of stream) {
|
|
|
38
38
|
|
|
39
39
|
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
40
40
|
| --------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
41
|
+
| `vivgrid/claude-fable-5` | 1.0M | | | | | | $10 | $50 |
|
|
42
|
+
| `vivgrid/claude-fable-5-1` | 1.0M | | | | | | $10 | $50 |
|
|
41
43
|
| `vivgrid/deepseek-v3.2` | 128K | | | | | | $0.28 | $0.42 |
|
|
42
44
|
| `vivgrid/deepseek-v4-flash` | 1.0M | | | | | | $0.15 | $0.30 |
|
|
43
45
|
| `vivgrid/deepseek-v4-pro` | 1.0M | | | | | | $0.43 | $0.87 |
|
|
46
|
+
| `vivgrid/deepseek-v4-pro-0813` | 1.0M | | | | | | $1 | $3 |
|
|
44
47
|
| `vivgrid/gemini-3.1-flash-lite-preview` | 1.0M | | | | | | $0.25 | $2 |
|
|
45
48
|
| `vivgrid/gemini-3.1-pro-preview` | 1.0M | | | | | | $2 | $12 |
|
|
46
49
|
| `vivgrid/gemini-3.7-flash` | 1.0M | | | | | | $0.75 | $4 |
|
|
50
|
+
| `vivgrid/gemini-3.8-flash` | 1.0M | | | | | | $0.75 | $4 |
|
|
47
51
|
| `vivgrid/glm-5.2` | 1.0M | | | | | | $1 | $4 |
|
|
48
52
|
| `vivgrid/glm-5.3` | 1.0M | | | | | | $1 | $4 |
|
|
49
53
|
| `vivgrid/glm-5.3-flash` | 1.0M | | | | | | $0.15 | $0.50 |
|
|
@@ -74,7 +78,7 @@ const agent = new Agent({
|
|
|
74
78
|
name: "custom-agent",
|
|
75
79
|
model: {
|
|
76
80
|
url: "https://api.vivgrid.com/v1",
|
|
77
|
-
id: "vivgrid/
|
|
81
|
+
id: "vivgrid/claude-fable-5",
|
|
78
82
|
apiKey: process.env.VIVGRID_API_KEY,
|
|
79
83
|
headers: {
|
|
80
84
|
"X-Custom-Header": "value"
|
|
@@ -93,7 +97,7 @@ const agent = new Agent({
|
|
|
93
97
|
const useAdvanced = requestContext.task === "complex";
|
|
94
98
|
return useAdvanced
|
|
95
99
|
? "vivgrid/kimi-k3"
|
|
96
|
-
: "vivgrid/
|
|
100
|
+
: "vivgrid/claude-fable-5";
|
|
97
101
|
}
|
|
98
102
|
});
|
|
99
103
|
```
|
|
@@ -43,7 +43,7 @@ cleanup()
|
|
|
43
43
|
|
|
44
44
|
### Using the `durable` config flag
|
|
45
45
|
|
|
46
|
-
Set `durable: true` on `AgentConfig` and the agent is automatically wrapped with `createDurableAgent` when it's attached to a `Mastra` instance. Use an object to forward advanced options such as `cache`, `pubsub`, `maxSteps`, or `
|
|
46
|
+
Set `durable: true` on `AgentConfig` and the agent is automatically wrapped with `createDurableAgent` when it's attached to a `Mastra` instance. Use an object to forward advanced options such as `cache`, `pubsub`, `maxSteps`, `cleanupTimeoutMs`, or `shouldCache`.
|
|
47
47
|
|
|
48
48
|
```typescript
|
|
49
49
|
import { Mastra } from '@mastra/core'
|
|
@@ -90,6 +90,8 @@ Returns: `DurableAgent`
|
|
|
90
90
|
|
|
91
91
|
**maxSteps** (`number`): Maximum number of steps for the agentic loop.
|
|
92
92
|
|
|
93
|
+
**shouldCache** (`(topic: string) => boolean`): Per-topic opt-out of the replay cache. Return false to publish a topic straight to the underlying PubSub without recording it; subscribers of that topic receive live events only and cannot resume from an offset. Useful for trading replay for minimum publish latency on hot topics when the cache is remote (for example, cross-region Redis). Run-local topics are always excluded, regardless of this option.
|
|
94
|
+
|
|
93
95
|
## `createEventedAgent(options)`
|
|
94
96
|
|
|
95
97
|
Wraps an `Agent` with fire-and-forget durable execution on the built-in workflow engine. Like `createDurableAgent`, it returns a result you stream from, but the underlying workflow runs non-blocking (via `startAsync`) instead of running to completion before the stream is wired up. Use it when you want the run to progress independently of the caller. It doesn't accept `id` or `name` overrides.
|
|
@@ -112,6 +114,8 @@ Returns: `EventedAgent` (a subclass of `DurableAgent`)
|
|
|
112
114
|
|
|
113
115
|
**maxSteps** (`number`): Maximum number of steps for the agentic loop.
|
|
114
116
|
|
|
117
|
+
**shouldCache** (`(topic: string) => boolean`): Per-topic opt-out of the replay cache. Return false to publish a topic straight to the underlying PubSub without recording it; subscribers of that topic receive live events only and cannot resume from an offset. Useful for trading replay for minimum publish latency on hot topics when the cache is remote (for example, cross-region Redis). Run-local topics are always excluded, regardless of this option.
|
|
118
|
+
|
|
115
119
|
## Constructor parameters
|
|
116
120
|
|
|
117
121
|
The `DurableAgent` class accepts the same options as `createDurableAgent`, plus `cleanupTimeoutMs`. Prefer the factory unless you need to subclass.
|
|
@@ -128,6 +132,8 @@ The `DurableAgent` class accepts the same options as `createDurableAgent`, plus
|
|
|
128
132
|
|
|
129
133
|
**maxSteps** (`number`): Maximum number of steps for the agentic loop.
|
|
130
134
|
|
|
135
|
+
**shouldCache** (`(topic: string) => boolean`): Per-topic opt-out of the replay cache. Return false to publish a topic straight to the underlying PubSub without recording it; subscribers of that topic receive live events only and cannot resume from an offset. Useful for trading replay for minimum publish latency on hot topics when the cache is remote (for example, cross-region Redis). Run-local topics are always excluded, regardless of this option.
|
|
136
|
+
|
|
131
137
|
**cleanupTimeoutMs** (`number`): Grace period in milliseconds before registry entries are cleaned up automatically after a stream finishes or errors. Set to 0 to disable auto-cleanup and require a manual cleanup() call. Auto-cleanup does not fire on suspended events. (Default: `30000`)
|
|
132
138
|
|
|
133
139
|
## Methods
|
|
@@ -61,7 +61,7 @@ const graphTool = createGraphRAGTool({
|
|
|
61
61
|
|
|
62
62
|
The tool returns an object with:
|
|
63
63
|
|
|
64
|
-
**relevantContext** (`string`):
|
|
64
|
+
**relevantContext** (`string[]`): Array of chunk text strings for the most relevant document chunks, in rank order, retrieved using graph-based ranking. Text is read from the text field of each chunk's metadata.
|
|
65
65
|
|
|
66
66
|
**sources** (`QueryResult[]`): Array of full retrieval result objects. Each object contains all information needed to reference the original document, chunk, and similarity score.
|
|
67
67
|
|
|
@@ -77,6 +77,8 @@ The tool returns an object with:
|
|
|
77
77
|
}
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
+
The graph is built from the `text` field of each result's metadata, so `document` (and `relevantContext`) contain that text. Store the chunk text under `metadata.text` when upserting.
|
|
81
|
+
|
|
80
82
|
## Default tool description
|
|
81
83
|
|
|
82
84
|
The default description focuses on:
|
|
@@ -79,7 +79,7 @@ const queryTool = createVectorQueryTool({
|
|
|
79
79
|
|
|
80
80
|
The tool returns an object with:
|
|
81
81
|
|
|
82
|
-
**relevantContext** (`
|
|
82
|
+
**relevantContext** (`any[]`): Array of metadata objects for the most relevant chunks, in rank order (one entry per result). The chunk text is available at relevantContext\[i].text when it was stored in metadata during ingestion.
|
|
83
83
|
|
|
84
84
|
**sources** (`QueryResult[]`): Array of full retrieval result objects. Each object contains all information needed to reference the original document, chunk, and similarity score.
|
|
85
85
|
|
|
@@ -95,6 +95,8 @@ The tool returns an object with:
|
|
|
95
95
|
}
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
+
`document` is only populated by vector stores whose `query()` returns document content, such as Chroma, Elasticsearch, LanceDB, and MongoDB. For other stores, such as PgVector, it's an empty string. Read the chunk text from `sources[i].metadata.text` (or whichever metadata key you stored it under).
|
|
99
|
+
|
|
98
100
|
## Default tool description
|
|
99
101
|
|
|
100
102
|
The default description focuses on:
|
|
@@ -489,7 +491,7 @@ The tool is created with:
|
|
|
489
491
|
|
|
490
492
|
- **ID**: `VectorQuery {vectorStoreName} {indexName} Tool`
|
|
491
493
|
- **Input Schema**: Requires queryText and filter objects
|
|
492
|
-
- **Output Schema**: Returns relevantContext
|
|
494
|
+
- **Output Schema**: Returns `relevantContext` (array of chunk metadata) and `sources` (array of `QueryResult`)
|
|
493
495
|
|
|
494
496
|
## Related
|
|
495
497
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.2.24-alpha.
|
|
3
|
+
"version": "1.2.24-alpha.18",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"jsdom": "^26.1.0",
|
|
28
28
|
"local-pkg": "^1.1.2",
|
|
29
29
|
"zod": "^4.4.3",
|
|
30
|
-
"@mastra/
|
|
31
|
-
"@mastra/
|
|
30
|
+
"@mastra/core": "1.65.0-alpha.9",
|
|
31
|
+
"@mastra/mcp": "^1.17.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@hono/node-server": "^2.0.0",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"typescript": "^7.0.2",
|
|
46
46
|
"vitest": "4.1.10",
|
|
47
47
|
"@internal/lint": "0.0.130",
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
48
|
+
"@internal/types-builder": "0.0.105",
|
|
49
|
+
"@mastra/core": "1.65.0-alpha.9"
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://mastra.ai",
|
|
52
52
|
"repository": {
|