@mastra/rag 2.6.1-alpha.0 → 2.6.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @mastra/rag
2
2
 
3
- The Retrieval-Augmented Generation (RAG) module contains document processing and embedding utilities.
3
+ `@mastra/rag` provides document chunking, reranking, and graph-based retrieval utilities for retrieval-augmented generation. Use it to prepare source material for embedding and select the most relevant context before an agent generates a response.
4
4
 
5
5
  ## Installation
6
6
 
@@ -8,19 +8,34 @@ The Retrieval-Augmented Generation (RAG) module contains document processing and
8
8
  npm install @mastra/rag
9
9
  ```
10
10
 
11
- ## Components
11
+ ## Usage
12
12
 
13
- ### Document
14
-
15
- The `MDocument` class represents text content with associated metadata:
13
+ Create a document and split it into chunks before embedding or indexing the content.
16
14
 
17
15
  ```typescript
18
16
  import { MDocument } from '@mastra/rag';
19
17
 
20
- const doc = new MDocument({
21
- text: 'Document content',
22
- metadata: { source: 'example.txt' },
18
+ const document = MDocument.fromText(`
19
+ # Product guide
20
+
21
+ Mastra provides agents, workflows, memory, and retrieval tools.
22
+ `);
23
+
24
+ const chunks = await document.chunk({
25
+ strategy: 'recursive',
26
+ maxSize: 512,
27
+ overlap: 50,
23
28
  });
24
29
  ```
25
30
 
26
- [Documentation](https://mastra.ai/reference/rag/document)
31
+ ## Documentation
32
+
33
+ - [@mastra/rag documentation](https://mastra.ai/reference/rag/overview)
34
+
35
+ ## Changelog
36
+
37
+ See the [package changelog](https://github.com/mastra-ai/mastra/blob/main/packages/rag/CHANGELOG.md) for version history and release notes.
38
+
39
+ ## Support
40
+
41
+ We have an [open community Discord](https://discord.gg/mastra-ai). Come and say hello and let us know if you have any questions or need any help getting things running.
@@ -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.1-alpha.0"
6
+ version: "2.6.1"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.6.1-alpha.0",
2
+ "version": "2.6.1",
3
3
  "package": "@mastra/rag",
4
4
  "exports": {},
5
5
  "modules": {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/rag",
3
- "version": "2.6.1-alpha.0",
3
+ "version": "2.6.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -50,10 +50,10 @@
50
50
  "typescript": "^7.0.2",
51
51
  "vitest": "4.1.10",
52
52
  "zod": "^4.4.3",
53
- "@internal/ai-sdk-v4": "0.0.76",
54
- "@internal/lint": "0.0.129",
55
- "@mastra/core": "1.64.0-alpha.2",
56
- "@internal/types-builder": "0.0.104"
53
+ "@internal/ai-sdk-v4": "0.0.77",
54
+ "@internal/lint": "0.0.130",
55
+ "@internal/types-builder": "0.0.105",
56
+ "@mastra/core": "1.64.0"
57
57
  },
58
58
  "keywords": [
59
59
  "rag",