@mastra/rag 2.0.0 → 2.1.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 +143 -0
- package/dist/docs/README.md +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/SOURCE_MAP.json +1 -1
- package/dist/docs/rag/02-chunking-and-embedding.md +5 -5
- package/dist/docs/rag/03-retrieval.md +4 -4
- package/dist/docs/rag/04-graph-rag.md +3 -3
- package/dist/docs/rag/05-reference.md +4 -4
- package/dist/docs/tools/01-reference.md +4 -4
- package/dist/document/transformers/character.d.ts.map +1 -1
- package/dist/index.cjs +347 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +347 -2
- package/dist/index.js.map +1 -1
- package/dist/tools/document-chunker.d.ts +1 -1
- package/dist/tools/document-chunker.d.ts.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,148 @@
|
|
|
1
1
|
# @mastra/rag
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added support for 20 additional languages in code chunking ([#12154](https://github.com/mastra-ai/mastra/pull/12154))
|
|
8
|
+
|
|
9
|
+
Extended RecursiveCharacterTransformer to support all languages defined in the Language enum. Previously, only 6 languages were supported (CPP, C, TS, MARKDOWN, LATEX, PHP), causing runtime errors for other defined languages.
|
|
10
|
+
|
|
11
|
+
**Newly supported languages:**
|
|
12
|
+
- GO, JAVA, KOTLIN, JS, PYTHON, RUBY, RUST, SCALA, SWIFT (popular programming languages)
|
|
13
|
+
- HTML, SOL (Solidity), CSHARP, COBOL, LUA, PERL, HASKELL, ELIXIR, POWERSHELL (additional languages)
|
|
14
|
+
- PROTO (Protocol Buffers), RST (reStructuredText) (data/documentation formats)
|
|
15
|
+
|
|
16
|
+
Each language has been configured with appropriate separators based on its syntax patterns (modules, classes, functions, control structures) to enable semantic code chunking.
|
|
17
|
+
|
|
18
|
+
**Before:**
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { RecursiveCharacterTransformer, Language } from '@mastra/rag';
|
|
22
|
+
|
|
23
|
+
// These would all throw "Language X is not supported!" errors
|
|
24
|
+
const goTransformer = RecursiveCharacterTransformer.fromLanguage(Language.GO);
|
|
25
|
+
const pythonTransformer = RecursiveCharacterTransformer.fromLanguage(Language.PYTHON);
|
|
26
|
+
const rustTransformer = RecursiveCharacterTransformer.fromLanguage(Language.RUST);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**After:**
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import { RecursiveCharacterTransformer, Language } from '@mastra/rag';
|
|
33
|
+
|
|
34
|
+
// All languages now work seamlessly
|
|
35
|
+
const goTransformer = RecursiveCharacterTransformer.fromLanguage(Language.GO);
|
|
36
|
+
const goChunks = goTransformer.transform(goCodeDocument);
|
|
37
|
+
|
|
38
|
+
const pythonTransformer = RecursiveCharacterTransformer.fromLanguage(Language.PYTHON);
|
|
39
|
+
const pythonChunks = pythonTransformer.transform(pythonCodeDocument);
|
|
40
|
+
|
|
41
|
+
const rustTransformer = RecursiveCharacterTransformer.fromLanguage(Language.RUST);
|
|
42
|
+
const rustChunks = rustTransformer.transform(rustCodeDocument);
|
|
43
|
+
// All languages in the Language enum are now fully supported
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- Add support for PHP in Language enum
|
|
49
|
+
([#12124](https://github.com/mastra-ai/mastra/pull/12124))
|
|
50
|
+
Previously, the Language enum defined PHP, but it was not supported in the `getSeparatorsForLanguage` method. This caused runtime errors when trying to use PHP for code chunking.
|
|
51
|
+
This change adds proper separator definitions for PHP, ensuring that PHP defined in the Language enum is now fully supported. PHP has been configured with appropriate separators based on its syntax and common programming patterns (classes, functions, control structures, etc.).
|
|
52
|
+
**Before:**
|
|
53
|
+
```typescript
|
|
54
|
+
import { RecursiveCharacterTransformer, Language } from '@mastra/rag';
|
|
55
|
+
|
|
56
|
+
const transformer = RecursiveCharacterTransformer.fromLanguage(Language.PHP);
|
|
57
|
+
const chunks = transformer.transform(phpCodeDocument);
|
|
58
|
+
// Throws: "Language PHP is not supported!"
|
|
59
|
+
```
|
|
60
|
+
**After:**
|
|
61
|
+
```typescript
|
|
62
|
+
import { RecursiveCharacterTransformer, Language } from '@mastra/rag';
|
|
63
|
+
|
|
64
|
+
const transformer = RecursiveCharacterTransformer.fromLanguage(Language.PHP);
|
|
65
|
+
const chunks = transformer.transform(phpCodeDocument);
|
|
66
|
+
// Successfully chunks PHP code at namespace, class, function boundaries
|
|
67
|
+
```
|
|
68
|
+
Fixes the issue where using `Language.PHP` would throw "Language PHP is not supported!" error.
|
|
69
|
+
- Updated dependencies [[`90fc0e5`](https://github.com/mastra-ai/mastra/commit/90fc0e5717cb280c2d4acf4f0410b510bb4c0a72), [`1cf5d2e`](https://github.com/mastra-ai/mastra/commit/1cf5d2ea1b085be23e34fb506c80c80a4e6d9c2b), [`b99ceac`](https://github.com/mastra-ai/mastra/commit/b99ceace2c830dbdef47c8692d56a91954aefea2), [`deea43e`](https://github.com/mastra-ai/mastra/commit/deea43eb1366d03a864c5e597d16a48592b9893f), [`833ae96`](https://github.com/mastra-ai/mastra/commit/833ae96c3e34370e58a1e979571c41f39a720592), [`943772b`](https://github.com/mastra-ai/mastra/commit/943772b4378f625f0f4e19ea2b7c392bd8e71786), [`b5c711b`](https://github.com/mastra-ai/mastra/commit/b5c711b281dd1fb81a399a766bc9f86c55efc13e), [`3efbe5a`](https://github.com/mastra-ai/mastra/commit/3efbe5ae20864c4f3143457f4f3ee7dc2fa5ca76), [`1e49e7a`](https://github.com/mastra-ai/mastra/commit/1e49e7ab5f173582154cb26b29d424de67d09aef), [`751eaab`](https://github.com/mastra-ai/mastra/commit/751eaab4e0d3820a94e4c3d39a2ff2663ded3d91), [`69d8156`](https://github.com/mastra-ai/mastra/commit/69d81568bcf062557c24471ce26812446bec465d), [`60d9d89`](https://github.com/mastra-ai/mastra/commit/60d9d899e44b35bc43f1bcd967a74e0ce010b1af), [`5c544c8`](https://github.com/mastra-ai/mastra/commit/5c544c8d12b08ab40d64d8f37b3c4215bee95b87), [`771ad96`](https://github.com/mastra-ai/mastra/commit/771ad962441996b5c43549391a3e6a02c6ddedc2), [`2b0936b`](https://github.com/mastra-ai/mastra/commit/2b0936b0c9a43eeed9bef63e614d7e02ee803f7e), [`3b04f30`](https://github.com/mastra-ai/mastra/commit/3b04f3010604f3cdfc8a0674731700ad66471cee), [`97e26de`](https://github.com/mastra-ai/mastra/commit/97e26deaebd9836647a67b96423281d66421ca07), [`ac9ec66`](https://github.com/mastra-ai/mastra/commit/ac9ec6672779b2e6d4344e415481d1a6a7d4911a), [`10523f4`](https://github.com/mastra-ai/mastra/commit/10523f4882d9b874b40ce6e3715f66dbcd4947d2), [`cb72d20`](https://github.com/mastra-ai/mastra/commit/cb72d2069d7339bda8a0e76d4f35615debb07b84), [`42856b1`](https://github.com/mastra-ai/mastra/commit/42856b1c8aeea6371c9ee77ae2f5f5fe34400933), [`66f33ff`](https://github.com/mastra-ai/mastra/commit/66f33ff68620018513e499c394411d1d39b3aa5c), [`ab3c190`](https://github.com/mastra-ai/mastra/commit/ab3c1901980a99910ca9b96a7090c22e24060113), [`d4f06c8`](https://github.com/mastra-ai/mastra/commit/d4f06c85ffa5bb0da38fb82ebf3b040cc6b4ec4e), [`0350626`](https://github.com/mastra-ai/mastra/commit/03506267ec41b67add80d994c0c0fcce93bbc75f), [`bc9fa00`](https://github.com/mastra-ai/mastra/commit/bc9fa00859c5c4a796d53a0a5cae46ab4a3072e4), [`f46a478`](https://github.com/mastra-ai/mastra/commit/f46a4782f595949c696569e891f81c8d26338508), [`90fc0e5`](https://github.com/mastra-ai/mastra/commit/90fc0e5717cb280c2d4acf4f0410b510bb4c0a72), [`f05a3a5`](https://github.com/mastra-ai/mastra/commit/f05a3a5cf2b9a9c2d40c09cb8c762a4b6cd5d565), [`a291da9`](https://github.com/mastra-ai/mastra/commit/a291da9363efd92dafd8775dccb4f2d0511ece7a), [`c5d71da`](https://github.com/mastra-ai/mastra/commit/c5d71da1c680ce5640b1a7f8ca0e024a4ab1cfed), [`07042f9`](https://github.com/mastra-ai/mastra/commit/07042f9f89080f38b8f72713ba1c972d5b1905b8), [`0423442`](https://github.com/mastra-ai/mastra/commit/0423442b7be2dfacba95890bea8f4a810db4d603)]:
|
|
70
|
+
- @mastra/core@1.1.0
|
|
71
|
+
|
|
72
|
+
## 2.1.0-alpha.0
|
|
73
|
+
|
|
74
|
+
### Minor Changes
|
|
75
|
+
|
|
76
|
+
- Added support for 20 additional languages in code chunking ([#12154](https://github.com/mastra-ai/mastra/pull/12154))
|
|
77
|
+
|
|
78
|
+
Extended RecursiveCharacterTransformer to support all languages defined in the Language enum. Previously, only 6 languages were supported (CPP, C, TS, MARKDOWN, LATEX, PHP), causing runtime errors for other defined languages.
|
|
79
|
+
|
|
80
|
+
**Newly supported languages:**
|
|
81
|
+
- GO, JAVA, KOTLIN, JS, PYTHON, RUBY, RUST, SCALA, SWIFT (popular programming languages)
|
|
82
|
+
- HTML, SOL (Solidity), CSHARP, COBOL, LUA, PERL, HASKELL, ELIXIR, POWERSHELL (additional languages)
|
|
83
|
+
- PROTO (Protocol Buffers), RST (reStructuredText) (data/documentation formats)
|
|
84
|
+
|
|
85
|
+
Each language has been configured with appropriate separators based on its syntax patterns (modules, classes, functions, control structures) to enable semantic code chunking.
|
|
86
|
+
|
|
87
|
+
**Before:**
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
import { RecursiveCharacterTransformer, Language } from '@mastra/rag';
|
|
91
|
+
|
|
92
|
+
// These would all throw "Language X is not supported!" errors
|
|
93
|
+
const goTransformer = RecursiveCharacterTransformer.fromLanguage(Language.GO);
|
|
94
|
+
const pythonTransformer = RecursiveCharacterTransformer.fromLanguage(Language.PYTHON);
|
|
95
|
+
const rustTransformer = RecursiveCharacterTransformer.fromLanguage(Language.RUST);
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**After:**
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
import { RecursiveCharacterTransformer, Language } from '@mastra/rag';
|
|
102
|
+
|
|
103
|
+
// All languages now work seamlessly
|
|
104
|
+
const goTransformer = RecursiveCharacterTransformer.fromLanguage(Language.GO);
|
|
105
|
+
const goChunks = goTransformer.transform(goCodeDocument);
|
|
106
|
+
|
|
107
|
+
const pythonTransformer = RecursiveCharacterTransformer.fromLanguage(Language.PYTHON);
|
|
108
|
+
const pythonChunks = pythonTransformer.transform(pythonCodeDocument);
|
|
109
|
+
|
|
110
|
+
const rustTransformer = RecursiveCharacterTransformer.fromLanguage(Language.RUST);
|
|
111
|
+
const rustChunks = rustTransformer.transform(rustCodeDocument);
|
|
112
|
+
// All languages in the Language enum are now fully supported
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Patch Changes
|
|
116
|
+
|
|
117
|
+
- Add support for PHP in Language enum
|
|
118
|
+
([#12124](https://github.com/mastra-ai/mastra/pull/12124))
|
|
119
|
+
Previously, the Language enum defined PHP, but it was not supported in the `getSeparatorsForLanguage` method. This caused runtime errors when trying to use PHP for code chunking.
|
|
120
|
+
This change adds proper separator definitions for PHP, ensuring that PHP defined in the Language enum is now fully supported. PHP has been configured with appropriate separators based on its syntax and common programming patterns (classes, functions, control structures, etc.).
|
|
121
|
+
**Before:**
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
import { RecursiveCharacterTransformer, Language } from '@mastra/rag';
|
|
125
|
+
|
|
126
|
+
const transformer = RecursiveCharacterTransformer.fromLanguage(Language.PHP);
|
|
127
|
+
const chunks = transformer.transform(phpCodeDocument);
|
|
128
|
+
// Throws: "Language PHP is not supported!"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**After:**
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
import { RecursiveCharacterTransformer, Language } from '@mastra/rag';
|
|
135
|
+
|
|
136
|
+
const transformer = RecursiveCharacterTransformer.fromLanguage(Language.PHP);
|
|
137
|
+
const chunks = transformer.transform(phpCodeDocument);
|
|
138
|
+
// Successfully chunks PHP code at namespace, class, function boundaries
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Fixes the issue where using `Language.PHP` would throw "Language PHP is not supported!" error.
|
|
142
|
+
|
|
143
|
+
- Updated dependencies [[`90fc0e5`](https://github.com/mastra-ai/mastra/commit/90fc0e5717cb280c2d4acf4f0410b510bb4c0a72), [`1cf5d2e`](https://github.com/mastra-ai/mastra/commit/1cf5d2ea1b085be23e34fb506c80c80a4e6d9c2b), [`833ae96`](https://github.com/mastra-ai/mastra/commit/833ae96c3e34370e58a1e979571c41f39a720592), [`943772b`](https://github.com/mastra-ai/mastra/commit/943772b4378f625f0f4e19ea2b7c392bd8e71786), [`b5c711b`](https://github.com/mastra-ai/mastra/commit/b5c711b281dd1fb81a399a766bc9f86c55efc13e), [`3efbe5a`](https://github.com/mastra-ai/mastra/commit/3efbe5ae20864c4f3143457f4f3ee7dc2fa5ca76), [`1e49e7a`](https://github.com/mastra-ai/mastra/commit/1e49e7ab5f173582154cb26b29d424de67d09aef), [`751eaab`](https://github.com/mastra-ai/mastra/commit/751eaab4e0d3820a94e4c3d39a2ff2663ded3d91), [`69d8156`](https://github.com/mastra-ai/mastra/commit/69d81568bcf062557c24471ce26812446bec465d), [`60d9d89`](https://github.com/mastra-ai/mastra/commit/60d9d899e44b35bc43f1bcd967a74e0ce010b1af), [`5c544c8`](https://github.com/mastra-ai/mastra/commit/5c544c8d12b08ab40d64d8f37b3c4215bee95b87), [`771ad96`](https://github.com/mastra-ai/mastra/commit/771ad962441996b5c43549391a3e6a02c6ddedc2), [`2b0936b`](https://github.com/mastra-ai/mastra/commit/2b0936b0c9a43eeed9bef63e614d7e02ee803f7e), [`3b04f30`](https://github.com/mastra-ai/mastra/commit/3b04f3010604f3cdfc8a0674731700ad66471cee), [`97e26de`](https://github.com/mastra-ai/mastra/commit/97e26deaebd9836647a67b96423281d66421ca07), [`10523f4`](https://github.com/mastra-ai/mastra/commit/10523f4882d9b874b40ce6e3715f66dbcd4947d2), [`cb72d20`](https://github.com/mastra-ai/mastra/commit/cb72d2069d7339bda8a0e76d4f35615debb07b84), [`42856b1`](https://github.com/mastra-ai/mastra/commit/42856b1c8aeea6371c9ee77ae2f5f5fe34400933), [`66f33ff`](https://github.com/mastra-ai/mastra/commit/66f33ff68620018513e499c394411d1d39b3aa5c), [`ab3c190`](https://github.com/mastra-ai/mastra/commit/ab3c1901980a99910ca9b96a7090c22e24060113), [`d4f06c8`](https://github.com/mastra-ai/mastra/commit/d4f06c85ffa5bb0da38fb82ebf3b040cc6b4ec4e), [`0350626`](https://github.com/mastra-ai/mastra/commit/03506267ec41b67add80d994c0c0fcce93bbc75f), [`bc9fa00`](https://github.com/mastra-ai/mastra/commit/bc9fa00859c5c4a796d53a0a5cae46ab4a3072e4), [`f46a478`](https://github.com/mastra-ai/mastra/commit/f46a4782f595949c696569e891f81c8d26338508), [`90fc0e5`](https://github.com/mastra-ai/mastra/commit/90fc0e5717cb280c2d4acf4f0410b510bb4c0a72), [`f05a3a5`](https://github.com/mastra-ai/mastra/commit/f05a3a5cf2b9a9c2d40c09cb8c762a4b6cd5d565), [`a291da9`](https://github.com/mastra-ai/mastra/commit/a291da9363efd92dafd8775dccb4f2d0511ece7a), [`c5d71da`](https://github.com/mastra-ai/mastra/commit/c5d71da1c680ce5640b1a7f8ca0e024a4ab1cfed), [`07042f9`](https://github.com/mastra-ai/mastra/commit/07042f9f89080f38b8f72713ba1c972d5b1905b8), [`0423442`](https://github.com/mastra-ai/mastra/commit/0423442b7be2dfacba95890bea8f4a810db4d603)]:
|
|
144
|
+
- @mastra/core@1.1.0-alpha.0
|
|
145
|
+
|
|
3
146
|
## 2.0.0
|
|
4
147
|
|
|
5
148
|
### Major Changes
|
package/dist/docs/README.md
CHANGED
package/dist/docs/SKILL.md
CHANGED
|
@@ -67,7 +67,7 @@ const chunks = await doc.chunk({
|
|
|
67
67
|
> **Note:**
|
|
68
68
|
Metadata extraction may use LLM calls, so ensure your API key is set.
|
|
69
69
|
|
|
70
|
-
We go deeper into chunking strategies in our [`chunk()` reference documentation](https://mastra.ai/reference/
|
|
70
|
+
We go deeper into chunking strategies in our [`chunk()` reference documentation](https://mastra.ai/reference/rag/chunk).
|
|
71
71
|
|
|
72
72
|
## Step 2: Embedding Generation
|
|
73
73
|
|
|
@@ -87,7 +87,7 @@ const { embeddings } = await embedMany({
|
|
|
87
87
|
});
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
Mastra supports OpenAI and Google embedding models. For a complete list of supported embedding models, see the [embeddings reference](https://mastra.ai/reference/
|
|
90
|
+
Mastra supports OpenAI and Google embedding models. For a complete list of supported embedding models, see the [embeddings reference](https://mastra.ai/reference/rag/embeddings).
|
|
91
91
|
|
|
92
92
|
The model router automatically handles API key detection from environment variables.
|
|
93
93
|
|
|
@@ -180,10 +180,10 @@ await vectorStore.upsert({
|
|
|
180
180
|
|
|
181
181
|
For more examples of different chunking strategies and embedding configurations, see:
|
|
182
182
|
|
|
183
|
-
- [Chunk Reference](https://mastra.ai/reference/
|
|
184
|
-
- [Embeddings Reference](https://mastra.ai/reference/
|
|
183
|
+
- [Chunk Reference](https://mastra.ai/reference/rag/chunk)
|
|
184
|
+
- [Embeddings Reference](https://mastra.ai/reference/rag/embeddings)
|
|
185
185
|
|
|
186
186
|
For more details on vector databases and embeddings, see:
|
|
187
187
|
|
|
188
188
|
- [Vector Databases](./vector-databases)
|
|
189
|
-
- [Embedding API Reference](https://mastra.ai/reference/
|
|
189
|
+
- [Embedding API Reference](https://mastra.ai/reference/rag/embeddings)
|
|
@@ -73,7 +73,7 @@ Filter results based on metadata fields to narrow down the search space. This ap
|
|
|
73
73
|
|
|
74
74
|
This is useful when you have documents from different sources, time periods, or with specific attributes. Mastra provides a unified MongoDB-style query syntax that works across all supported vector stores.
|
|
75
75
|
|
|
76
|
-
For detailed information about available operators and syntax, see the [Metadata Filters Reference](https://mastra.ai/reference/
|
|
76
|
+
For detailed information about available operators and syntax, see the [Metadata Filters Reference](https://mastra.ai/reference/rag/metadata-filters).
|
|
77
77
|
|
|
78
78
|
Basic filtering examples:
|
|
79
79
|
|
|
@@ -264,7 +264,7 @@ await pineconeQueryTool.execute(
|
|
|
264
264
|
);
|
|
265
265
|
```
|
|
266
266
|
|
|
267
|
-
For detailed configuration options and advanced usage, see the [Vector Query Tool Reference](https://mastra.ai/reference/
|
|
267
|
+
For detailed configuration options and advanced usage, see the [Vector Query Tool Reference](https://mastra.ai/reference/tools/vector-query-tool).
|
|
268
268
|
|
|
269
269
|
### Vector Store Prompts
|
|
270
270
|
|
|
@@ -543,6 +543,6 @@ const relevanceProvider = new ZeroEntropyRelevanceScorer("zerank-1");
|
|
|
543
543
|
|
|
544
544
|
The re-ranked results combine vector similarity with semantic understanding to improve retrieval quality.
|
|
545
545
|
|
|
546
|
-
For more details about re-ranking, see the [rerank()](https://mastra.ai/reference/
|
|
546
|
+
For more details about re-ranking, see the [rerank()](https://mastra.ai/reference/rag/rerankWithScorer) method.
|
|
547
547
|
|
|
548
|
-
For graph-based retrieval that follows connections between chunks, see the [GraphRAG](https://mastra.ai/docs/
|
|
548
|
+
For graph-based retrieval that follows connections between chunks, see the [GraphRAG](https://mastra.ai/docs/rag/graph-rag) documentation.
|
|
@@ -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/docs/
|
|
17
|
+
For straightforward semantic search without relationship traversal, use [standard retrieval methods](https://mastra.ai/docs/rag/retrieval).
|
|
18
18
|
|
|
19
19
|
## How GraphRAG works
|
|
20
20
|
|
|
@@ -213,5 +213,5 @@ This gives the agent flexibility to choose the appropriate retrieval method base
|
|
|
213
213
|
|
|
214
214
|
For detailed API documentation, see:
|
|
215
215
|
|
|
216
|
-
- [GraphRAG Class](https://mastra.ai/reference/
|
|
217
|
-
- [createGraphRAGTool()](https://mastra.ai/reference/
|
|
216
|
+
- [GraphRAG Class](https://mastra.ai/reference/rag/graph-rag)
|
|
217
|
+
- [createGraphRAGTool()](https://mastra.ai/reference/tools/graph-rag-tool)
|
|
@@ -141,7 +141,7 @@ const chunksWithMetadata = await doc.chunk({
|
|
|
141
141
|
The following parameters are available for all chunking strategies.
|
|
142
142
|
**Important:** Each strategy will only utilize a subset of these parameters relevant to its specific use case.
|
|
143
143
|
|
|
144
|
-
See [ExtractParams reference](https://mastra.ai/reference/
|
|
144
|
+
See [ExtractParams reference](https://mastra.ai/reference/rag/extract-params) for details on the `extract` parameter.
|
|
145
145
|
|
|
146
146
|
## Strategy-Specific Options
|
|
147
147
|
|
|
@@ -507,9 +507,9 @@ const vectorTool = createVectorQueryTool({
|
|
|
507
507
|
|
|
508
508
|
## Related
|
|
509
509
|
|
|
510
|
-
- [createVectorQueryTool()](https://mastra.ai/reference/
|
|
511
|
-
- [Hybrid Vector Search](https://mastra.ai/docs/
|
|
512
|
-
- [Metadata Filters](https://mastra.ai/reference/
|
|
510
|
+
- [createVectorQueryTool()](https://mastra.ai/reference/tools/vector-query-tool)
|
|
511
|
+
- [Hybrid Vector Search](https://mastra.ai/docs/rag/retrieval#metadata-filtering)
|
|
512
|
+
- [Metadata Filters](https://mastra.ai/reference/rag/metadata-filters)
|
|
513
513
|
|
|
514
514
|
---
|
|
515
515
|
|
|
@@ -212,8 +212,8 @@ const response = await agent.generate(
|
|
|
212
212
|
|
|
213
213
|
For more information on request context, please see:
|
|
214
214
|
|
|
215
|
-
- [Agent Request Context](https://mastra.ai/docs/
|
|
216
|
-
- [Request Context](https://mastra.ai/docs/
|
|
215
|
+
- [Agent Request Context](https://mastra.ai/docs/server/request-context)
|
|
216
|
+
- [Request Context](https://mastra.ai/docs/server/request-context#accessing-values-with-tools)
|
|
217
217
|
|
|
218
218
|
## Dynamic Vector Store for Multi-Tenant Applications
|
|
219
219
|
|
|
@@ -584,8 +584,8 @@ const response = await agent.generate(
|
|
|
584
584
|
|
|
585
585
|
For more information on request context, please see:
|
|
586
586
|
|
|
587
|
-
- [Agent Request Context](https://mastra.ai/docs/
|
|
588
|
-
- [Request Context](https://mastra.ai/docs/
|
|
587
|
+
- [Agent Request Context](https://mastra.ai/docs/server/request-context)
|
|
588
|
+
- [Request Context](https://mastra.ai/docs/server/request-context#accessing-values-with-tools)
|
|
589
589
|
|
|
590
590
|
## Usage Without a Mastra Server
|
|
591
591
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"character.d.ts","sourceRoot":"","sources":["../../../src/document/transformers/character.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAE/F,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AA+CzC,qBAAa,oBAAqB,SAAQ,eAAe;IACvD,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,gBAAgB,EAAE,OAAO,CAAC;gBAExB,EAAE,SAAkB,EAAE,gBAAwB,EAAE,GAAG,WAAW,EAAE,GAAE,qBAA0B;IAMxG,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,EAAE;IAqB/C,OAAO,CAAC,YAAY;CAyBrB;AAED,qBAAa,6BAA8B,SAAQ,eAAe;IAChE,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAC/B,SAAS,CAAC,gBAAgB,EAAE,OAAO,CAAC;gBAExB,EAAE,UAAU,EAAE,gBAAwB,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,GAAE,qBAA0B;IAM1G,OAAO,CAAC,UAAU;IAuDlB,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,EAAE;IAI/C,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,GAAE,gBAAqB,GAAG,6BAA6B;IAUtG,MAAM,CAAC,wBAAwB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"character.d.ts","sourceRoot":"","sources":["../../../src/document/transformers/character.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAE/F,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AA+CzC,qBAAa,oBAAqB,SAAQ,eAAe;IACvD,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,gBAAgB,EAAE,OAAO,CAAC;gBAExB,EAAE,SAAkB,EAAE,gBAAwB,EAAE,GAAG,WAAW,EAAE,GAAE,qBAA0B;IAMxG,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,EAAE;IAqB/C,OAAO,CAAC,YAAY;CAyBrB;AAED,qBAAa,6BAA8B,SAAQ,eAAe;IAChE,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAC/B,SAAS,CAAC,gBAAgB,EAAE,OAAO,CAAC;gBAExB,EAAE,UAAU,EAAE,gBAAwB,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,GAAE,qBAA0B;IAM1G,OAAO,CAAC,UAAU;IAuDlB,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,EAAE;IAI/C,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,GAAE,gBAAqB,GAAG,6BAA6B;IAUtG,MAAM,CAAC,wBAAwB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,EAAE;CAwa9D"}
|