@mastra/rag 2.2.1 → 2.3.0-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/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @mastra/rag
2
2
 
3
+ ## 2.3.0-alpha.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Random bump ([#18178](https://github.com/mastra-ai/mastra/pull/18178))
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`7c0d868`](https://github.com/mastra-ai/mastra/commit/7c0d868d97d0fdbc04c14d0166dbf44d4c5a4a62), [`d9d2273`](https://github.com/mastra-ai/mastra/commit/d9d2273c702690c9a26eab2aebea879701d4355a), [`b04369d`](https://github.com/mastra-ai/mastra/commit/b04369d6b167c698ef103981171a8bf92808e756), [`8f3c262`](https://github.com/mastra-ai/mastra/commit/8f3c262587b335588a02d96b17fd6aca34c885b3)]:
12
+ - @mastra/core@1.45.0-alpha.0
13
+
14
+ ## 2.2.2
15
+
16
+ ### Patch Changes
17
+
18
+ - Security remediation for the 2026-06-17 "easy-day-js" supply-chain incident. Patch bump to publish clean versions and move the `latest` dist-tag forward, superseding the compromised versions that declared the malicious `easy-day-js` dependency. ([#18056](https://github.com/mastra-ai/mastra/pull/18056))
19
+
20
+ - Updated dependencies [[`339c57c`](https://github.com/mastra-ai/mastra/commit/339c57c5b2c6dbe75a125e138228e0556528976f), [`1dd4117`](https://github.com/mastra-ai/mastra/commit/1dd4117dcbd8e031ede9f0489436bfbc6f0315b8), [`2b11d1f`](https://github.com/mastra-ai/mastra/commit/2b11d1f6ac7024c5dd2b2dd12a48a956ac9d63bd), [`77a2351`](https://github.com/mastra-ai/mastra/commit/77a2351ee79296e360bce822cb3391f7cfd6489d), [`b7dff0a`](https://github.com/mastra-ai/mastra/commit/b7dff0a3d1022eb6868f48dc40a2b1febd5c277f), [`02087e1`](https://github.com/mastra-ai/mastra/commit/02087e1fbc54aa07f3071f7a200df1bf5be601a8), [`49af8df`](https://github.com/mastra-ai/mastra/commit/49af8df589c4ff71a5015a4553b377b32704b691), [`30ce559`](https://github.com/mastra-ai/mastra/commit/30ce55902ecf819b8ab8697398dd68b108228063), [`c241b92`](https://github.com/mastra-ai/mastra/commit/c241b929dc8c8d6a7b7219c99ed13ac1f3124a77), [`7d6ff70`](https://github.com/mastra-ai/mastra/commit/7d6ff708727297a0526ca0e26e93eeb5bbaaa187), [`ab975d4`](https://github.com/mastra-ai/mastra/commit/ab975d4dd9488752f05bda7afa03166d207e3e2a), [`9d6aa1b`](https://github.com/mastra-ai/mastra/commit/9d6aa1bae407e2afa6a089abc2a6accbbcb287b8)]:
21
+ - @mastra/core@1.44.0
22
+
23
+ ## 2.2.2-alpha.0
24
+
25
+ ### Patch Changes
26
+
27
+ - Security remediation for the 2026-06-17 "easy-day-js" supply-chain incident. Patch bump to publish clean versions and move the `latest` dist-tag forward, superseding the compromised versions that declared the malicious `easy-day-js` dependency. ([#18056](https://github.com/mastra-ai/mastra/pull/18056))
28
+
29
+ - Updated dependencies [[`77a2351`](https://github.com/mastra-ai/mastra/commit/77a2351ee79296e360bce822cb3391f7cfd6489d)]:
30
+ - @mastra/core@1.43.1-alpha.0
31
+
3
32
  ## 2.2.1
4
33
 
5
34
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-rag
3
3
  description: Documentation for @mastra/rag. Use when working with @mastra/rag APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/rag"
6
- version: "2.2.1"
6
+ version: "2.3.0-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.2.1",
2
+ "version": "2.3.0-alpha.0",
3
3
  "package": "@mastra/rag",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -75,7 +75,7 @@ const ragAgent = new Agent({
75
75
  instructions: `You are a helpful assistant that answers questions based on the provided context.
76
76
  When answering questions, use the graph query tool to find relevant information and relationships.
77
77
  Base your answers on the context provided by the tool, and clearly state if the context doesn't contain enough information.`,
78
- model: 'openai/gpt-5.4',
78
+ model: 'openai/gpt-5.5',
79
79
  tools: {
80
80
  graphQueryTool,
81
81
  },
@@ -197,7 +197,7 @@ const agent = new Agent({
197
197
  name: 'RAG Agent',
198
198
  instructions: `Use vector search for simple fact-finding queries.
199
199
  Use graph search when you need to understand relationships or find connected information.`,
200
- model: 'openai/gpt-5.4',
200
+ model: 'openai/gpt-5.5',
201
201
  tools: {
202
202
  vectorQueryTool,
203
203
  graphQueryTool,
@@ -272,7 +272,7 @@ import { PGVECTOR_PROMPT } from '@mastra/pg'
272
272
  export const ragAgent = new Agent({
273
273
  id: 'rag-agent',
274
274
  name: 'RAG Agent',
275
- model: 'openai/gpt-5.4',
275
+ model: 'openai/gpt-5.5',
276
276
  instructions: `
277
277
  Process queries using the provided context. Structure responses to be concise and relevant.
278
278
  ${PGVECTOR_PROMPT}
@@ -289,7 +289,7 @@ import { PINECONE_PROMPT } from '@mastra/pinecone'
289
289
  export const ragAgent = new Agent({
290
290
  id: 'rag-agent',
291
291
  name: 'RAG Agent',
292
- model: 'openai/gpt-5.4',
292
+ model: 'openai/gpt-5.5',
293
293
  instructions: `
294
294
  Process queries using the provided context. Structure responses to be concise and relevant.
295
295
  ${PINECONE_PROMPT}
@@ -306,7 +306,7 @@ import { QDRANT_PROMPT } from '@mastra/qdrant'
306
306
  export const ragAgent = new Agent({
307
307
  id: 'rag-agent',
308
308
  name: 'RAG Agent',
309
- model: 'openai/gpt-5.4',
309
+ model: 'openai/gpt-5.5',
310
310
  instructions: `
311
311
  Process queries using the provided context. Structure responses to be concise and relevant.
312
312
  ${QDRANT_PROMPT}
@@ -323,7 +323,7 @@ import { CHROMA_PROMPT } from '@mastra/chroma'
323
323
  export const ragAgent = new Agent({
324
324
  id: 'rag-agent',
325
325
  name: 'RAG Agent',
326
- model: 'openai/gpt-5.4',
326
+ model: 'openai/gpt-5.5',
327
327
  instructions: `
328
328
  Process queries using the provided context. Structure responses to be concise and relevant.
329
329
  ${CHROMA_PROMPT}
@@ -340,7 +340,7 @@ import { ASTRA_PROMPT } from '@mastra/astra'
340
340
  export const ragAgent = new Agent({
341
341
  id: 'rag-agent',
342
342
  name: 'RAG Agent',
343
- model: 'openai/gpt-5.4',
343
+ model: 'openai/gpt-5.5',
344
344
  instructions: `
345
345
  Process queries using the provided context. Structure responses to be concise and relevant.
346
346
  ${ASTRA_PROMPT}
@@ -357,7 +357,7 @@ import { LIBSQL_PROMPT } from '@mastra/libsql'
357
357
  export const ragAgent = new Agent({
358
358
  id: 'rag-agent',
359
359
  name: 'RAG Agent',
360
- model: 'openai/gpt-5.4',
360
+ model: 'openai/gpt-5.5',
361
361
  instructions: `
362
362
  Process queries using the provided context. Structure responses to be concise and relevant.
363
363
  ${LIBSQL_PROMPT}
@@ -374,7 +374,7 @@ import { UPSTASH_PROMPT } from '@mastra/upstash'
374
374
  export const ragAgent = new Agent({
375
375
  id: 'rag-agent',
376
376
  name: 'RAG Agent',
377
- model: 'openai/gpt-5.4',
377
+ model: 'openai/gpt-5.5',
378
378
  instructions: `
379
379
  Process queries using the provided context. Structure responses to be concise and relevant.
380
380
  ${UPSTASH_PROMPT}
@@ -391,7 +391,7 @@ import { VECTORIZE_PROMPT } from '@mastra/vectorize'
391
391
  export const ragAgent = new Agent({
392
392
  id: 'rag-agent',
393
393
  name: 'RAG Agent',
394
- model: 'openai/gpt-5.4',
394
+ model: 'openai/gpt-5.5',
395
395
  instructions: `
396
396
  Process queries using the provided context. Structure responses to be concise and relevant.
397
397
  ${VECTORIZE_PROMPT}
@@ -408,7 +408,7 @@ import { MONGODB_PROMPT } from '@mastra/mongodb'
408
408
  export const ragAgent = new Agent({
409
409
  id: 'rag-agent',
410
410
  name: 'RAG Agent',
411
- model: 'openai/gpt-5.4',
411
+ model: 'openai/gpt-5.5',
412
412
  instructions: `
413
413
  Process queries using the provided context. Structure responses to be concise and relevant.
414
414
  ${MONGODB_PROMPT}
@@ -425,7 +425,7 @@ import { OPENSEARCH_PROMPT } from '@mastra/opensearch'
425
425
  export const ragAgent = new Agent({
426
426
  id: 'rag-agent',
427
427
  name: 'RAG Agent',
428
- model: 'openai/gpt-5.4',
428
+ model: 'openai/gpt-5.5',
429
429
  instructions: `
430
430
  Process queries using the provided context. Structure responses to be concise and relevant.
431
431
  ${OPENSEARCH_PROMPT}
@@ -442,7 +442,7 @@ import { S3VECTORS_PROMPT } from '@mastra/s3vectors'
442
442
  export const ragAgent = new Agent({
443
443
  id: 'rag-agent',
444
444
  name: 'RAG Agent',
445
- model: 'openai/gpt-5.4',
445
+ model: 'openai/gpt-5.5',
446
446
  instructions: `
447
447
  Process queries using the provided context. Structure responses to be concise and relevant.
448
448
  ${S3VECTORS_PROMPT}
@@ -472,7 +472,10 @@ const initialResults = await pgVector.query({
472
472
  })
473
473
 
474
474
  // Create a relevance scorer
475
- const relevanceProvider = new MastraAgentRelevanceScorer('relevance-scorer', 'openai/gpt-5.4')
475
+ const relevanceProvider = new MastraAgentRelevanceScorer(
476
+ 'relevance-scorer',
477
+ 'openai/gpt-5.5',
478
+ )
476
479
 
477
480
  // Re-rank the results
478
481
  const rerankedResults = await rerank({
@@ -16,7 +16,7 @@ function rerank(
16
16
  ```typescript
17
17
  import { rerank } from '@mastra/rag'
18
18
 
19
- const model = 'openai/gpt-5.4'
19
+ const model = 'openai/gpt-5.5'
20
20
 
21
21
  const rerankedResults = await rerank(vectorSearchResults, 'How do I deploy to production?', model, {
22
22
  weights: {
@@ -142,7 +142,7 @@ const queryTool = createVectorQueryTool({
142
142
  indexName: 'documentation',
143
143
  model: new ModelRouterEmbeddingModel('openai/text-embedding-3-small'),
144
144
  reranker: {
145
- model: 'openai/gpt-5.4',
145
+ model: 'openai/gpt-5.5',
146
146
  options: {
147
147
  weights: {
148
148
  semantic: 0.5, // Semantic relevance weight
package/dist/index.cjs CHANGED
@@ -84,9 +84,9 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
84
84
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
85
85
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
86
86
 
87
- // ../../node_modules/.pnpm/secure-json-parse@2.7.0/node_modules/secure-json-parse/index.js
87
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/secure-json-parse/2.7.0/1f65efb0c6ff2d0f745ac6dfe22202b559993ceecd896afead5fc2c075b2d349/node_modules/secure-json-parse/index.js
88
88
  var require_secure_json_parse = __commonJS({
89
- "../../node_modules/.pnpm/secure-json-parse@2.7.0/node_modules/secure-json-parse/index.js"(exports$1, module) {
89
+ "../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/secure-json-parse/2.7.0/1f65efb0c6ff2d0f745ac6dfe22202b559993ceecd896afead5fc2c075b2d349/node_modules/secure-json-parse/index.js"(exports, module) {
90
90
  var hasBuffer = typeof Buffer !== "undefined";
91
91
  var suspectProtoRx = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/;
92
92
  var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
@@ -456,7 +456,7 @@ var BaseExtractor = class {
456
456
  }
457
457
  };
458
458
 
459
- // ../../node_modules/.pnpm/@ai-sdk+provider@1.1.3/node_modules/@ai-sdk/provider/dist/index.mjs
459
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/provider/1.1.3/7d8eaddb7973e5820d04ac18a887c85cc63f173732e3c66432ceefbff819b4ac/node_modules/@ai-sdk/provider/dist/index.mjs
460
460
  var marker = "vercel.ai.error";
461
461
  var symbol = Symbol.for(marker);
462
462
  var _a;
@@ -724,7 +724,7 @@ var UnsupportedFunctionalityError = class extends AISDKError {
724
724
  };
725
725
  _a14 = symbol14;
726
726
 
727
- // ../../node_modules/.pnpm/nanoid@3.3.11/node_modules/nanoid/non-secure/index.js
727
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/nanoid/3.3.12/d3cc005612b7a8092b0a69165d914c0ba90a6688b989e338761a671f4e42c3ea/node_modules/nanoid/non-secure/index.js
728
728
  var customAlphabet = (alphabet, defaultSize = 21) => {
729
729
  return (size = defaultSize) => {
730
730
  let id = "";
@@ -736,7 +736,7 @@ var customAlphabet = (alphabet, defaultSize = 21) => {
736
736
  };
737
737
  };
738
738
 
739
- // ../../node_modules/.pnpm/@ai-sdk+provider-utils@2.2.8_zod@4.3.6/node_modules/@ai-sdk/provider-utils/dist/index.mjs
739
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/provider-utils/2.2.8/df8e3f70254778b498fd8bdf67826f51b43b482ad982a3c0847b4920dc1874a4/node_modules/@ai-sdk/provider-utils/dist/index.mjs
740
740
  var import_secure_json_parse = __toESM(require_secure_json_parse());
741
741
  function combineHeaders(...headers) {
742
742
  return headers.reduce(