@mastra/rag 2.4.2 → 2.5.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.
@@ -0,0 +1,29 @@
1
+ export interface BedrockKBToolOptions {
2
+ /** The ID of the Bedrock Knowledge Base. */
3
+ knowledgeBaseId: string;
4
+ /** AWS region. Defaults to AWS_REGION env var or us-east-1. */
5
+ region?: string;
6
+ /** Maximum number of results. Defaults to 5. */
7
+ numberOfResults?: number;
8
+ /** Use AgenticRetrieveStream for complex queries with query decomposition and managed reranking. Falls back to plain Retrieve on failure. Defaults to true. */
9
+ useAgenticRetrieval?: boolean;
10
+ /** Default AWS user ID for access-controlled retrieval. A userId in the tool request context takes precedence. */
11
+ userId?: string;
12
+ }
13
+ export interface BedrockKBResult {
14
+ content: string;
15
+ source?: string;
16
+ score?: number;
17
+ metadata: Record<string, unknown>;
18
+ }
19
+ export declare function createBedrockKBTool(options: BedrockKBToolOptions): import("@mastra/core/tools").Tool<{
20
+ queryText: string;
21
+ }, {
22
+ results: {
23
+ content: string;
24
+ metadata: Record<string, unknown>;
25
+ source?: string | undefined;
26
+ score?: number | undefined;
27
+ }[];
28
+ }, unknown, unknown, import("@mastra/core/tools").ToolExecutionContext<unknown, unknown, unknown>, `bedrock_knowledge_base_${string}`, unknown>;
29
+ //# sourceMappingURL=bedrock-knowledge-base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bedrock-knowledge-base.d.ts","sourceRoot":"","sources":["../../src/tools/bedrock-knowledge-base.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,eAAe,EAAE,MAAM,CAAC;IACxB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+JAA+J;IAC/J,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,kHAAkH;IAClH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAmCD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB;;;;;;;;;gJA2FhE"}
@@ -2,4 +2,6 @@ export * from './document-chunker.js';
2
2
  export * from './graph-rag.js';
3
3
  export * from './vector-query.js';
4
4
  export type { VectorStoreResolver, VectorStoreResolverContext, VectorQueryToolOptions, GraphRagToolOptions, DatabaseConfig, PineconeConfig, PgVectorConfig, ChromaConfig, TurbopufferConfig, } from './types.js';
5
+ export { createBedrockKBTool } from './bedrock-knowledge-base.js';
6
+ export type { BedrockKBToolOptions, BedrockKBResult } from './bedrock-knowledge-base.js';
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,YAAY,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,cAAc,EACd,YAAY,EACZ,iBAAiB,GAClB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,YAAY,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,cAAc,EACd,YAAY,EACZ,iBAAiB,GAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/rag",
3
- "version": "2.4.2",
3
+ "version": "2.5.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -25,6 +25,7 @@
25
25
  "author": "",
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
+ "@aws-sdk/client-bedrock-agent-runtime": "^3.1076.0",
28
29
  "big.js": "^7.0.1",
29
30
  "js-tiktoken": "^1.0.21",
30
31
  "node-html-better-parser": "^1.5.8",
@@ -43,16 +44,17 @@
43
44
  "@vitest/ui": "4.1.10",
44
45
  "ai": "^4.3.19",
45
46
  "dotenv": "^17.4.2",
47
+ "esbuild": "^0.28.0",
46
48
  "eslint": "^10.7.0",
47
- "tsup": "^8.5.1",
49
+ "tsdown": "0.22.9",
48
50
  "tsx": "^4.23.1",
49
51
  "typescript": "^6.0.3",
50
52
  "vitest": "4.1.10",
51
53
  "zod": "^4.4.3",
52
- "@internal/ai-sdk-v4": "0.0.62",
53
- "@internal/lint": "0.0.115",
54
- "@mastra/core": "1.52.0",
55
- "@internal/types-builder": "0.0.90"
54
+ "@internal/ai-sdk-v4": "0.0.69",
55
+ "@internal/types-builder": "0.0.97",
56
+ "@internal/lint": "0.0.122",
57
+ "@mastra/core": "1.58.0"
56
58
  },
57
59
  "keywords": [
58
60
  "rag",
@@ -83,10 +85,11 @@
83
85
  "node": ">=22.13.0"
84
86
  },
85
87
  "scripts": {
86
- "build:lib": "tsup --silent --config tsup.config.ts",
88
+ "build:lib": "tsdown --silent --config tsdown.config.ts",
87
89
  "build:watch": "pnpm build:lib --watch",
88
90
  "vitest": "vitest",
89
91
  "test": "vitest run",
90
- "lint": "eslint ."
92
+ "lint": "oxlint . && eslint .",
93
+ "lint:fix": "oxlint --fix . && eslint --fix ."
91
94
  }
92
95
  }