@mastra/rag 2.2.1 → 2.2.2-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 +9 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-rag-graph-rag.md +2 -2
- package/dist/docs/references/docs-rag-retrieval.md +15 -12
- package/dist/docs/references/reference-rag-rerank.md +1 -1
- package/dist/docs/references/reference-tools-vector-query-tool.md +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/tools/types.d.ts +1 -1
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils/tool-helpers.d.ts +1 -1
- package/dist/utils/tool-helpers.d.ts.map +1 -1
- package/package.json +14 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @mastra/rag
|
|
2
2
|
|
|
3
|
+
## 2.2.2-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 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))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`77a2351`](https://github.com/mastra-ai/mastra/commit/77a2351ee79296e360bce822cb3391f7cfd6489d)]:
|
|
10
|
+
- @mastra/core@1.43.1-alpha.0
|
|
11
|
+
|
|
3
12
|
## 2.2.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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(
|
|
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.
|
|
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.
|
|
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
|
-
//
|
|
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
|
-
"
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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(
|