@mastra/mcp-docs-server 1.1.42-alpha.8 → 1.1.43-alpha.0
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/memory.md +1 -1
- package/.docs/docs/agents/a2a.md +1 -1
- package/.docs/docs/agents/acp.md +23 -160
- package/.docs/docs/agents/adding-voice.md +7 -7
- package/.docs/docs/agents/agent-approval.md +1 -1
- package/.docs/docs/agents/background-tasks.md +2 -2
- package/.docs/docs/agents/channels.md +1 -1
- package/.docs/docs/agents/code-mode.md +3 -3
- package/.docs/docs/agents/guardrails.md +2 -2
- package/.docs/docs/agents/networks.md +1 -1
- package/.docs/docs/agents/overview.md +1 -1
- package/.docs/docs/agents/processors.md +146 -3
- package/.docs/docs/agents/sdk-agents.md +261 -0
- package/.docs/docs/agents/signals.md +230 -10
- package/.docs/docs/agents/structured-output.md +5 -5
- package/.docs/docs/agents/supervisor-agents.md +2 -2
- package/.docs/docs/agents/using-tools.md +5 -5
- package/.docs/docs/browser/agent-browser.md +1 -1
- package/.docs/docs/browser/browser-viewer.md +1 -1
- package/.docs/docs/browser/overview.md +1 -1
- package/.docs/docs/browser/stagehand.md +5 -5
- package/.docs/docs/build-with-ai/skills.md +3 -3
- package/.docs/docs/editor/overview.md +12 -11
- package/.docs/docs/evals/custom-scorers.md +1 -1
- package/.docs/docs/evals/datasets/running-experiments.md +1 -1
- package/.docs/docs/evals/overview.md +2 -2
- package/.docs/docs/getting-started/build-with-ai.md +37 -0
- package/.docs/docs/mastra-platform/observability.md +4 -4
- package/.docs/docs/mcp/mcp-apps.md +3 -3
- package/.docs/docs/mcp/overview.md +1 -1
- package/.docs/docs/memory/memory-processors.md +6 -6
- package/.docs/docs/memory/multi-user-threads.md +2 -2
- package/.docs/docs/memory/semantic-recall.md +1 -1
- package/.docs/docs/memory/storage.md +2 -1
- package/.docs/docs/memory/working-memory.md +28 -1
- package/.docs/docs/observability/metrics/querying.md +1 -1
- package/.docs/docs/observability/tracing/exporters/langfuse.md +1 -1
- package/.docs/docs/observability/tracing/exporters/langsmith.md +2 -2
- package/.docs/docs/rag/graph-rag.md +2 -2
- package/.docs/docs/rag/retrieval.md +12 -12
- package/.docs/docs/server/auth/fga.md +2 -0
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/pubsub.md +124 -0
- package/.docs/docs/server/request-context.md +3 -3
- package/.docs/docs/streaming/overview.md +1 -1
- package/.docs/docs/streaming/tool-streaming.md +1 -1
- package/.docs/docs/studio/auth.md +20 -0
- package/.docs/docs/voice/overview.md +25 -25
- package/.docs/docs/voice/speech-to-speech.md +4 -4
- package/.docs/docs/voice/speech-to-text.md +1 -1
- package/.docs/docs/voice/text-to-speech.md +1 -1
- package/.docs/docs/workspace/filesystem.md +2 -2
- package/.docs/docs/workspace/overview.md +1 -1
- package/.docs/docs/workspace/sandbox.md +1 -1
- package/.docs/guides/build-your-ui/ai-sdk-ui.md +1 -1
- package/.docs/guides/guide/ai-recruiter.md +1 -1
- package/.docs/guides/guide/chef-michel.md +1 -1
- package/.docs/guides/guide/code-review-bot.md +1 -1
- package/.docs/guides/guide/dev-assistant.md +1 -1
- package/.docs/guides/guide/docs-manager.md +1 -1
- package/.docs/guides/guide/firecrawl.md +1 -1
- package/.docs/guides/guide/github-actions-pr-description.md +1 -1
- package/.docs/guides/guide/research-assistant.md +1 -1
- package/.docs/guides/guide/research-coordinator.md +2 -2
- package/.docs/guides/guide/slack-assistant.md +1 -1
- package/.docs/guides/guide/stock-agent.md +2 -2
- package/.docs/guides/guide/whatsapp-chat-bot.md +2 -2
- package/.docs/guides/migrations/agentnetwork.md +4 -4
- package/.docs/guides/migrations/upgrade-to-v1/agent.md +1 -1
- package/.docs/guides/migrations/vnext-to-standard-apis.md +2 -2
- package/.docs/reference/acp/acp-agent.md +228 -0
- package/.docs/reference/acp/create-acp-tool.md +131 -0
- package/.docs/reference/agents/agent.md +55 -5
- package/.docs/reference/agents/channels.md +47 -5
- package/.docs/reference/agents/durable-agent.md +239 -0
- package/.docs/reference/agents/generateLegacy.md +1 -1
- package/.docs/reference/agents/getLLM.md +2 -2
- package/.docs/reference/agents/getMetadata.md +2 -2
- package/.docs/reference/agents/network.md +1 -1
- package/.docs/reference/browser/agent-browser.md +1 -1
- package/.docs/reference/browser/browser-viewer.md +1 -1
- package/.docs/reference/browser/mastra-browser.md +1 -1
- package/.docs/reference/browser/stagehand-browser.md +5 -5
- package/.docs/reference/cli/mastra.md +5 -5
- package/.docs/reference/client-js/agents.md +41 -7
- package/.docs/reference/configuration.md +1 -1
- package/.docs/reference/evals/answer-relevancy.md +1 -1
- package/.docs/reference/evals/answer-similarity.md +1 -1
- package/.docs/reference/evals/bias.md +1 -1
- package/.docs/reference/evals/context-precision.md +3 -3
- package/.docs/reference/evals/context-relevance.md +11 -11
- package/.docs/reference/evals/faithfulness.md +1 -1
- package/.docs/reference/evals/hallucination.md +5 -5
- package/.docs/reference/evals/noise-sensitivity.md +11 -11
- package/.docs/reference/evals/prompt-alignment.md +15 -15
- package/.docs/reference/evals/tool-call-accuracy.md +3 -3
- package/.docs/reference/evals/toxicity.md +1 -1
- package/.docs/reference/index.md +9 -0
- package/.docs/reference/memory/memory-class.md +3 -3
- package/.docs/reference/memory/observational-memory.md +4 -4
- package/.docs/reference/observability/tracing/exporters/langfuse.md +1 -1
- package/.docs/reference/processors/batch-parts-processor.md +1 -1
- package/.docs/reference/processors/cost-guard-processor.md +1 -1
- package/.docs/reference/processors/language-detector.md +1 -1
- package/.docs/reference/processors/message-history-processor.md +1 -1
- package/.docs/reference/processors/moderation-processor.md +2 -2
- package/.docs/reference/processors/pii-detector.md +2 -2
- package/.docs/reference/processors/prefill-error-handler.md +2 -2
- package/.docs/reference/processors/processor-interface.md +2 -2
- package/.docs/reference/processors/prompt-injection-detector.md +1 -1
- package/.docs/reference/processors/regex-filter-processor.md +1 -1
- package/.docs/reference/processors/response-cache.md +2 -2
- package/.docs/reference/processors/semantic-recall-processor.md +1 -1
- package/.docs/reference/processors/skill-search-processor.md +1 -1
- package/.docs/reference/processors/system-prompt-scrubber.md +1 -1
- package/.docs/reference/processors/token-limiter-processor.md +3 -3
- package/.docs/reference/processors/tool-call-filter.md +2 -2
- package/.docs/reference/processors/tool-search-processor.md +2 -2
- package/.docs/reference/processors/unicode-normalizer.md +1 -1
- package/.docs/reference/processors/working-memory-processor.md +1 -1
- package/.docs/reference/pubsub/base.md +168 -0
- package/.docs/reference/pubsub/caching-pubsub.md +102 -0
- package/.docs/reference/pubsub/event-emitter.md +72 -0
- package/.docs/reference/pubsub/google-cloud-pubsub.md +94 -0
- package/.docs/reference/pubsub/redis-streams.md +108 -0
- package/.docs/reference/pubsub/unix-socket-pubsub.md +52 -0
- package/.docs/reference/rag/rerank.md +1 -1
- package/.docs/reference/server/nestjs-adapter.md +1 -1
- package/.docs/reference/storage/dsql.md +1 -1
- package/.docs/reference/storage/libsql.md +6 -0
- package/.docs/reference/storage/mongodb.md +4 -1
- package/.docs/reference/storage/postgresql.md +4 -1
- package/.docs/reference/storage/redis.md +1 -1
- package/.docs/reference/storage/spanner.md +5 -0
- package/.docs/reference/storage/upstash.md +1 -1
- package/.docs/reference/streaming/agents/stream.md +1 -1
- package/.docs/reference/templates/overview.md +1 -1
- package/.docs/reference/tools/mcp-client.md +2 -2
- package/.docs/reference/tools/mcp-server.md +33 -1
- package/.docs/reference/tools/vector-query-tool.md +1 -1
- package/.docs/reference/vectors/libsql.md +1 -1
- package/.docs/reference/vectors/mongodb.md +1 -1
- package/.docs/reference/vectors/pg.md +1 -1
- package/.docs/reference/vectors/upstash.md +1 -1
- package/.docs/reference/voice/voice.addInstructions.md +1 -1
- package/.docs/reference/workspace/agentfs-filesystem.md +1 -1
- package/.docs/reference/workspace/azure-blob-filesystem.md +1 -1
- package/.docs/reference/workspace/docker-sandbox.md +1 -1
- package/.docs/reference/workspace/e2b-sandbox.md +9 -5
- package/.docs/reference/workspace/files-sdk-filesystem.md +1 -1
- package/.docs/reference/workspace/gcs-filesystem.md +1 -1
- package/.docs/reference/workspace/google-drive-filesystem.md +1 -1
- package/.docs/reference/workspace/local-filesystem.md +1 -1
- package/.docs/reference/workspace/local-sandbox.md +1 -1
- package/.docs/reference/workspace/modal-sandbox.md +1 -1
- package/.docs/reference/workspace/s3-filesystem.md +1 -1
- package/CHANGELOG.md +38 -0
- package/package.json +6 -6
- package/.docs/docs/agents/response-caching.md +0 -150
|
@@ -104,7 +104,7 @@ Use static context when you have known ground truth to compare against:
|
|
|
104
104
|
import { createHallucinationScorer } from '@mastra/evals/scorers/prebuilt'
|
|
105
105
|
|
|
106
106
|
const scorer = createHallucinationScorer({
|
|
107
|
-
model: 'openai/gpt-5.
|
|
107
|
+
model: 'openai/gpt-5.5',
|
|
108
108
|
options: {
|
|
109
109
|
context: [
|
|
110
110
|
'The first iPhone was announced on January 9, 2007.',
|
|
@@ -124,7 +124,7 @@ import { createHallucinationScorer } from '@mastra/evals/scorers/prebuilt'
|
|
|
124
124
|
import { extractToolResults } from '@mastra/evals/scorers'
|
|
125
125
|
|
|
126
126
|
const scorer = createHallucinationScorer({
|
|
127
|
-
model: 'openai/gpt-5.
|
|
127
|
+
model: 'openai/gpt-5.5',
|
|
128
128
|
options: {
|
|
129
129
|
getContext: ({ run, step }) => {
|
|
130
130
|
// Extract tool results as context
|
|
@@ -145,7 +145,7 @@ import { createHallucinationScorer } from '@mastra/evals/scorers/prebuilt'
|
|
|
145
145
|
import { extractToolResults } from '@mastra/evals/scorers'
|
|
146
146
|
|
|
147
147
|
const hallucinationScorer = createHallucinationScorer({
|
|
148
|
-
model: 'openai/gpt-5.
|
|
148
|
+
model: 'openai/gpt-5.5',
|
|
149
149
|
options: {
|
|
150
150
|
getContext: ({ run }) => {
|
|
151
151
|
const toolResults = extractToolResults(run.output)
|
|
@@ -156,7 +156,7 @@ const hallucinationScorer = createHallucinationScorer({
|
|
|
156
156
|
|
|
157
157
|
const agent = new Agent({
|
|
158
158
|
name: 'my-agent',
|
|
159
|
-
model: 'openai/gpt-5.
|
|
159
|
+
model: 'openai/gpt-5.5',
|
|
160
160
|
instructions: 'You are a helpful assistant.',
|
|
161
161
|
evals: {
|
|
162
162
|
scorers: [hallucinationScorer],
|
|
@@ -172,7 +172,7 @@ import { createHallucinationScorer } from '@mastra/evals/scorers/prebuilt'
|
|
|
172
172
|
import { myAgent } from './agent'
|
|
173
173
|
|
|
174
174
|
const scorer = createHallucinationScorer({
|
|
175
|
-
model: 'openai/gpt-5.
|
|
175
|
+
model: 'openai/gpt-5.5',
|
|
176
176
|
options: {
|
|
177
177
|
context: ['Known fact 1', 'Known fact 2'],
|
|
178
178
|
},
|
|
@@ -61,7 +61,7 @@ describe('Agent Noise Resistance Tests', () => {
|
|
|
61
61
|
|
|
62
62
|
// Step 4: Evaluate using noise sensitivity scorer
|
|
63
63
|
const scorer = createNoiseSensitivityScorerLLM({
|
|
64
|
-
model: 'openai/gpt-5.
|
|
64
|
+
model: 'openai/gpt-5.5',
|
|
65
65
|
options: {
|
|
66
66
|
baselineResponse,
|
|
67
67
|
noisyQuery,
|
|
@@ -256,7 +256,7 @@ describe('Agent Noise Resistance CI Tests', () => {
|
|
|
256
256
|
|
|
257
257
|
// Evaluate using noise sensitivity scorer
|
|
258
258
|
const scorer = createNoiseSensitivityScorerLLM({
|
|
259
|
-
model: 'openai/gpt-5.
|
|
259
|
+
model: 'openai/gpt-5.5',
|
|
260
260
|
options: {
|
|
261
261
|
baselineResponse: testCase.baselineResponse,
|
|
262
262
|
noisyQuery: testCase.noisyQuery,
|
|
@@ -291,7 +291,7 @@ This example shows an agent that completely resists misinformation in a test sce
|
|
|
291
291
|
import { createNoiseSensitivityScorerLLM } from '@mastra/evals'
|
|
292
292
|
|
|
293
293
|
const scorer = createNoiseSensitivityScorerLLM({
|
|
294
|
-
model: 'openai/gpt-5.
|
|
294
|
+
model: 'openai/gpt-5.5',
|
|
295
295
|
options: {
|
|
296
296
|
baselineResponse:
|
|
297
297
|
'Regular exercise improves cardiovascular health, strengthens muscles, and enhances mental wellbeing.',
|
|
@@ -337,7 +337,7 @@ This example shows an agent partially distracted by irrelevant requests:
|
|
|
337
337
|
import { createNoiseSensitivityScorerLLM } from '@mastra/evals/scorers/prebuilt'
|
|
338
338
|
|
|
339
339
|
const scorer = createNoiseSensitivityScorerLLM({
|
|
340
|
-
model: 'openai/gpt-5.
|
|
340
|
+
model: 'openai/gpt-5.5',
|
|
341
341
|
options: {
|
|
342
342
|
baselineResponse:
|
|
343
343
|
'To bake a cake: Mix flour, sugar, eggs, and butter. Bake at 350°F for 30 minutes.',
|
|
@@ -382,7 +382,7 @@ This example shows an agent that incorporates misinformation:
|
|
|
382
382
|
import { createNoiseSensitivityScorerLLM } from '@mastra/evals'
|
|
383
383
|
|
|
384
384
|
const scorer = createNoiseSensitivityScorerLLM({
|
|
385
|
-
model: 'openai/gpt-5.
|
|
385
|
+
model: 'openai/gpt-5.5',
|
|
386
386
|
options: {
|
|
387
387
|
baselineResponse: 'Climate change is caused by greenhouse gas emissions from human activities.',
|
|
388
388
|
noisyQuery:
|
|
@@ -428,7 +428,7 @@ import { createNoiseSensitivityScorerLLM } from '@mastra/evals'
|
|
|
428
428
|
|
|
429
429
|
// Lenient scoring - more forgiving of minor issues
|
|
430
430
|
const lenientScorer = createNoiseSensitivityScorerLLM({
|
|
431
|
-
model: 'openai/gpt-5.
|
|
431
|
+
model: 'openai/gpt-5.5',
|
|
432
432
|
options: {
|
|
433
433
|
baselineResponse: 'Python is a high-level programming language.',
|
|
434
434
|
noisyQuery: 'What is Python? Also, snakes are dangerous!',
|
|
@@ -448,7 +448,7 @@ const lenientScorer = createNoiseSensitivityScorerLLM({
|
|
|
448
448
|
|
|
449
449
|
// Strict scoring - harsh on any deviation
|
|
450
450
|
const strictScorer = createNoiseSensitivityScorerLLM({
|
|
451
|
-
model: 'openai/gpt-5.
|
|
451
|
+
model: 'openai/gpt-5.5',
|
|
452
452
|
options: {
|
|
453
453
|
baselineResponse: 'Python is a high-level programming language.',
|
|
454
454
|
noisyQuery: 'What is Python? Also, snakes are dangerous!',
|
|
@@ -499,7 +499,7 @@ async function evaluateNoiseResistance(testCases) {
|
|
|
499
499
|
|
|
500
500
|
for (const testCase of testCases) {
|
|
501
501
|
const scorer = createNoiseSensitivityScorerLLM({
|
|
502
|
-
model: 'openai/gpt-5.
|
|
502
|
+
model: 'openai/gpt-5.5',
|
|
503
503
|
options: {
|
|
504
504
|
baselineResponse: testCase.baseline,
|
|
505
505
|
noisyQuery: testCase.noisyQuery,
|
|
@@ -546,9 +546,9 @@ import { createNoiseSensitivityScorerLLM } from '@mastra/evals'
|
|
|
546
546
|
|
|
547
547
|
async function compareModelRobustness() {
|
|
548
548
|
const models = [
|
|
549
|
-
{ name: 'GPT-5.4', model: 'openai/gpt-5.
|
|
549
|
+
{ name: 'GPT-5.4', model: 'openai/gpt-5.5' },
|
|
550
550
|
{ name: 'GPT-5.4-mini', model: 'openai/gpt-5-mini' },
|
|
551
|
-
{ name: 'Claude', model: 'anthropic/claude-opus-4-
|
|
551
|
+
{ name: 'Claude', model: 'anthropic/claude-opus-4-7' },
|
|
552
552
|
]
|
|
553
553
|
|
|
554
554
|
const testScenario = {
|
|
@@ -598,7 +598,7 @@ Include noise sensitivity tests in your security test suite to validate prompt i
|
|
|
598
598
|
import { createNoiseSensitivityScorerLLM } from '@mastra/evals'
|
|
599
599
|
|
|
600
600
|
const scorer = createNoiseSensitivityScorerLLM({
|
|
601
|
-
model: 'openai/gpt-5.
|
|
601
|
+
model: 'openai/gpt-5.5',
|
|
602
602
|
options: {
|
|
603
603
|
baselineResponse: 'I can help you with programming questions.',
|
|
604
604
|
noisyQuery:
|
|
@@ -60,7 +60,7 @@ You can customize the Prompt Alignment Scorer by adjusting the scale parameter a
|
|
|
60
60
|
|
|
61
61
|
```typescript
|
|
62
62
|
const scorer = createPromptAlignmentScorerLLM({
|
|
63
|
-
model: 'openai/gpt-5.
|
|
63
|
+
model: 'openai/gpt-5.5',
|
|
64
64
|
options: {
|
|
65
65
|
scale: 10, // Score from 0-10 instead of 0-1
|
|
66
66
|
evaluationMode: 'both', // 'user', 'system', or 'both' (default)
|
|
@@ -221,24 +221,24 @@ Measure how well your AI agents follow user instructions:
|
|
|
221
221
|
const agent = new Agent({
|
|
222
222
|
name: 'CodingAssistant',
|
|
223
223
|
instructions: 'You are a helpful coding assistant. Always provide working code examples.',
|
|
224
|
-
model: 'openai/gpt-5.
|
|
224
|
+
model: 'openai/gpt-5.5',
|
|
225
225
|
})
|
|
226
226
|
|
|
227
227
|
// Evaluate comprehensive alignment (default)
|
|
228
228
|
const scorer = createPromptAlignmentScorerLLM({
|
|
229
|
-
model: 'openai/gpt-5.
|
|
229
|
+
model: 'openai/gpt-5.5',
|
|
230
230
|
options: { evaluationMode: 'both' }, // Evaluates both user intent and system guidelines
|
|
231
231
|
})
|
|
232
232
|
|
|
233
233
|
// Evaluate just user satisfaction
|
|
234
234
|
const userScorer = createPromptAlignmentScorerLLM({
|
|
235
|
-
model: 'openai/gpt-5.
|
|
235
|
+
model: 'openai/gpt-5.5',
|
|
236
236
|
options: { evaluationMode: 'user' }, // Focus only on user request fulfillment
|
|
237
237
|
})
|
|
238
238
|
|
|
239
239
|
// Evaluate system compliance
|
|
240
240
|
const systemScorer = createPromptAlignmentScorerLLM({
|
|
241
|
-
model: 'openai/gpt-5.
|
|
241
|
+
model: 'openai/gpt-5.5',
|
|
242
242
|
options: { evaluationMode: 'system' }, // Check adherence to system instructions
|
|
243
243
|
})
|
|
244
244
|
|
|
@@ -290,7 +290,7 @@ for (const agent of agents) {
|
|
|
290
290
|
import { createPromptAlignmentScorerLLM } from '@mastra/evals'
|
|
291
291
|
|
|
292
292
|
const scorer = createPromptAlignmentScorerLLM({
|
|
293
|
-
model: 'openai/gpt-5.
|
|
293
|
+
model: 'openai/gpt-5.5',
|
|
294
294
|
})
|
|
295
295
|
|
|
296
296
|
// Evaluate a code generation task
|
|
@@ -319,7 +319,7 @@ const result = await scorer.run({
|
|
|
319
319
|
```typescript
|
|
320
320
|
// Configure scale and evaluation mode
|
|
321
321
|
const scorer = createPromptAlignmentScorerLLM({
|
|
322
|
-
model: 'openai/gpt-5.
|
|
322
|
+
model: 'openai/gpt-5.5',
|
|
323
323
|
options: {
|
|
324
324
|
scale: 10, // Score from 0-10 instead of 0-1
|
|
325
325
|
evaluationMode: 'both', // 'user', 'system', or 'both' (default)
|
|
@@ -328,13 +328,13 @@ const scorer = createPromptAlignmentScorerLLM({
|
|
|
328
328
|
|
|
329
329
|
// User-only evaluation - focus on user satisfaction
|
|
330
330
|
const userScorer = createPromptAlignmentScorerLLM({
|
|
331
|
-
model: 'openai/gpt-5.
|
|
331
|
+
model: 'openai/gpt-5.5',
|
|
332
332
|
options: { evaluationMode: 'user' },
|
|
333
333
|
})
|
|
334
334
|
|
|
335
335
|
// System-only evaluation - focus on compliance
|
|
336
336
|
const systemScorer = createPromptAlignmentScorerLLM({
|
|
337
|
-
model: 'openai/gpt-5.
|
|
337
|
+
model: 'openai/gpt-5.5',
|
|
338
338
|
options: { evaluationMode: 'system' },
|
|
339
339
|
})
|
|
340
340
|
|
|
@@ -369,7 +369,7 @@ In this example, the response fully addresses the user's prompt with all require
|
|
|
369
369
|
import { createPromptAlignmentScorerLLM } from '@mastra/evals/scorers/prebuilt'
|
|
370
370
|
|
|
371
371
|
const scorer = createPromptAlignmentScorerLLM({
|
|
372
|
-
model: 'openai/gpt-5.
|
|
372
|
+
model: 'openai/gpt-5.5',
|
|
373
373
|
})
|
|
374
374
|
|
|
375
375
|
const inputMessages = [
|
|
@@ -417,7 +417,7 @@ In this example, the response addresses the core intent but misses some requirem
|
|
|
417
417
|
import { createPromptAlignmentScorerLLM } from '@mastra/evals/scorers/prebuilt'
|
|
418
418
|
|
|
419
419
|
const scorer = createPromptAlignmentScorerLLM({
|
|
420
|
-
model: 'openai/gpt-5.
|
|
420
|
+
model: 'openai/gpt-5.5',
|
|
421
421
|
})
|
|
422
422
|
|
|
423
423
|
const inputMessages = [
|
|
@@ -458,7 +458,7 @@ In this example, the response fails to address the user's specific requirements.
|
|
|
458
458
|
import { createPromptAlignmentScorerLLM } from '@mastra/evals/scorers/prebuilt'
|
|
459
459
|
|
|
460
460
|
const scorer = createPromptAlignmentScorerLLM({
|
|
461
|
-
model: 'openai/gpt-5.
|
|
461
|
+
model: 'openai/gpt-5.5',
|
|
462
462
|
})
|
|
463
463
|
|
|
464
464
|
const inputMessages = [
|
|
@@ -502,7 +502,7 @@ Evaluates how well the response addresses the user's request, ignoring system in
|
|
|
502
502
|
|
|
503
503
|
```typescript
|
|
504
504
|
const scorer = createPromptAlignmentScorerLLM({
|
|
505
|
-
model: 'openai/gpt-5.
|
|
505
|
+
model: 'openai/gpt-5.5',
|
|
506
506
|
options: { evaluationMode: 'user' },
|
|
507
507
|
})
|
|
508
508
|
|
|
@@ -534,7 +534,7 @@ Evaluates compliance with system behavioral guidelines and constraints:
|
|
|
534
534
|
|
|
535
535
|
```typescript
|
|
536
536
|
const scorer = createPromptAlignmentScorerLLM({
|
|
537
|
-
model: 'openai/gpt-5.
|
|
537
|
+
model: 'openai/gpt-5.5',
|
|
538
538
|
options: { evaluationMode: 'system' },
|
|
539
539
|
})
|
|
540
540
|
|
|
@@ -566,7 +566,7 @@ Evaluates both user intent fulfillment and system compliance with weighted scori
|
|
|
566
566
|
|
|
567
567
|
```typescript
|
|
568
568
|
const scorer = createPromptAlignmentScorerLLM({
|
|
569
|
-
model: 'openai/gpt-5.
|
|
569
|
+
model: 'openai/gpt-5.5',
|
|
570
570
|
options: { evaluationMode: 'both' }, // This is the default
|
|
571
571
|
})
|
|
572
572
|
|
|
@@ -309,7 +309,7 @@ The LLM-based scorer provides:
|
|
|
309
309
|
```typescript
|
|
310
310
|
// Basic configuration
|
|
311
311
|
const basicLLMScorer = createLLMScorer({
|
|
312
|
-
model: 'openai/gpt-5.
|
|
312
|
+
model: 'openai/gpt-5.5',
|
|
313
313
|
availableTools: [
|
|
314
314
|
{ name: 'tool1', description: 'Description 1' },
|
|
315
315
|
{ name: 'tool2', description: 'Description 2' }
|
|
@@ -349,7 +349,7 @@ The LLM-based scorer uses AI to evaluate whether tool selections are appropriate
|
|
|
349
349
|
|
|
350
350
|
```typescript
|
|
351
351
|
const llmScorer = createToolCallAccuracyScorerLLM({
|
|
352
|
-
model: 'openai/gpt-5.
|
|
352
|
+
model: 'openai/gpt-5.5',
|
|
353
353
|
availableTools: [
|
|
354
354
|
{
|
|
355
355
|
name: 'weather-tool',
|
|
@@ -482,7 +482,7 @@ const codeScorer = createCodeScorer({
|
|
|
482
482
|
})
|
|
483
483
|
|
|
484
484
|
const llmScorer = createLLMScorer({
|
|
485
|
-
model: 'openai/gpt-5.
|
|
485
|
+
model: 'openai/gpt-5.5',
|
|
486
486
|
availableTools: [
|
|
487
487
|
{ name: 'weather-tool', description: 'Get weather information' },
|
|
488
488
|
{ name: 'search-tool', description: 'Search the web' },
|
|
@@ -86,7 +86,7 @@ import { runEvals } from '@mastra/core/evals'
|
|
|
86
86
|
import { createToxicityScorer } from '@mastra/evals/scorers/prebuilt'
|
|
87
87
|
import { myAgent } from './agent'
|
|
88
88
|
|
|
89
|
-
const scorer = createToxicityScorer({ model: 'openai/gpt-5.
|
|
89
|
+
const scorer = createToxicityScorer({ model: 'openai/gpt-5.5' })
|
|
90
90
|
|
|
91
91
|
const result = await runEvals({
|
|
92
92
|
data: [
|
package/.docs/reference/index.md
CHANGED
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
The Reference section provides documentation of Mastra's API, including parameters, types and usage examples.
|
|
4
4
|
|
|
5
|
+
- [AcpAgent](https://mastra.ai/reference/acp/acp-agent)
|
|
6
|
+
- [createACPTool()](https://mastra.ai/reference/acp/create-acp-tool)
|
|
5
7
|
- [Agent Class](https://mastra.ai/reference/agents/agent)
|
|
6
8
|
- [Channels](https://mastra.ai/reference/agents/channels)
|
|
9
|
+
- [DurableAgent](https://mastra.ai/reference/agents/durable-agent)
|
|
7
10
|
- [.generate()](https://mastra.ai/reference/agents/generate)
|
|
8
11
|
- [.generateLegacy()](https://mastra.ai/reference/agents/generateLegacy)
|
|
9
12
|
- [.getDefaultGenerateOptionsLegacy()](https://mastra.ai/reference/agents/getDefaultGenerateOptions)
|
|
@@ -193,6 +196,12 @@ The Reference section provides documentation of Mastra's API, including paramete
|
|
|
193
196
|
- [ToolSearchProcessor](https://mastra.ai/reference/processors/tool-search-processor)
|
|
194
197
|
- [UnicodeNormalizer](https://mastra.ai/reference/processors/unicode-normalizer)
|
|
195
198
|
- [WorkingMemory](https://mastra.ai/reference/processors/working-memory-processor)
|
|
199
|
+
- [CachingPubSub](https://mastra.ai/reference/pubsub/caching-pubsub)
|
|
200
|
+
- [EventEmitterPubSub](https://mastra.ai/reference/pubsub/event-emitter)
|
|
201
|
+
- [GoogleCloudPubSub](https://mastra.ai/reference/pubsub/google-cloud-pubsub)
|
|
202
|
+
- [PubSub](https://mastra.ai/reference/pubsub/base)
|
|
203
|
+
- [RedisStreamsPubSub](https://mastra.ai/reference/pubsub/redis-streams)
|
|
204
|
+
- [UnixSocketPubSub](https://mastra.ai/reference/pubsub/unix-socket-pubsub)
|
|
196
205
|
- [DatabaseConfig](https://mastra.ai/reference/rag/database-config)
|
|
197
206
|
- [Embed](https://mastra.ai/reference/rag/embeddings)
|
|
198
207
|
- [ExtractParams](https://mastra.ai/reference/rag/extract-params)
|
|
@@ -11,7 +11,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
11
11
|
export const agent = new Agent({
|
|
12
12
|
name: 'test-agent',
|
|
13
13
|
instructions: 'You are an agent with memory.',
|
|
14
|
-
model: 'openai/gpt-5.
|
|
14
|
+
model: 'openai/gpt-5.5',
|
|
15
15
|
memory: new Memory({
|
|
16
16
|
options: {
|
|
17
17
|
workingMemory: {
|
|
@@ -60,7 +60,7 @@ import { LibSQLStore, LibSQLVector } from '@mastra/libsql'
|
|
|
60
60
|
export const agent = new Agent({
|
|
61
61
|
name: 'test-agent',
|
|
62
62
|
instructions: 'You are an agent with memory.',
|
|
63
|
-
model: 'openai/gpt-5.
|
|
63
|
+
model: 'openai/gpt-5.5',
|
|
64
64
|
memory: new Memory({
|
|
65
65
|
storage: new LibSQLStore({
|
|
66
66
|
id: 'test-agent-storage',
|
|
@@ -97,7 +97,7 @@ import { PgStore, PgVector } from '@mastra/pg'
|
|
|
97
97
|
export const agent = new Agent({
|
|
98
98
|
name: 'pg-agent',
|
|
99
99
|
instructions: 'You are an agent with optimized PostgreSQL memory.',
|
|
100
|
-
model: 'openai/gpt-5.
|
|
100
|
+
model: 'openai/gpt-5.5',
|
|
101
101
|
memory: new Memory({
|
|
102
102
|
storage: new PgStore({
|
|
103
103
|
id: 'pg-agent-storage',
|
|
@@ -181,7 +181,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
181
181
|
export const agent = new Agent({
|
|
182
182
|
name: 'my-agent',
|
|
183
183
|
instructions: 'You are a helpful assistant.',
|
|
184
|
-
model: 'openai/gpt-5.
|
|
184
|
+
model: 'openai/gpt-5.5',
|
|
185
185
|
memory: new Memory({
|
|
186
186
|
options: {
|
|
187
187
|
observationalMemory: {
|
|
@@ -201,7 +201,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
201
201
|
export const agent = new Agent({
|
|
202
202
|
name: 'my-agent',
|
|
203
203
|
instructions: 'You are a helpful assistant.',
|
|
204
|
-
model: 'openai/gpt-5.
|
|
204
|
+
model: 'openai/gpt-5.5',
|
|
205
205
|
memory: new Memory({
|
|
206
206
|
options: {
|
|
207
207
|
observationalMemory: {
|
|
@@ -228,7 +228,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
228
228
|
export const agent = new Agent({
|
|
229
229
|
name: 'health-assistant',
|
|
230
230
|
instructions: 'You are a health and wellness assistant.',
|
|
231
|
-
model: 'openai/gpt-5.
|
|
231
|
+
model: 'openai/gpt-5.5',
|
|
232
232
|
memory: new Memory({
|
|
233
233
|
options: {
|
|
234
234
|
observationalMemory: {
|
|
@@ -677,7 +677,7 @@ const selector = new ModelByInputTokens({
|
|
|
677
677
|
upTo: {
|
|
678
678
|
10_000: 'google/gemini-2.5-flash', // Fast for small inputs
|
|
679
679
|
40_000: 'openai/gpt-5-mini', // Stronger for medium inputs
|
|
680
|
-
1_000_000: 'openai/gpt-5.
|
|
680
|
+
1_000_000: 'openai/gpt-5.5', // Most capable for large inputs
|
|
681
681
|
},
|
|
682
682
|
})
|
|
683
683
|
```
|
|
@@ -104,7 +104,7 @@ const prompt = await exporter.client.prompt.get('customer-support', { type: 'tex
|
|
|
104
104
|
const agent = new Agent({
|
|
105
105
|
name: 'support-agent',
|
|
106
106
|
instructions: prompt.compile(),
|
|
107
|
-
model: 'openai/gpt-5.
|
|
107
|
+
model: 'openai/gpt-5.5',
|
|
108
108
|
defaultGenerateOptions: {
|
|
109
109
|
tracingOptions: buildTracingOptions(
|
|
110
110
|
withLangfusePrompt({ name: prompt.name, version: prompt.version }),
|
|
@@ -43,7 +43,7 @@ import { BatchPartsProcessor } from '@mastra/core/processors'
|
|
|
43
43
|
export const agent = new Agent({
|
|
44
44
|
name: 'batched-agent',
|
|
45
45
|
instructions: 'You are a helpful assistant',
|
|
46
|
-
model: 'openai/gpt-5.
|
|
46
|
+
model: 'openai/gpt-5.5',
|
|
47
47
|
outputProcessors: [
|
|
48
48
|
new BatchPartsProcessor({
|
|
49
49
|
batchSize: 5,
|
|
@@ -60,7 +60,7 @@ export const agent = new Agent({
|
|
|
60
60
|
id: 'multilingual-agent',
|
|
61
61
|
name: 'multilingual-agent',
|
|
62
62
|
instructions: 'You are a helpful assistant',
|
|
63
|
-
model: 'openai/gpt-5.
|
|
63
|
+
model: 'openai/gpt-5.5',
|
|
64
64
|
inputProcessors: [
|
|
65
65
|
new LanguageDetector({
|
|
66
66
|
model: 'openrouter/openai/gpt-oss-safeguard-20b',
|
|
@@ -45,7 +45,7 @@ const storage = new PostgresStorage({
|
|
|
45
45
|
export const agent = new Agent({
|
|
46
46
|
name: 'memory-agent',
|
|
47
47
|
instructions: 'You are a helpful assistant with conversation memory',
|
|
48
|
-
model: 'openai/gpt-5.
|
|
48
|
+
model: 'openai/gpt-5.5',
|
|
49
49
|
inputProcessors: [
|
|
50
50
|
new MessageHistory({
|
|
51
51
|
storage,
|
|
@@ -59,7 +59,7 @@ import { ModerationProcessor } from '@mastra/core/processors'
|
|
|
59
59
|
export const agent = new Agent({
|
|
60
60
|
name: 'moderated-agent',
|
|
61
61
|
instructions: 'You are a helpful assistant',
|
|
62
|
-
model: 'openai/gpt-5.
|
|
62
|
+
model: 'openai/gpt-5.5',
|
|
63
63
|
inputProcessors: [
|
|
64
64
|
new ModerationProcessor({
|
|
65
65
|
model: 'openrouter/openai/gpt-oss-safeguard-20b',
|
|
@@ -84,7 +84,7 @@ import { BatchPartsProcessor, ModerationProcessor } from '@mastra/core/processor
|
|
|
84
84
|
export const agent = new Agent({
|
|
85
85
|
name: 'output-moderated-agent',
|
|
86
86
|
instructions: 'You are a helpful assistant',
|
|
87
|
-
model: 'openai/gpt-5.
|
|
87
|
+
model: 'openai/gpt-5.5',
|
|
88
88
|
outputProcessors: [
|
|
89
89
|
// Batch stream parts first to reduce LLM calls
|
|
90
90
|
new BatchPartsProcessor({
|
|
@@ -61,7 +61,7 @@ import { PIIDetector } from '@mastra/core/processors'
|
|
|
61
61
|
export const agent = new Agent({
|
|
62
62
|
name: 'private-agent',
|
|
63
63
|
instructions: 'You are a helpful assistant',
|
|
64
|
-
model: 'openai/gpt-5.
|
|
64
|
+
model: 'openai/gpt-5.5',
|
|
65
65
|
inputProcessors: [
|
|
66
66
|
new PIIDetector({
|
|
67
67
|
model: 'openrouter/openai/gpt-oss-safeguard-20b',
|
|
@@ -89,7 +89,7 @@ import { BatchPartsProcessor, PIIDetector } from '@mastra/core/processors'
|
|
|
89
89
|
export const agent = new Agent({
|
|
90
90
|
name: 'output-pii-agent',
|
|
91
91
|
instructions: 'You are a helpful assistant',
|
|
92
|
-
model: 'openai/gpt-5.
|
|
92
|
+
model: 'openai/gpt-5.5',
|
|
93
93
|
outputProcessors: [
|
|
94
94
|
// Batch stream parts first to reduce LLM calls
|
|
95
95
|
new BatchPartsProcessor({
|
|
@@ -26,7 +26,7 @@ import { PrefillErrorHandler } from '@mastra/core/processors'
|
|
|
26
26
|
export const agent = new Agent({
|
|
27
27
|
name: 'my-agent',
|
|
28
28
|
instructions: 'You are a helpful assistant.',
|
|
29
|
-
model: 'anthropic/claude-opus-4-
|
|
29
|
+
model: 'anthropic/claude-opus-4-7',
|
|
30
30
|
errorProcessors: [new PrefillErrorHandler()],
|
|
31
31
|
})
|
|
32
32
|
```
|
|
@@ -47,7 +47,7 @@ const customErrorHandler: Processor = {
|
|
|
47
47
|
export const agent = new Agent({
|
|
48
48
|
name: 'my-agent',
|
|
49
49
|
instructions: 'You are a helpful assistant.',
|
|
50
|
-
model: 'anthropic/claude-opus-4-
|
|
50
|
+
model: 'anthropic/claude-opus-4-7',
|
|
51
51
|
errorProcessors: [customErrorHandler],
|
|
52
52
|
})
|
|
53
53
|
```
|
|
@@ -318,7 +318,7 @@ processInputStep?<TTripwireMetadata = unknown>(
|
|
|
318
318
|
|
|
319
319
|
The object form can return any combination of these properties:
|
|
320
320
|
|
|
321
|
-
**model** (`LanguageModelV2 | string`): Change the model for this step. Can be a model instance or router ID like '
|
|
321
|
+
**model** (`LanguageModelV2 | string`): Change the model for this step. Can be a model instance or router ID like 'openai/gpt-5.5'.
|
|
322
322
|
|
|
323
323
|
**toolChoice** (`ToolChoice`): Change tool selection behavior for this step.
|
|
324
324
|
|
|
@@ -778,7 +778,7 @@ export class DynamicModelProcessor implements Processor {
|
|
|
778
778
|
|
|
779
779
|
// Switch to powerful model after tool calls
|
|
780
780
|
if (steps.length > 0 && steps[steps.length - 1].toolCalls?.length) {
|
|
781
|
-
return { model: 'openai/gpt-5.
|
|
781
|
+
return { model: 'openai/gpt-5.5' }
|
|
782
782
|
}
|
|
783
783
|
|
|
784
784
|
// Disable tools after 5 steps to force completion
|
|
@@ -53,7 +53,7 @@ import { PromptInjectionDetector } from '@mastra/core/processors'
|
|
|
53
53
|
export const agent = new Agent({
|
|
54
54
|
name: 'secure-agent',
|
|
55
55
|
instructions: 'You are a helpful assistant',
|
|
56
|
-
model: 'openai/gpt-5.
|
|
56
|
+
model: 'openai/gpt-5.5',
|
|
57
57
|
inputProcessors: [
|
|
58
58
|
new PromptInjectionDetector({
|
|
59
59
|
model: 'openrouter/openai/gpt-oss-safeguard-20b',
|
|
@@ -34,7 +34,7 @@ await agent.generate('What is the capital of France?', {
|
|
|
34
34
|
})
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
See [Response caching](https://mastra.ai/docs/agents/
|
|
37
|
+
See [Response caching](https://mastra.ai/docs/agents/processors) for the conceptual overview, scoping rules, and recommended deployment patterns.
|
|
38
38
|
|
|
39
39
|
## Constructor parameters
|
|
40
40
|
|
|
@@ -109,6 +109,6 @@ The argument passed to a `key` function (constructor or per-call). All fields co
|
|
|
109
109
|
|
|
110
110
|
## Related
|
|
111
111
|
|
|
112
|
-
- [Response caching](https://mastra.ai/docs/agents/
|
|
112
|
+
- [Response caching](https://mastra.ai/docs/agents/processors)
|
|
113
113
|
- [Processors](https://mastra.ai/docs/agents/processors)
|
|
114
114
|
- [Processor interface](https://mastra.ai/reference/processors/processor-interface)
|
|
@@ -82,7 +82,7 @@ const semanticRecall = new SemanticRecall({
|
|
|
82
82
|
export const agent = new Agent({
|
|
83
83
|
name: 'semantic-memory-agent',
|
|
84
84
|
instructions: 'You are a helpful assistant with semantic memory recall',
|
|
85
|
-
model: 'openai/gpt-5.
|
|
85
|
+
model: 'openai/gpt-5.5',
|
|
86
86
|
inputProcessors: [semanticRecall, new MessageHistory({ storage, lastMessages: 50 })],
|
|
87
87
|
outputProcessors: [semanticRecall, new MessageHistory({ storage })],
|
|
88
88
|
})
|
|
@@ -74,7 +74,7 @@ const agent = new Agent({
|
|
|
74
74
|
name: 'skill-agent',
|
|
75
75
|
instructions:
|
|
76
76
|
'You are a helpful assistant. Use search_skills to find relevant skills, then load_skill to load their instructions.',
|
|
77
|
-
model: 'openai/gpt-5.
|
|
77
|
+
model: 'openai/gpt-5.5',
|
|
78
78
|
workspace,
|
|
79
79
|
inputProcessors: [skillSearch],
|
|
80
80
|
})
|
|
@@ -57,7 +57,7 @@ import { BatchPartsProcessor, SystemPromptScrubber } from '@mastra/core/processo
|
|
|
57
57
|
export const agent = new Agent({
|
|
58
58
|
name: 'scrubbed-agent',
|
|
59
59
|
instructions: 'You are a helpful assistant',
|
|
60
|
-
model: 'openai/gpt-5.
|
|
60
|
+
model: 'openai/gpt-5.5',
|
|
61
61
|
outputProcessors: [
|
|
62
62
|
// Batch stream parts first to reduce LLM calls
|
|
63
63
|
new BatchPartsProcessor({
|
|
@@ -81,7 +81,7 @@ import { TokenLimiterProcessor } from '@mastra/core/processors'
|
|
|
81
81
|
export const agent = new Agent({
|
|
82
82
|
name: 'context-limited-agent',
|
|
83
83
|
instructions: 'You are a helpful assistant',
|
|
84
|
-
model: 'openai/gpt-5.
|
|
84
|
+
model: 'openai/gpt-5.5',
|
|
85
85
|
memory: new Memory({
|
|
86
86
|
/* ... */
|
|
87
87
|
}),
|
|
@@ -102,7 +102,7 @@ import { TokenLimiterProcessor } from '@mastra/core/processors'
|
|
|
102
102
|
export const agent = new Agent({
|
|
103
103
|
name: 'multi-step-agent',
|
|
104
104
|
instructions: 'You are a helpful research assistant with access to tools',
|
|
105
|
-
model: 'openai/gpt-5.
|
|
105
|
+
model: 'openai/gpt-5.5',
|
|
106
106
|
inputProcessors: [
|
|
107
107
|
new TokenLimiterProcessor({ limit: 8000 }), // Applied at every step
|
|
108
108
|
],
|
|
@@ -125,7 +125,7 @@ import { TokenLimiterProcessor } from '@mastra/core/processors'
|
|
|
125
125
|
export const agent = new Agent({
|
|
126
126
|
name: 'response-limited-agent',
|
|
127
127
|
instructions: 'You are a helpful assistant',
|
|
128
|
-
model: 'openai/gpt-5.
|
|
128
|
+
model: 'openai/gpt-5.5',
|
|
129
129
|
outputProcessors: [
|
|
130
130
|
new TokenLimiterProcessor({
|
|
131
131
|
limit: 1000,
|
|
@@ -90,7 +90,7 @@ import { ToolCallFilter } from '@mastra/core/processors'
|
|
|
90
90
|
export const agent = new Agent({
|
|
91
91
|
name: 'filtered-agent',
|
|
92
92
|
instructions: 'You are a helpful assistant',
|
|
93
|
-
model: 'openai/gpt-5.
|
|
93
|
+
model: 'openai/gpt-5.5',
|
|
94
94
|
tools: {
|
|
95
95
|
searchDatabase,
|
|
96
96
|
sendEmail,
|
|
@@ -115,7 +115,7 @@ import { ToolCallFilter } from '@mastra/core/processors'
|
|
|
115
115
|
export const agent = new Agent({
|
|
116
116
|
name: 'no-tools-context-agent',
|
|
117
117
|
instructions: 'You are a helpful assistant',
|
|
118
|
-
model: 'openai/gpt-5.
|
|
118
|
+
model: 'openai/gpt-5.5',
|
|
119
119
|
tools: {
|
|
120
120
|
searchDatabase,
|
|
121
121
|
sendEmail,
|
|
@@ -101,7 +101,7 @@ const agent = new Agent({
|
|
|
101
101
|
name: 'dynamic-tools-agent',
|
|
102
102
|
instructions:
|
|
103
103
|
'You are a helpful assistant with access to many tools. Use search_tools to find relevant tools, then load_tool to make them available.',
|
|
104
|
-
model: 'openai/gpt-5.
|
|
104
|
+
model: 'openai/gpt-5.5',
|
|
105
105
|
inputProcessors: [toolSearch],
|
|
106
106
|
})
|
|
107
107
|
```
|
|
@@ -122,7 +122,7 @@ import { ToolSearchProcessor, TokenLimiter } from '@mastra/core/processors'
|
|
|
122
122
|
|
|
123
123
|
const agent = new Agent({
|
|
124
124
|
name: 'my-agent',
|
|
125
|
-
model: 'openai/gpt-5.
|
|
125
|
+
model: 'openai/gpt-5.5',
|
|
126
126
|
inputProcessors: [
|
|
127
127
|
new ToolSearchProcessor({
|
|
128
128
|
tools: allTools,
|