@mastra/rag 2.4.2 → 2.5.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 +22 -0
- package/dist/docs/SKILL.md +7 -6
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/{docs-rag-chunking-and-embedding.md → guides-rag-chunking-and-embedding.md} +2 -2
- package/dist/docs/references/{docs-rag-graph-rag.md → guides-rag-graph-rag.md} +8 -8
- package/dist/docs/references/{docs-rag-overview.md → guides-rag-overview.md} +3 -3
- package/dist/docs/references/{docs-rag-retrieval.md → guides-rag-retrieval.md} +19 -19
- package/dist/docs/references/reference-rag-chunk.md +5 -5
- package/dist/docs/references/reference-rag-database-config.md +3 -3
- package/dist/docs/references/reference-rag-rerank.md +1 -1
- package/dist/docs/references/reference-tools-bedrock-kb-tool.md +117 -0
- package/dist/docs/references/reference-tools-graph-rag-tool.md +1 -1
- package/dist/docs/references/reference-tools-vector-query-tool.md +5 -5
- package/dist/document/types.d.ts.map +1 -1
- package/dist/index.cjs +6665 -7644
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6662 -7638
- package/dist/index.js.map +1 -1
- package/dist/tools/bedrock-knowledge-base.d.ts +29 -0
- package/dist/tools/bedrock-knowledge-base.d.ts.map +1 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/package.json +11 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @mastra/rag
|
|
2
2
|
|
|
3
|
+
## 2.5.0-alpha.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added Amazon Bedrock Knowledge Base tool (`createBedrockKBTool`) to @mastra/rag. Enables document retrieval from Bedrock Managed Knowledge Bases with agentic retrieval and automatic fallback. ([#19521](https://github.com/mastra-ai/mastra/pull/19521))
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { createBedrockKBTool } from '@mastra/rag';
|
|
11
|
+
|
|
12
|
+
const tool = createBedrockKBTool({
|
|
13
|
+
knowledgeBaseId: 'YOUR_KB_ID',
|
|
14
|
+
region: 'us-west-2',
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const results = await tool.execute({ queryText: 'What is RAG?' });
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [[`b4c89b4`](https://github.com/mastra-ai/mastra/commit/b4c89b4371b0c86da57403ad1a3b3ef0681f3128), [`e44e8f3`](https://github.com/mastra-ai/mastra/commit/e44e8f370b66c339ddcaba946d33da6d3c3f06cd), [`c967a5e`](https://github.com/mastra-ai/mastra/commit/c967a5eec150c5dc5418c4a4388982d1fb7ad27c), [`f53d5bd`](https://github.com/mastra-ai/mastra/commit/f53d5bd4885b29e4ac29a428a6044088ea8d6aa3), [`bda2235`](https://github.com/mastra-ai/mastra/commit/bda22353ee28f2df0eaea555f7cae1549f979c0b), [`a7eb4a1`](https://github.com/mastra-ai/mastra/commit/a7eb4a11450f6170274ed5141bffe821d4fdd5a6), [`2f9ef3f`](https://github.com/mastra-ai/mastra/commit/2f9ef3f4ca06fc2dcdd5088c26b7f4da6a016791), [`e7eefcb`](https://github.com/mastra-ai/mastra/commit/e7eefcb162cda7c493e8c3bf43050ead0efbcb2c), [`4d7aca2`](https://github.com/mastra-ai/mastra/commit/4d7aca2fe75f225c83d1502d63079568e6ec163f), [`c4ec889`](https://github.com/mastra-ai/mastra/commit/c4ec889561c0264c43f66d04d587bee4ce35e792), [`9be8878`](https://github.com/mastra-ai/mastra/commit/9be8878dcf0388e84fc4873e0eec27bd49b881a4)]:
|
|
23
|
+
- @mastra/core@1.58.0-alpha.2
|
|
24
|
+
|
|
3
25
|
## 2.4.2
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -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.
|
|
6
|
+
version: "2.5.0-alpha.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -14,12 +14,12 @@ Use this skill whenever you are working with @mastra/rag to obtain the domain-sp
|
|
|
14
14
|
|
|
15
15
|
Read the individual reference documents for detailed explanations and code examples.
|
|
16
16
|
|
|
17
|
-
###
|
|
17
|
+
### Guides
|
|
18
18
|
|
|
19
|
-
- [Chunking and embedding documents](references/
|
|
20
|
-
- [GraphRAG](references/
|
|
21
|
-
- [RAG (Retrieval-Augmented Generation) in Mastra](references/
|
|
22
|
-
- [Retrieval, semantic search, reranking](references/
|
|
19
|
+
- [Chunking and embedding documents](references/guides-rag-chunking-and-embedding.md) - Guide on chunking and embedding documents in Mastra for efficient processing and retrieval.
|
|
20
|
+
- [GraphRAG](references/guides-rag-graph-rag.md) - Guide on graph-based retrieval in Mastra's RAG systems for documents with complex relationships.
|
|
21
|
+
- [RAG (Retrieval-Augmented Generation) in Mastra](references/guides-rag-overview.md) - Overview of Retrieval-Augmented Generation (RAG) in Mastra, detailing its capabilities for enhancing LLM outputs with relevant context.
|
|
22
|
+
- [Retrieval, semantic search, reranking](references/guides-rag-retrieval.md) - Guide on retrieval processes in Mastra's RAG systems, including semantic search, filtering, and re-ranking.
|
|
23
23
|
|
|
24
24
|
### Reference
|
|
25
25
|
|
|
@@ -30,6 +30,7 @@ Read the individual reference documents for detailed explanations and code examp
|
|
|
30
30
|
- [Reference: GraphRAG](references/reference-rag-graph-rag.md) - Documentation for the GraphRAG class in Mastra, which implements a graph-based approach to retrieval augmented generation.
|
|
31
31
|
- [Reference: rerank()](references/reference-rag-rerank.md) - Documentation for the rerank function in Mastra, which provides advanced reranking capabilities for vector search results.
|
|
32
32
|
- [Reference: rerankWithScorer()](references/reference-rag-rerankWithScorer.md) - Documentation for the rerank function in Mastra, which provides advanced reranking capabilities for vector search results.
|
|
33
|
+
- [Reference: createBedrockKBTool()](references/reference-tools-bedrock-kb-tool.md) - Documentation for the Bedrock Knowledge Base Tool in Mastra, which retrieves documents from Amazon Bedrock Knowledge Bases with agentic retrieval support.
|
|
33
34
|
- [Reference: createDocumentChunkerTool()](references/reference-tools-document-chunker-tool.md) - Documentation for the Document Chunker Tool in Mastra, which splits documents into smaller chunks for efficient processing and retrieval.
|
|
34
35
|
- [Reference: createGraphRAGTool()](references/reference-tools-graph-rag-tool.md) - Documentation for the GraphRAG Tool in Mastra, which enhances RAG by building a graph of semantic relationships between documents.
|
|
35
36
|
- [Reference: createVectorQueryTool()](references/reference-tools-vector-query-tool.md) - Documentation for the Vector Query Tool in Mastra, which facilitates semantic search over vector stores with filtering and reranking capabilities.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Chunking and embedding documents
|
|
4
4
|
|
|
5
|
-
Before processing, create a MDocument instance from your content. You can initialize it from
|
|
5
|
+
Before processing, create a MDocument instance from your content. You can initialize it from different formats:
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
const docFromText = MDocument.fromText('Your plain text content...')
|
|
@@ -181,5 +181,5 @@ For more examples of different chunking strategies and embedding configurations,
|
|
|
181
181
|
|
|
182
182
|
For more details on vector databases and embeddings, see:
|
|
183
183
|
|
|
184
|
-
- [Vector Databases](https://mastra.ai/
|
|
184
|
+
- [Vector Databases](https://mastra.ai/guides/rag/vector-databases)
|
|
185
185
|
- [Embedding API Reference](https://mastra.ai/reference/rag/embeddings)
|
|
@@ -14,7 +14,7 @@ GraphRAG is particularly effective when:
|
|
|
14
14
|
- Understanding connections between concepts is important
|
|
15
15
|
- Simple vector similarity misses important contextual relationships
|
|
16
16
|
|
|
17
|
-
For straightforward semantic search without relationship traversal, use [standard retrieval methods](https://mastra.ai/
|
|
17
|
+
For straightforward semantic search without relationship traversal, use [standard retrieval methods](https://mastra.ai/guides/rag/retrieval).
|
|
18
18
|
|
|
19
19
|
## How GraphRAG works
|
|
20
20
|
|
|
@@ -49,7 +49,7 @@ const graphQueryTool = createGraphRAGTool({
|
|
|
49
49
|
|
|
50
50
|
The `graphOptions` parameter controls how the knowledge graph is built and traversed:
|
|
51
51
|
|
|
52
|
-
- `threshold`: Similarity threshold (0-1) for determining which chunks are related. Higher values create sparser graphs with stronger connections
|
|
52
|
+
- `threshold`: Similarity threshold (0-1) for determining which chunks are related. Higher values create sparser graphs with stronger connections. Lower values create denser graphs with more potential relationships.
|
|
53
53
|
- `dimension`: Vector embedding dimension. Must match the embedding model's output dimension (e.g., 1536 for OpenAI's text-embedding-3-small).
|
|
54
54
|
|
|
55
55
|
```ts
|
|
@@ -77,7 +77,7 @@ const ragAgent = new Agent({
|
|
|
77
77
|
instructions: `You are a helpful assistant that answers questions based on the provided context.
|
|
78
78
|
When answering questions, use the graph query tool to find relevant information and relationships.
|
|
79
79
|
Base your answers on the context provided by the tool, and clearly state if the context doesn't contain enough information.`,
|
|
80
|
-
model: 'openai/gpt-5.
|
|
80
|
+
model: 'openai/gpt-5.6-sol',
|
|
81
81
|
tools: {
|
|
82
82
|
graphQueryTool,
|
|
83
83
|
},
|
|
@@ -138,15 +138,15 @@ The agent uses the graph query tool to:
|
|
|
138
138
|
2. Find semantically similar chunks in the vector store
|
|
139
139
|
3. Build a knowledge graph from related chunks
|
|
140
140
|
4. Traverse the graph to find connected information
|
|
141
|
-
5. Return
|
|
141
|
+
5. Return complete context for generating the response
|
|
142
142
|
|
|
143
143
|
## Choosing the right threshold
|
|
144
144
|
|
|
145
|
-
The threshold parameter
|
|
145
|
+
The threshold parameter substantially impacts retrieval quality:
|
|
146
146
|
|
|
147
|
-
- **High threshold (0.8-0.9)**: Strict connections
|
|
147
|
+
- **High threshold (0.8-0.9)**: Strict connections and fewer relationships, plus more precise but potentially incomplete results
|
|
148
148
|
- **Medium threshold (0.6-0.8)**: Balanced approach, good for most use cases
|
|
149
|
-
- **Low threshold (0.4-0.6)**: More connections
|
|
149
|
+
- **Low threshold (0.4-0.6)**: More connections and broader context, plus risk of including less relevant information
|
|
150
150
|
|
|
151
151
|
Start with 0.7 and adjust based on your specific use case:
|
|
152
152
|
|
|
@@ -199,7 +199,7 @@ const agent = new Agent({
|
|
|
199
199
|
name: 'RAG Agent',
|
|
200
200
|
instructions: `Use vector search for simple fact-finding queries.
|
|
201
201
|
Use graph search when you need to understand relationships or find connected information.`,
|
|
202
|
-
model: 'openai/gpt-5.
|
|
202
|
+
model: 'openai/gpt-5.6-sol',
|
|
203
203
|
tools: {
|
|
204
204
|
vectorQueryTool,
|
|
205
205
|
graphQueryTool,
|
|
@@ -59,15 +59,15 @@ const results = await pgVector.query({
|
|
|
59
59
|
console.log('Similar chunks:', results)
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
This example shows the essentials
|
|
62
|
+
This example shows the essentials. Initialize a document and create chunks, then generate and store embeddings before querying for similar content.
|
|
63
63
|
|
|
64
64
|
## Document processing
|
|
65
65
|
|
|
66
|
-
The basic building block of RAG is document processing. Documents can be chunked using
|
|
66
|
+
The basic building block of RAG is document processing. Documents can be chunked using strategies (recursive, sliding window, etc.) and enriched with metadata. See the [chunking and embedding doc](https://mastra.ai/guides/rag/chunking-and-embedding).
|
|
67
67
|
|
|
68
68
|
## Vector storage
|
|
69
69
|
|
|
70
|
-
Mastra supports multiple vector stores for embedding persistence and similarity search, including pgvector, Pinecone, Qdrant, and MongoDB. See the [vector database doc](https://mastra.ai/
|
|
70
|
+
Mastra supports multiple vector stores for embedding persistence and similarity search, including pgvector, Pinecone, Qdrant, and MongoDB. See the [vector database doc](https://mastra.ai/guides/rag/vector-databases).
|
|
71
71
|
|
|
72
72
|
## More resources
|
|
73
73
|
|
|
@@ -160,15 +160,15 @@ When creating the tool, pay special attention to the tool's name and description
|
|
|
160
160
|
|
|
161
161
|
This is particularly useful when:
|
|
162
162
|
|
|
163
|
-
- Your agent needs to
|
|
163
|
+
- Your agent needs to decide at runtime what information to retrieve
|
|
164
164
|
- The retrieval process requires complex decision-making
|
|
165
165
|
- You want the agent to combine multiple retrieval strategies based on context
|
|
166
166
|
|
|
167
167
|
#### Database-Specific Configurations
|
|
168
168
|
|
|
169
|
-
The Vector Query Tool supports database-specific configurations that enable you to
|
|
169
|
+
The Vector Query Tool supports database-specific configurations that enable you to use unique features and optimizations of different vector stores.
|
|
170
170
|
|
|
171
|
-
> **Note:** These configurations are for **query-time options** like namespaces, performance tuning, and filtering
|
|
171
|
+
> **Note:** These configurations are for **query-time options** like namespaces, performance tuning, and filtering, not for database connection setup.
|
|
172
172
|
>
|
|
173
173
|
> Connection credentials (URLs, auth tokens) are configured when you instantiate the vector store class (e.g., `new LibSQLVector({ url: '...' })`).
|
|
174
174
|
|
|
@@ -235,7 +235,7 @@ const lanceQueryTool = createVectorQueryTool({
|
|
|
235
235
|
- **pgVector optimization**: Control search accuracy and speed with ef/probes parameters
|
|
236
236
|
- **Quality filtering**: Set minimum similarity thresholds to improve result relevance
|
|
237
237
|
- **LanceDB tables**: Separate data into tables for better organization and performance
|
|
238
|
-
- **Runtime flexibility**: Override configurations
|
|
238
|
+
- **Runtime flexibility**: Override configurations at runtime based on context
|
|
239
239
|
|
|
240
240
|
**Common Use Cases:**
|
|
241
241
|
|
|
@@ -274,7 +274,7 @@ import { PGVECTOR_PROMPT } from '@mastra/pg'
|
|
|
274
274
|
export const ragAgent = new Agent({
|
|
275
275
|
id: 'rag-agent',
|
|
276
276
|
name: 'RAG Agent',
|
|
277
|
-
model: 'openai/gpt-5.
|
|
277
|
+
model: 'openai/gpt-5.6-sol',
|
|
278
278
|
instructions: `
|
|
279
279
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
280
280
|
${PGVECTOR_PROMPT}
|
|
@@ -291,7 +291,7 @@ import { PINECONE_PROMPT } from '@mastra/pinecone'
|
|
|
291
291
|
export const ragAgent = new Agent({
|
|
292
292
|
id: 'rag-agent',
|
|
293
293
|
name: 'RAG Agent',
|
|
294
|
-
model: 'openai/gpt-5.
|
|
294
|
+
model: 'openai/gpt-5.6-sol',
|
|
295
295
|
instructions: `
|
|
296
296
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
297
297
|
${PINECONE_PROMPT}
|
|
@@ -308,7 +308,7 @@ import { QDRANT_PROMPT } from '@mastra/qdrant'
|
|
|
308
308
|
export const ragAgent = new Agent({
|
|
309
309
|
id: 'rag-agent',
|
|
310
310
|
name: 'RAG Agent',
|
|
311
|
-
model: 'openai/gpt-5.
|
|
311
|
+
model: 'openai/gpt-5.6-sol',
|
|
312
312
|
instructions: `
|
|
313
313
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
314
314
|
${QDRANT_PROMPT}
|
|
@@ -325,7 +325,7 @@ import { CHROMA_PROMPT } from '@mastra/chroma'
|
|
|
325
325
|
export const ragAgent = new Agent({
|
|
326
326
|
id: 'rag-agent',
|
|
327
327
|
name: 'RAG Agent',
|
|
328
|
-
model: 'openai/gpt-5.
|
|
328
|
+
model: 'openai/gpt-5.6-sol',
|
|
329
329
|
instructions: `
|
|
330
330
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
331
331
|
${CHROMA_PROMPT}
|
|
@@ -342,7 +342,7 @@ import { ASTRA_PROMPT } from '@mastra/astra'
|
|
|
342
342
|
export const ragAgent = new Agent({
|
|
343
343
|
id: 'rag-agent',
|
|
344
344
|
name: 'RAG Agent',
|
|
345
|
-
model: 'openai/gpt-5.
|
|
345
|
+
model: 'openai/gpt-5.6-sol',
|
|
346
346
|
instructions: `
|
|
347
347
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
348
348
|
${ASTRA_PROMPT}
|
|
@@ -359,7 +359,7 @@ import { LIBSQL_PROMPT } from '@mastra/libsql'
|
|
|
359
359
|
export const ragAgent = new Agent({
|
|
360
360
|
id: 'rag-agent',
|
|
361
361
|
name: 'RAG Agent',
|
|
362
|
-
model: 'openai/gpt-5.
|
|
362
|
+
model: 'openai/gpt-5.6-sol',
|
|
363
363
|
instructions: `
|
|
364
364
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
365
365
|
${LIBSQL_PROMPT}
|
|
@@ -376,7 +376,7 @@ import { UPSTASH_PROMPT } from '@mastra/upstash'
|
|
|
376
376
|
export const ragAgent = new Agent({
|
|
377
377
|
id: 'rag-agent',
|
|
378
378
|
name: 'RAG Agent',
|
|
379
|
-
model: 'openai/gpt-5.
|
|
379
|
+
model: 'openai/gpt-5.6-sol',
|
|
380
380
|
instructions: `
|
|
381
381
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
382
382
|
${UPSTASH_PROMPT}
|
|
@@ -393,7 +393,7 @@ import { VECTORIZE_PROMPT } from '@mastra/vectorize'
|
|
|
393
393
|
export const ragAgent = new Agent({
|
|
394
394
|
id: 'rag-agent',
|
|
395
395
|
name: 'RAG Agent',
|
|
396
|
-
model: 'openai/gpt-5.
|
|
396
|
+
model: 'openai/gpt-5.6-sol',
|
|
397
397
|
instructions: `
|
|
398
398
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
399
399
|
${VECTORIZE_PROMPT}
|
|
@@ -410,7 +410,7 @@ import { MONGODB_PROMPT } from '@mastra/mongodb'
|
|
|
410
410
|
export const ragAgent = new Agent({
|
|
411
411
|
id: 'rag-agent',
|
|
412
412
|
name: 'RAG Agent',
|
|
413
|
-
model: 'openai/gpt-5.
|
|
413
|
+
model: 'openai/gpt-5.6-sol',
|
|
414
414
|
instructions: `
|
|
415
415
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
416
416
|
${MONGODB_PROMPT}
|
|
@@ -427,7 +427,7 @@ import { OPENSEARCH_PROMPT } from '@mastra/opensearch'
|
|
|
427
427
|
export const ragAgent = new Agent({
|
|
428
428
|
id: 'rag-agent',
|
|
429
429
|
name: 'RAG Agent',
|
|
430
|
-
model: 'openai/gpt-5.
|
|
430
|
+
model: 'openai/gpt-5.6-sol',
|
|
431
431
|
instructions: `
|
|
432
432
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
433
433
|
${OPENSEARCH_PROMPT}
|
|
@@ -444,7 +444,7 @@ import { S3VECTORS_PROMPT } from '@mastra/s3vectors'
|
|
|
444
444
|
export const ragAgent = new Agent({
|
|
445
445
|
id: 'rag-agent',
|
|
446
446
|
name: 'RAG Agent',
|
|
447
|
-
model: 'openai/gpt-5.
|
|
447
|
+
model: 'openai/gpt-5.6-sol',
|
|
448
448
|
instructions: `
|
|
449
449
|
Process queries using the provided context. Structure responses to be concise and relevant.
|
|
450
450
|
${S3VECTORS_PROMPT}
|
|
@@ -455,10 +455,10 @@ export const ragAgent = new Agent({
|
|
|
455
455
|
|
|
456
456
|
### Re-ranking
|
|
457
457
|
|
|
458
|
-
Initial vector similarity search can sometimes miss
|
|
458
|
+
Initial vector similarity search can sometimes miss detailed relevance. Re-ranking is a more computationally expensive process, but more accurate algorithm that improves results by:
|
|
459
459
|
|
|
460
460
|
- Considering word order and exact matches
|
|
461
|
-
- Applying more
|
|
461
|
+
- Applying more advanced relevance scoring
|
|
462
462
|
- Using a method called cross-attention between query and documents
|
|
463
463
|
|
|
464
464
|
Here's how to use re-ranking:
|
|
@@ -476,7 +476,7 @@ const initialResults = await pgVector.query({
|
|
|
476
476
|
// Create a relevance scorer
|
|
477
477
|
const relevanceProvider = new MastraAgentRelevanceScorer(
|
|
478
478
|
'relevance-scorer',
|
|
479
|
-
'openai/gpt-5.
|
|
479
|
+
'openai/gpt-5.6-sol',
|
|
480
480
|
)
|
|
481
481
|
|
|
482
482
|
// Re-rank the results
|
|
@@ -517,4 +517,4 @@ The re-ranked results combine vector similarity with semantic understanding to i
|
|
|
517
517
|
|
|
518
518
|
For more details about re-ranking, see the [rerank()](https://mastra.ai/reference/rag/rerankWithScorer) method.
|
|
519
519
|
|
|
520
|
-
For graph-based retrieval that follows connections between chunks, see the [GraphRAG](https://mastra.ai/
|
|
520
|
+
For graph-based retrieval that follows connections between chunks, see the [GraphRAG](https://mastra.ai/guides/rag/graph-rag) documentation.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# .chunk()
|
|
4
4
|
|
|
5
|
-
The `.chunk()` function splits documents into smaller segments using
|
|
5
|
+
The `.chunk()` function splits documents into smaller segments using strategies and options.
|
|
6
6
|
|
|
7
7
|
## Example
|
|
8
8
|
|
|
@@ -39,11 +39,11 @@ const chunksWithMetadata = await doc.chunk({
|
|
|
39
39
|
|
|
40
40
|
## Parameters
|
|
41
41
|
|
|
42
|
-
The following parameters are available for all chunking strategies.
|
|
42
|
+
The following parameters are available for all chunking strategies. Each strategy will only utilize a subset of these parameters relevant to its specific use case.
|
|
43
43
|
|
|
44
44
|
**strategy** (`'recursive' | 'character' | 'token' | 'markdown' | 'semantic-markdown' | 'html' | 'json' | 'latex' | 'sentence'`): The chunking strategy to use. If not specified, defaults based on document type. Depending on the chunking strategy, there are additional optionals. Defaults: .md files → 'markdown', .html/.htm → 'html', .json → 'json', .tex → 'latex', others → 'recursive'
|
|
45
45
|
|
|
46
|
-
**maxSize** (`number`): Maximum size of each chunk.
|
|
46
|
+
**maxSize** (`number`): Maximum size of each chunk. Some strategy configurations (markdown with headers, HTML with headers) ignore this parameter. (Default: `4000`)
|
|
47
47
|
|
|
48
48
|
**overlap** (`number`): Number of characters/tokens that overlap between chunks. (Default: `50`)
|
|
49
49
|
|
|
@@ -162,7 +162,7 @@ The options documented below are passed directly at the top level of the configu
|
|
|
162
162
|
|
|
163
163
|
**returnEachLine** (`boolean`): Whether to return each line as a separate chunk
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
When using the HTML strategy, all general options are ignored. Use `headers` for header-based splitting or `sections` for section-based splitting. If used together, `sections` will be ignored.
|
|
166
166
|
|
|
167
167
|
### Markdown
|
|
168
168
|
|
|
@@ -172,7 +172,7 @@ The options documented below are passed directly at the top level of the configu
|
|
|
172
172
|
|
|
173
173
|
**returnEachLine** (`boolean`): Whether to return each line as a separate chunk
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
When using the `headers` option, the markdown strategy ignores all general options and content is split based on the markdown header structure. To use size-based chunking with markdown, omit the `headers` parameter.
|
|
176
176
|
|
|
177
177
|
### Semantic Markdown
|
|
178
178
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# DatabaseConfig
|
|
4
4
|
|
|
5
|
-
The `DatabaseConfig` type allows you to specify database-specific configurations when using vector query tools. These configurations enable you to
|
|
5
|
+
The `DatabaseConfig` type allows you to specify database-specific configurations when using vector query tools. These configurations enable you to use features and optimizations offered by different vector stores.
|
|
6
6
|
|
|
7
7
|
## Type definition
|
|
8
8
|
|
|
@@ -252,7 +252,7 @@ const vectorTool = createVectorQueryTool({
|
|
|
252
252
|
1. **Environment Configuration**: Use different namespaces or configurations for different environments
|
|
253
253
|
2. **Performance Tuning**: Start with default values and adjust based on your specific needs
|
|
254
254
|
3. **Quality Filtering**: Use minScore to filter out low-quality results
|
|
255
|
-
4. **Runtime Flexibility**: Override configurations at runtime for
|
|
255
|
+
4. **Runtime Flexibility**: Override configurations at runtime for runtime-defined scenarios
|
|
256
256
|
5. **Documentation**: Document your specific configuration choices for team members
|
|
257
257
|
|
|
258
258
|
## Migration guide
|
|
@@ -275,5 +275,5 @@ const vectorTool = createVectorQueryTool({
|
|
|
275
275
|
## Related
|
|
276
276
|
|
|
277
277
|
- [createVectorQueryTool()](https://mastra.ai/reference/tools/vector-query-tool)
|
|
278
|
-
- [Hybrid Vector Search](https://mastra.ai/
|
|
278
|
+
- [Hybrid Vector Search](https://mastra.ai/guides/rag/retrieval)
|
|
279
279
|
- [Metadata Filters](https://mastra.ai/reference/rag/metadata-filters)
|
|
@@ -18,7 +18,7 @@ function rerank(
|
|
|
18
18
|
```typescript
|
|
19
19
|
import { rerank } from '@mastra/rag'
|
|
20
20
|
|
|
21
|
-
const model = 'openai/gpt-5.
|
|
21
|
+
const model = 'openai/gpt-5.6-sol'
|
|
22
22
|
|
|
23
23
|
const rerankedResults = await rerank(vectorSearchResults, 'How do I deploy to production?', model, {
|
|
24
24
|
weights: {
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# createBedrockKBTool()
|
|
4
|
+
|
|
5
|
+
The `createBedrockKBTool()` function creates a tool that retrieves relevant documents from an Amazon Bedrock Knowledge Base. It supports both managed search configuration and agentic retrieval (query decomposition and managed reranking) with automatic fallback to standard retrieval.
|
|
6
|
+
|
|
7
|
+
## Usage example
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { createBedrockKBTool } from '@mastra/rag'
|
|
11
|
+
|
|
12
|
+
const kbTool = createBedrockKBTool({
|
|
13
|
+
knowledgeBaseId: 'YOUR_KB_ID',
|
|
14
|
+
region: 'us-west-2',
|
|
15
|
+
numberOfResults: 5,
|
|
16
|
+
useAgenticRetrieval: true,
|
|
17
|
+
})
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### With an Agent
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { Agent } from '@mastra/core/agent'
|
|
24
|
+
import { createBedrockKBTool } from '@mastra/rag'
|
|
25
|
+
|
|
26
|
+
const kbTool = createBedrockKBTool({
|
|
27
|
+
knowledgeBaseId: 'YOUR_KB_ID',
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const agent = new Agent({
|
|
31
|
+
name: 'KnowledgeAssistant',
|
|
32
|
+
instructions: 'Use the knowledge base tool to answer questions.',
|
|
33
|
+
model: myModel,
|
|
34
|
+
tools: { kb: kbTool },
|
|
35
|
+
})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Parameters
|
|
39
|
+
|
|
40
|
+
**knowledgeBaseId** (`string`): The ID of the Amazon Bedrock Knowledge Base to query.
|
|
41
|
+
|
|
42
|
+
**region** (`string`): AWS region where the Knowledge Base is deployed. Defaults to AWS\_REGION environment variable or us-east-1.
|
|
43
|
+
|
|
44
|
+
**numberOfResults** (`number`): Maximum number of results to return. Defaults to 5.
|
|
45
|
+
|
|
46
|
+
**useAgenticRetrieval** (`boolean`): Use AgenticRetrieveStream for complex queries with query decomposition and managed reranking. Falls back to standard Retrieve on failure. Defaults to true (disable with USE\_AGENTIC\_RETRIEVAL=false env var).
|
|
47
|
+
|
|
48
|
+
**userId** (`string`): Default AWS user ID for document-level access control. A userId in the Mastra request context takes precedence.
|
|
49
|
+
|
|
50
|
+
## Input Schema
|
|
51
|
+
|
|
52
|
+
The tool accepts the following input when called by an agent:
|
|
53
|
+
|
|
54
|
+
**queryText** (`string`): The search query to find relevant documents in the knowledge base.
|
|
55
|
+
|
|
56
|
+
## Output Schema
|
|
57
|
+
|
|
58
|
+
The tool returns an object with:
|
|
59
|
+
|
|
60
|
+
**results** (`BedrockKBResult[]`): Array of retrieval results. Standard retrieval includes source and score when Bedrock provides them; agentic retrieval may omit those fields.
|
|
61
|
+
|
|
62
|
+
### BedrockKBResult
|
|
63
|
+
|
|
64
|
+
| Field | Type | Description |
|
|
65
|
+
| ---------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
66
|
+
| `content` | `string` | The text content of the retrieved passage. |
|
|
67
|
+
| `source` | `string \| undefined` | The source URI when Bedrock provides one. Agentic retrieval only includes this field when the result metadata contains `_source_uri`. |
|
|
68
|
+
| `score` | `number \| undefined` | The relevance score returned by standard retrieval. The agentic API doesn't return a score for result items. |
|
|
69
|
+
| `metadata` | `Record<string, unknown>` | Additional metadata from the retrieval result. |
|
|
70
|
+
|
|
71
|
+
## Retrieval Modes
|
|
72
|
+
|
|
73
|
+
### Agentic Retrieval (default)
|
|
74
|
+
|
|
75
|
+
When `useAgenticRetrieval` is `true` (default), the tool uses `AgenticRetrieveStreamCommand` which:
|
|
76
|
+
|
|
77
|
+
- Decomposes complex queries into sub-queries
|
|
78
|
+
- Retrieves across multiple passes
|
|
79
|
+
- Applies managed reranking for better results
|
|
80
|
+
|
|
81
|
+
If agentic retrieval fails (e.g., older SDK, permissions), it automatically falls back to standard managed retrieval.
|
|
82
|
+
|
|
83
|
+
### Standard Managed Retrieval
|
|
84
|
+
|
|
85
|
+
When `useAgenticRetrieval` is `false`, the tool uses `RetrieveCommand` with `managedSearchConfiguration` for direct single-pass retrieval.
|
|
86
|
+
|
|
87
|
+
## User-based access control
|
|
88
|
+
|
|
89
|
+
Set `userId` in the Mastra request context to forward it as the Bedrock `userContext.userId`. This supports knowledge bases that enforce document-level access control. The request context value overrides the default `userId` configured on the tool.
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
import { RequestContext } from '@mastra/core/request-context'
|
|
93
|
+
|
|
94
|
+
const requestContext = new RequestContext()
|
|
95
|
+
requestContext.set('userId', 'user-123')
|
|
96
|
+
|
|
97
|
+
await agent.generate('Find my private documents', { requestContext })
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Required IAM Permissions
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"Version": "2012-10-17",
|
|
105
|
+
"Statement": [
|
|
106
|
+
{
|
|
107
|
+
"Effect": "Allow",
|
|
108
|
+
"Action": ["bedrock:Retrieve", "bedrock:AgenticRetrieveStream"],
|
|
109
|
+
"Resource": "arn:aws:bedrock:*:*:knowledge-base/*"
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## SDK Requirements
|
|
116
|
+
|
|
117
|
+
- `@aws-sdk/client-bedrock-agent-runtime` >= 3.1000 (AgenticRetrieveStreamCommand requires \~3.1000+)
|
|
@@ -51,7 +51,7 @@ const graphTool = createGraphRAGTool({
|
|
|
51
51
|
|
|
52
52
|
**graphOptions.restartProb** (`number`): Probability of restarting random walk from query node. (Can be set at creation or overridden at runtime.)
|
|
53
53
|
|
|
54
|
-
**providerOptions** (`Record<string, Record<string, any>>`): Provider-specific options for the embedding model (e.g., outputDimensionality).
|
|
54
|
+
**providerOptions** (`Record<string, Record<string, any>>`): Provider-specific options for the embedding model (e.g., outputDimensionality). Only works with AI SDK EmbeddingModelV2 models. For V1 models, configure options when creating the model itself.
|
|
55
55
|
|
|
56
56
|
**vectorStore** (`MastraVector | VectorStoreResolver`): Direct vector store instance or a resolver function for dynamic selection. Use a function for multi-tenant applications where the vector store is selected based on request context. When provided, vectorStoreName becomes optional.
|
|
57
57
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# createVectorQueryTool()
|
|
4
4
|
|
|
5
|
-
The `createVectorQueryTool()` function creates a tool for semantic search over vector stores. It supports filtering, reranking, database-specific configurations, and integrates with
|
|
5
|
+
The `createVectorQueryTool()` function creates a tool for semantic search over vector stores. It supports filtering, reranking, database-specific configurations, and integrates with vector store backends.
|
|
6
6
|
|
|
7
7
|
## Basic usage
|
|
8
8
|
|
|
@@ -69,7 +69,7 @@ const queryTool = createVectorQueryTool({
|
|
|
69
69
|
|
|
70
70
|
**databaseConfig.chroma.whereDocument** (`Record<string, any>`): Document content filtering conditions
|
|
71
71
|
|
|
72
|
-
**providerOptions** (`Record<string, Record<string, any>>`): Provider-specific options for the embedding model (e.g., outputDimensionality).
|
|
72
|
+
**providerOptions** (`Record<string, Record<string, any>>`): Provider-specific options for the embedding model (e.g., outputDimensionality). Only works with AI SDK EmbeddingModelV2 models. For V1 models, configure options when creating the model itself.
|
|
73
73
|
|
|
74
74
|
**vectorStore** (`MastraVector | VectorStoreResolver`): Direct vector store instance or a resolver function for dynamic selection. Use a function for multi-tenant applications where the vector store is selected based on request context. When provided, vectorStoreName becomes optional.
|
|
75
75
|
|
|
@@ -144,7 +144,7 @@ const queryTool = createVectorQueryTool({
|
|
|
144
144
|
indexName: 'documentation',
|
|
145
145
|
model: new ModelRouterEmbeddingModel('openai/text-embedding-3-small'),
|
|
146
146
|
reranker: {
|
|
147
|
-
model: 'openai/gpt-5.
|
|
147
|
+
model: 'openai/gpt-5.6-sol',
|
|
148
148
|
options: {
|
|
149
149
|
weights: {
|
|
150
150
|
semantic: 0.5, // Semantic relevance weight
|
|
@@ -182,7 +182,7 @@ This example shows how to customize the tool description for a specific use case
|
|
|
182
182
|
|
|
183
183
|
## Database-specific configuration examples
|
|
184
184
|
|
|
185
|
-
The `databaseConfig` parameter allows you to
|
|
185
|
+
The `databaseConfig` parameter allows you to use features and optimizations specific to each vector database. These configurations are automatically applied during query execution.
|
|
186
186
|
|
|
187
187
|
**Pinecone**:
|
|
188
188
|
|
|
@@ -475,7 +475,7 @@ const result = await vectorQueryTool.execute(
|
|
|
475
475
|
)
|
|
476
476
|
```
|
|
477
477
|
|
|
478
|
-
This pattern is similar to how `Agent.memory` supports
|
|
478
|
+
This pattern is similar to how `Agent.memory` supports runtime-defined configuration and enables:
|
|
479
479
|
|
|
480
480
|
- **Schema isolation**: Each tenant's data in separate PostgreSQL schemas
|
|
481
481
|
- **Database isolation**: Route to different database instances per tenant
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/document/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAEtB,oBAAY,QAAQ;IAClB,GAAG,QAAQ;IACX,EAAE,OAAO;IACT,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,EAAE,OAAO;IACT,EAAE,OAAO;IACT,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;IACf,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,CAAC,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