@mastra/rag 1.0.0 → 1.0.1
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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +39 -0
- package/dist/index.cjs +3 -2
- package/dist/index.js +3 -2
- package/package.json +5 -5
- package/src/tools/vector-query.ts +3 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/rag@1.0.
|
|
2
|
+
> @mastra/rag@1.0.1-alpha.0 build /home/runner/work/mastra/mastra/packages/rag
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.5.0
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 14155ms
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
11
|
[34mCLI[39m Target: es2022
|
|
12
12
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
13
13
|
[36mWriting package typings: /home/runner/work/mastra/mastra/packages/rag/dist/_tsup-dts-rollup.d.ts[39m
|
|
14
14
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
15
15
|
[36mWriting package typings: /home/runner/work/mastra/mastra/packages/rag/dist/_tsup-dts-rollup.d.cts[39m
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 13672ms
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
20
|
+
[32mESM[39m [1mdist/index.js [22m[32m242.08 KB[39m
|
|
21
|
+
[32mESM[39m ⚡️ Build success in 4294ms
|
|
22
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m243.79 KB[39m
|
|
23
|
+
[32mCJS[39m ⚡️ Build success in 4295ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @mastra/rag
|
|
2
2
|
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8e1b6e9: dependencies updates:
|
|
8
|
+
- Updated dependency [`zod@^3.25.67` ↗︎](https://www.npmjs.com/package/zod/v/3.25.67) (from `^3.25.57`, in `dependencies`)
|
|
9
|
+
- a85fa13: Add model to createVectorQueryTool runtimeContext
|
|
10
|
+
- Updated dependencies [15e9d26]
|
|
11
|
+
- Updated dependencies [d1baedb]
|
|
12
|
+
- Updated dependencies [d8f2d19]
|
|
13
|
+
- Updated dependencies [4d21bf2]
|
|
14
|
+
- Updated dependencies [07d6d88]
|
|
15
|
+
- Updated dependencies [9d52b17]
|
|
16
|
+
- Updated dependencies [2097952]
|
|
17
|
+
- Updated dependencies [792c4c0]
|
|
18
|
+
- Updated dependencies [5d74aab]
|
|
19
|
+
- Updated dependencies [a8b194f]
|
|
20
|
+
- Updated dependencies [4fb0cc2]
|
|
21
|
+
- Updated dependencies [d2a7a31]
|
|
22
|
+
- Updated dependencies [502fe05]
|
|
23
|
+
- Updated dependencies [144eb0b]
|
|
24
|
+
- Updated dependencies [8ba1b51]
|
|
25
|
+
- Updated dependencies [4efcfa0]
|
|
26
|
+
- Updated dependencies [0e17048]
|
|
27
|
+
- @mastra/core@0.10.7
|
|
28
|
+
|
|
29
|
+
## 1.0.1-alpha.0
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- 8e1b6e9: dependencies updates:
|
|
34
|
+
- Updated dependency [`zod@^3.25.67` ↗︎](https://www.npmjs.com/package/zod/v/3.25.67) (from `^3.25.57`, in `dependencies`)
|
|
35
|
+
- a85fa13: Add model to createVectorQueryTool runtimeContext
|
|
36
|
+
- Updated dependencies [15e9d26]
|
|
37
|
+
- Updated dependencies [07d6d88]
|
|
38
|
+
- Updated dependencies [5d74aab]
|
|
39
|
+
- Updated dependencies [144eb0b]
|
|
40
|
+
- @mastra/core@0.10.7-alpha.2
|
|
41
|
+
|
|
3
42
|
## 1.0.0
|
|
4
43
|
|
|
5
44
|
### Major Changes
|
package/dist/index.cjs
CHANGED
|
@@ -729,7 +729,7 @@ var customAlphabet = (alphabet, defaultSize = 21) => {
|
|
|
729
729
|
};
|
|
730
730
|
};
|
|
731
731
|
|
|
732
|
-
// ../../node_modules/.pnpm/@ai-sdk+provider-utils@2.2.8_zod@3.25.
|
|
732
|
+
// ../../node_modules/.pnpm/@ai-sdk+provider-utils@2.2.8_zod@3.25.67/node_modules/@ai-sdk/provider-utils/dist/index.mjs
|
|
733
733
|
var import_secure_json_parse = __toESM(require_secure_json_parse());
|
|
734
734
|
function combineHeaders(...headers) {
|
|
735
735
|
return headers.reduce(
|
|
@@ -6531,7 +6531,7 @@ var createGraphRAGTool = (options) => {
|
|
|
6531
6531
|
});
|
|
6532
6532
|
};
|
|
6533
6533
|
var createVectorQueryTool = (options) => {
|
|
6534
|
-
const {
|
|
6534
|
+
const { id, description } = options;
|
|
6535
6535
|
const toolId = id || `VectorQuery ${options.vectorStoreName} ${options.indexName} Tool`;
|
|
6536
6536
|
const toolDescription = description || defaultVectorQueryDescription();
|
|
6537
6537
|
const inputSchema = options.enableFilter ? filterSchema : zod.z.object(baseSchema).passthrough();
|
|
@@ -6547,6 +6547,7 @@ var createVectorQueryTool = (options) => {
|
|
|
6547
6547
|
const includeSources = runtimeContext.get("includeSources") ?? options.includeSources ?? true;
|
|
6548
6548
|
const reranker = runtimeContext.get("reranker") ?? options.reranker;
|
|
6549
6549
|
const databaseConfig = runtimeContext.get("databaseConfig") ?? options.databaseConfig;
|
|
6550
|
+
const model = runtimeContext.get("model") ?? options.model;
|
|
6550
6551
|
if (!indexName) throw new Error(`indexName is required, got: ${indexName}`);
|
|
6551
6552
|
if (!vectorStoreName) throw new Error(`vectorStoreName is required, got: ${vectorStoreName}`);
|
|
6552
6553
|
const topK = runtimeContext.get("topK") ?? context.topK ?? 10;
|
package/dist/index.js
CHANGED
|
@@ -727,7 +727,7 @@ var customAlphabet = (alphabet, defaultSize = 21) => {
|
|
|
727
727
|
};
|
|
728
728
|
};
|
|
729
729
|
|
|
730
|
-
// ../../node_modules/.pnpm/@ai-sdk+provider-utils@2.2.8_zod@3.25.
|
|
730
|
+
// ../../node_modules/.pnpm/@ai-sdk+provider-utils@2.2.8_zod@3.25.67/node_modules/@ai-sdk/provider-utils/dist/index.mjs
|
|
731
731
|
var import_secure_json_parse = __toESM(require_secure_json_parse());
|
|
732
732
|
function combineHeaders(...headers) {
|
|
733
733
|
return headers.reduce(
|
|
@@ -6529,7 +6529,7 @@ var createGraphRAGTool = (options) => {
|
|
|
6529
6529
|
});
|
|
6530
6530
|
};
|
|
6531
6531
|
var createVectorQueryTool = (options) => {
|
|
6532
|
-
const {
|
|
6532
|
+
const { id, description } = options;
|
|
6533
6533
|
const toolId = id || `VectorQuery ${options.vectorStoreName} ${options.indexName} Tool`;
|
|
6534
6534
|
const toolDescription = description || defaultVectorQueryDescription();
|
|
6535
6535
|
const inputSchema = options.enableFilter ? filterSchema : z.object(baseSchema).passthrough();
|
|
@@ -6545,6 +6545,7 @@ var createVectorQueryTool = (options) => {
|
|
|
6545
6545
|
const includeSources = runtimeContext.get("includeSources") ?? options.includeSources ?? true;
|
|
6546
6546
|
const reranker = runtimeContext.get("reranker") ?? options.reranker;
|
|
6547
6547
|
const databaseConfig = runtimeContext.get("databaseConfig") ?? options.databaseConfig;
|
|
6548
|
+
const model = runtimeContext.get("model") ?? options.model;
|
|
6548
6549
|
if (!indexName) throw new Error(`indexName is required, got: ${indexName}`);
|
|
6549
6550
|
if (!vectorStoreName) throw new Error(`vectorStoreName is required, got: ${vectorStoreName}`);
|
|
6550
6551
|
const topK = runtimeContext.get("topK") ?? context.topK ?? 10;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/rag",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"js-tiktoken": "^1.0.20",
|
|
27
27
|
"node-html-better-parser": "^1.4.11",
|
|
28
28
|
"pathe": "^2.0.3",
|
|
29
|
-
"zod": "^3.25.
|
|
29
|
+
"zod": "^3.25.67"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@mastra/core": "^0.10.0-alpha.0",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"@types/node": "^20.19.0",
|
|
41
41
|
"ai": "^4.3.16",
|
|
42
42
|
"dotenv": "^16.5.0",
|
|
43
|
-
"eslint": "^9.
|
|
43
|
+
"eslint": "^9.29.0",
|
|
44
44
|
"tsup": "^8.5.0",
|
|
45
45
|
"typescript": "^5.8.3",
|
|
46
46
|
"vitest": "^3.2.3",
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
47
|
+
"@mastra/core": "0.10.7",
|
|
48
|
+
"@internal/lint": "0.0.14"
|
|
49
49
|
},
|
|
50
50
|
"keywords": [
|
|
51
51
|
"rag",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createTool } from '@mastra/core/tools';
|
|
2
|
+
import type { EmbeddingModel } from 'ai';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
|
|
4
5
|
import { rerank } from '../rerank';
|
|
@@ -9,7 +10,7 @@ import { convertToSources } from '../utils/convert-sources';
|
|
|
9
10
|
import type { VectorQueryToolOptions } from './types';
|
|
10
11
|
|
|
11
12
|
export const createVectorQueryTool = (options: VectorQueryToolOptions) => {
|
|
12
|
-
const {
|
|
13
|
+
const { id, description } = options;
|
|
13
14
|
const toolId = id || `VectorQuery ${options.vectorStoreName} ${options.indexName} Tool`;
|
|
14
15
|
const toolDescription = description || defaultVectorQueryDescription();
|
|
15
16
|
const inputSchema = options.enableFilter ? filterSchema : z.object(baseSchema).passthrough();
|
|
@@ -26,6 +27,7 @@ export const createVectorQueryTool = (options: VectorQueryToolOptions) => {
|
|
|
26
27
|
const includeSources: boolean = runtimeContext.get('includeSources') ?? options.includeSources ?? true;
|
|
27
28
|
const reranker: RerankConfig = runtimeContext.get('reranker') ?? options.reranker;
|
|
28
29
|
const databaseConfig = runtimeContext.get('databaseConfig') ?? options.databaseConfig;
|
|
30
|
+
const model: EmbeddingModel<string> = runtimeContext.get('model') ?? options.model;
|
|
29
31
|
|
|
30
32
|
if (!indexName) throw new Error(`indexName is required, got: ${indexName}`);
|
|
31
33
|
if (!vectorStoreName) throw new Error(`vectorStoreName is required, got: ${vectorStoreName}`);
|