@mastra/rag 0.1.18 → 0.1.19-alpha.2
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 +5 -5
- package/CHANGELOG.md +22 -0
- package/dist/_tsup-dts-rollup.d.cts +22 -23
- package/dist/_tsup-dts-rollup.d.ts +22 -23
- package/package.json +4 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/rag@0.1.
|
|
2
|
+
> @mastra/rag@0.1.19-alpha.2 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.4.0
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 16624ms
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
11
|
[34mCLI[39m Target: es2022
|
|
12
12
|
Analysis will use the bundled TypeScript version 5.8.2
|
|
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.2
|
|
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 15776ms
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
20
|
[32mESM[39m [1mdist/index.js [22m[32m95.46 KB[39m
|
|
21
|
-
[32mESM[39m ⚡️ Build success in
|
|
21
|
+
[32mESM[39m ⚡️ Build success in 1904ms
|
|
22
22
|
[32mCJS[39m [1mdist/index.cjs [22m[32m96.18 KB[39m
|
|
23
|
-
[32mCJS[39m ⚡️ Build success in
|
|
23
|
+
[32mCJS[39m ⚡️ Build success in 1903ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @mastra/rag
|
|
2
2
|
|
|
3
|
+
## 0.1.19-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [9ee4293]
|
|
8
|
+
- @mastra/core@0.8.4-alpha.2
|
|
9
|
+
|
|
10
|
+
## 0.1.19-alpha.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [8a8a73b]
|
|
15
|
+
- Updated dependencies [6f92295]
|
|
16
|
+
- @mastra/core@0.8.4-alpha.1
|
|
17
|
+
|
|
18
|
+
## 0.1.19-alpha.0
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [03f3cd0]
|
|
23
|
+
- @mastra/core@0.8.4-alpha.0
|
|
24
|
+
|
|
3
25
|
## 0.1.18
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createTool } from '@mastra/core/tools';
|
|
2
|
-
import { Document
|
|
2
|
+
import { Document } from 'llamaindex';
|
|
3
3
|
import type { EmbeddingModel } from 'ai';
|
|
4
4
|
import type { KeywordExtractPrompt } from 'llamaindex';
|
|
5
5
|
import type { LLM } from 'llamaindex';
|
|
@@ -205,24 +205,24 @@ export declare class HTMLHeaderTransformer {
|
|
|
205
205
|
constructor(headersToSplitOn: [string, string][], returnEachElement?: boolean);
|
|
206
206
|
splitText({ text }: {
|
|
207
207
|
text: string;
|
|
208
|
-
}):
|
|
208
|
+
}): Document[];
|
|
209
209
|
private getXPath;
|
|
210
210
|
private getTextContent;
|
|
211
211
|
private aggregateElementsToChunks;
|
|
212
|
-
createDocuments(texts: string[], metadatas?: Record<string, any>[]):
|
|
213
|
-
transformDocuments(documents:
|
|
212
|
+
createDocuments(texts: string[], metadatas?: Record<string, any>[]): Document[];
|
|
213
|
+
transformDocuments(documents: Document[]): Document[];
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
export declare class HTMLSectionTransformer {
|
|
217
217
|
private headersToSplitOn;
|
|
218
218
|
private options;
|
|
219
219
|
constructor(headersToSplitOn: [string, string][], options?: Record<string, any>);
|
|
220
|
-
splitText(text: string):
|
|
220
|
+
splitText(text: string): Document[];
|
|
221
221
|
private getXPath;
|
|
222
222
|
private splitHtmlByHeaders;
|
|
223
|
-
splitDocuments(documents:
|
|
224
|
-
createDocuments(texts: string[], metadatas?: Record<string, any>[]):
|
|
225
|
-
transformDocuments(documents:
|
|
223
|
+
splitDocuments(documents: Document[]): Promise<Document[]>;
|
|
224
|
+
createDocuments(texts: string[], metadatas?: Record<string, any>[]): Document[];
|
|
225
|
+
transformDocuments(documents: Document[]): Document[];
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
declare type KeywordExtractArgs = {
|
|
@@ -287,9 +287,9 @@ export declare class MarkdownHeaderTransformer {
|
|
|
287
287
|
private aggregateLinesToChunks;
|
|
288
288
|
splitText({ text }: {
|
|
289
289
|
text: string;
|
|
290
|
-
}):
|
|
291
|
-
createDocuments(texts: string[], metadatas?: Record<string, any>[]):
|
|
292
|
-
transformDocuments(documents:
|
|
290
|
+
}): Document[];
|
|
291
|
+
createDocuments(texts: string[], metadatas?: Record<string, any>[]): Document[];
|
|
292
|
+
transformDocuments(documents: Document[]): Document[];
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
export declare class MarkdownTransformer extends RecursiveCharacterTransformer {
|
|
@@ -327,8 +327,8 @@ declare class MDocument {
|
|
|
327
327
|
chunkLatex(options?: ChunkOptions): Promise<void>;
|
|
328
328
|
chunkToken(options?: ChunkOptions): Promise<void>;
|
|
329
329
|
chunkMarkdown(options?: ChunkOptions): Promise<void>;
|
|
330
|
-
chunk(params?: ChunkParams): Promise<
|
|
331
|
-
getDocs():
|
|
330
|
+
chunk(params?: ChunkParams): Promise<Document[]>;
|
|
331
|
+
getDocs(): Document[];
|
|
332
332
|
getText(): string[];
|
|
333
333
|
getMetadata(): Record<string, any>[];
|
|
334
334
|
}
|
|
@@ -471,12 +471,12 @@ export declare class RecursiveJsonTransformer {
|
|
|
471
471
|
convertLists?: boolean;
|
|
472
472
|
ensureAscii?: boolean;
|
|
473
473
|
metadatas?: Record<string, any>[];
|
|
474
|
-
}):
|
|
474
|
+
}): Document[];
|
|
475
475
|
transformDocuments({ ensureAscii, documents, convertLists, }: {
|
|
476
476
|
ensureAscii?: boolean;
|
|
477
477
|
convertLists?: boolean;
|
|
478
|
-
documents:
|
|
479
|
-
}):
|
|
478
|
+
documents: Document[];
|
|
479
|
+
}): Document[];
|
|
480
480
|
}
|
|
481
481
|
|
|
482
482
|
declare function rerank(results: QueryResult[], query: string, model: MastraLanguageModel, options: RerankerFunctionOptions): Promise<RerankResult[]>;
|
|
@@ -545,7 +545,7 @@ export { SummaryExtractArgs as SummaryExtractArgs_alias_1 }
|
|
|
545
545
|
*/
|
|
546
546
|
declare type SupportedEdgeType = 'semantic';
|
|
547
547
|
|
|
548
|
-
export declare abstract class TextTransformer implements
|
|
548
|
+
export declare abstract class TextTransformer implements Transformer {
|
|
549
549
|
protected size: number;
|
|
550
550
|
protected overlap: number;
|
|
551
551
|
protected lengthFunction: (text: string) => number;
|
|
@@ -557,9 +557,9 @@ export declare abstract class TextTransformer implements Transformer_2 {
|
|
|
557
557
|
abstract splitText({ text }: {
|
|
558
558
|
text: string;
|
|
559
559
|
}): string[];
|
|
560
|
-
createDocuments(texts: string[], metadatas?: Record<string, any>[]):
|
|
561
|
-
splitDocuments(documents:
|
|
562
|
-
transformDocuments(documents:
|
|
560
|
+
createDocuments(texts: string[], metadatas?: Record<string, any>[]): Document[];
|
|
561
|
+
splitDocuments(documents: Document[]): Document[];
|
|
562
|
+
transformDocuments(documents: Document[]): Document[];
|
|
563
563
|
protected joinDocs(docs: string[], separator: string): string | null;
|
|
564
564
|
protected mergeSplits(splits: string[], separator: string): string[];
|
|
565
565
|
}
|
|
@@ -618,10 +618,9 @@ export { topKDescription }
|
|
|
618
618
|
export { topKDescription as topKDescription_alias_1 }
|
|
619
619
|
export { topKDescription as topKDescription_alias_2 }
|
|
620
620
|
|
|
621
|
-
declare interface
|
|
622
|
-
transformDocuments(documents:
|
|
621
|
+
export declare interface Transformer {
|
|
622
|
+
transformDocuments(documents: Document[]): Document[];
|
|
623
623
|
}
|
|
624
|
-
export { Transformer_2 as Transformer }
|
|
625
624
|
|
|
626
625
|
declare const UPSTASH_PROMPT = "When querying Upstash Vector, you can ONLY use the operators listed below. Any other operators will be rejected.\nImportant: Don't explain how to construct the filter - use the specified operators and fields to search the content and return relevant results.\nIf a user tries to give an explicit operator that is not supported, reject the filter entirely and let them know that the operator is not supported.\n\nBasic Comparison Operators:\n- $eq: Exact match (default when using field: value)\n Example: { \"category\": \"electronics\" } or { \"category\": { \"$eq\": \"electronics\" } }\n- $ne: Not equal\n Example: { \"category\": { \"$ne\": \"electronics\" } }\n- $gt: Greater than\n Example: { \"price\": { \"$gt\": 100 } }\n- $gte: Greater than or equal\n Example: { \"price\": { \"$gte\": 100 } }\n- $lt: Less than\n Example: { \"price\": { \"$lt\": 100 } }\n- $lte: Less than or equal\n Example: { \"price\": { \"$lte\": 100 } }\n\nArray Operators:\n- $in: Match any value in array\n Example: { \"category\": { \"$in\": [\"electronics\", \"books\"] } }\n- $nin: Does not match any value in array\n Example: { \"category\": { \"$nin\": [\"electronics\", \"books\"] } }\n- $all: Matches all values in array\n Example: { \"tags\": { \"$all\": [\"premium\", \"new\"] } }\n\nLogical Operators:\n- $and: Logical AND (implicit when using multiple conditions)\n Example: { \"$and\": [{ \"price\": { \"$gt\": 100 } }, { \"category\": \"electronics\" }] }\n- $or: Logical OR\n Example: { \"$or\": [{ \"price\": { \"$lt\": 50 } }, { \"category\": \"books\" }] }\n- $not: Logical NOT\n Example: { \"$not\": { \"category\": \"electronics\" } }\n- $nor: Logical NOR\n Example: { \"$nor\": [{ \"price\": { \"$lt\": 50 } }, { \"category\": \"books\" }] }\n\nElement Operators:\n- $exists: Check if field exists\n Example: { \"rating\": { \"$exists\": true } }\n\nSpecial Operators:\n- $regex: Pattern matching using glob syntax (only as operator, not direct RegExp)\n Example: { \"name\": { \"$regex\": \"iphone*\" } }\n- $contains: Check if array/string contains value\n Example: { \"tags\": { \"$contains\": \"premium\" } }\n\nRestrictions:\n- Null/undefined values are not supported in any operator\n- Empty arrays are only supported in $in/$nin operators\n- Direct RegExp patterns are not supported, use $regex with glob syntax\n- Nested fields are supported using dot notation\n- Multiple conditions on same field are combined with AND\n- String values with quotes are automatically escaped\n- Only logical operators ($and, $or, $not, $nor) can be used at the top level\n- All other operators must be used within a field condition\n Valid: { \"field\": { \"$gt\": 100 } }\n Valid: { \"$and\": [...] }\n Invalid: { \"$gt\": 100 }\n- $regex uses glob syntax (*, ?) not standard regex patterns\n- $contains works on both arrays and string fields\n- Logical operators must contain field conditions, not direct operators\n Valid: { \"$and\": [{ \"field\": { \"$gt\": 100 } }] }\n Invalid: { \"$and\": [{ \"$gt\": 100 }] }\n- $not operator:\n - Must be an object\n - Cannot be empty\n - Can be used at field level or top level\n - Valid: { \"$not\": { \"field\": \"value\" } }\n - Valid: { \"field\": { \"$not\": { \"$eq\": \"value\" } } }\n- Other logical operators ($and, $or, $nor):\n - Can only be used at top level or nested within other logical operators\n - Can not be used on a field level, or be nested inside a field\n - Can not be used inside an operator\n - Valid: { \"$and\": [{ \"field\": { \"$gt\": 100 } }] }\n - Valid: { \"$or\": [{ \"$and\": [{ \"field\": { \"$gt\": 100 } }] }] }\n - Invalid: { \"field\": { \"$and\": [{ \"$gt\": 100 }] } }\n - Invalid: { \"field\": { \"$or\": [{ \"$gt\": 100 }] } }\n - Invalid: { \"field\": { \"$gt\": { \"$and\": [{...}] } } }\nExample Complex Query:\n{\n \"$and\": [\n { \"category\": { \"$in\": [\"electronics\", \"computers\"] } },\n { \"price\": { \"$gt\": 100, \"$lt\": 1000 } },\n { \"tags\": { \"$all\": [\"premium\", \"new\"] } },\n { \"name\": { \"$regex\": \"iphone*\" } },\n { \"description\": { \"$contains\": \"latest\" } },\n { \"$or\": [\n { \"brand\": \"Apple\" },\n { \"rating\": { \"$gte\": 4.5 } }\n ]}\n ]\n}";
|
|
627
626
|
export { UPSTASH_PROMPT }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createTool } from '@mastra/core/tools';
|
|
2
|
-
import { Document
|
|
2
|
+
import { Document } from 'llamaindex';
|
|
3
3
|
import type { EmbeddingModel } from 'ai';
|
|
4
4
|
import type { KeywordExtractPrompt } from 'llamaindex';
|
|
5
5
|
import type { LLM } from 'llamaindex';
|
|
@@ -205,24 +205,24 @@ export declare class HTMLHeaderTransformer {
|
|
|
205
205
|
constructor(headersToSplitOn: [string, string][], returnEachElement?: boolean);
|
|
206
206
|
splitText({ text }: {
|
|
207
207
|
text: string;
|
|
208
|
-
}):
|
|
208
|
+
}): Document[];
|
|
209
209
|
private getXPath;
|
|
210
210
|
private getTextContent;
|
|
211
211
|
private aggregateElementsToChunks;
|
|
212
|
-
createDocuments(texts: string[], metadatas?: Record<string, any>[]):
|
|
213
|
-
transformDocuments(documents:
|
|
212
|
+
createDocuments(texts: string[], metadatas?: Record<string, any>[]): Document[];
|
|
213
|
+
transformDocuments(documents: Document[]): Document[];
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
export declare class HTMLSectionTransformer {
|
|
217
217
|
private headersToSplitOn;
|
|
218
218
|
private options;
|
|
219
219
|
constructor(headersToSplitOn: [string, string][], options?: Record<string, any>);
|
|
220
|
-
splitText(text: string):
|
|
220
|
+
splitText(text: string): Document[];
|
|
221
221
|
private getXPath;
|
|
222
222
|
private splitHtmlByHeaders;
|
|
223
|
-
splitDocuments(documents:
|
|
224
|
-
createDocuments(texts: string[], metadatas?: Record<string, any>[]):
|
|
225
|
-
transformDocuments(documents:
|
|
223
|
+
splitDocuments(documents: Document[]): Promise<Document[]>;
|
|
224
|
+
createDocuments(texts: string[], metadatas?: Record<string, any>[]): Document[];
|
|
225
|
+
transformDocuments(documents: Document[]): Document[];
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
declare type KeywordExtractArgs = {
|
|
@@ -287,9 +287,9 @@ export declare class MarkdownHeaderTransformer {
|
|
|
287
287
|
private aggregateLinesToChunks;
|
|
288
288
|
splitText({ text }: {
|
|
289
289
|
text: string;
|
|
290
|
-
}):
|
|
291
|
-
createDocuments(texts: string[], metadatas?: Record<string, any>[]):
|
|
292
|
-
transformDocuments(documents:
|
|
290
|
+
}): Document[];
|
|
291
|
+
createDocuments(texts: string[], metadatas?: Record<string, any>[]): Document[];
|
|
292
|
+
transformDocuments(documents: Document[]): Document[];
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
export declare class MarkdownTransformer extends RecursiveCharacterTransformer {
|
|
@@ -327,8 +327,8 @@ declare class MDocument {
|
|
|
327
327
|
chunkLatex(options?: ChunkOptions): Promise<void>;
|
|
328
328
|
chunkToken(options?: ChunkOptions): Promise<void>;
|
|
329
329
|
chunkMarkdown(options?: ChunkOptions): Promise<void>;
|
|
330
|
-
chunk(params?: ChunkParams): Promise<
|
|
331
|
-
getDocs():
|
|
330
|
+
chunk(params?: ChunkParams): Promise<Document[]>;
|
|
331
|
+
getDocs(): Document[];
|
|
332
332
|
getText(): string[];
|
|
333
333
|
getMetadata(): Record<string, any>[];
|
|
334
334
|
}
|
|
@@ -471,12 +471,12 @@ export declare class RecursiveJsonTransformer {
|
|
|
471
471
|
convertLists?: boolean;
|
|
472
472
|
ensureAscii?: boolean;
|
|
473
473
|
metadatas?: Record<string, any>[];
|
|
474
|
-
}):
|
|
474
|
+
}): Document[];
|
|
475
475
|
transformDocuments({ ensureAscii, documents, convertLists, }: {
|
|
476
476
|
ensureAscii?: boolean;
|
|
477
477
|
convertLists?: boolean;
|
|
478
|
-
documents:
|
|
479
|
-
}):
|
|
478
|
+
documents: Document[];
|
|
479
|
+
}): Document[];
|
|
480
480
|
}
|
|
481
481
|
|
|
482
482
|
declare function rerank(results: QueryResult[], query: string, model: MastraLanguageModel, options: RerankerFunctionOptions): Promise<RerankResult[]>;
|
|
@@ -545,7 +545,7 @@ export { SummaryExtractArgs as SummaryExtractArgs_alias_1 }
|
|
|
545
545
|
*/
|
|
546
546
|
declare type SupportedEdgeType = 'semantic';
|
|
547
547
|
|
|
548
|
-
export declare abstract class TextTransformer implements
|
|
548
|
+
export declare abstract class TextTransformer implements Transformer {
|
|
549
549
|
protected size: number;
|
|
550
550
|
protected overlap: number;
|
|
551
551
|
protected lengthFunction: (text: string) => number;
|
|
@@ -557,9 +557,9 @@ export declare abstract class TextTransformer implements Transformer_2 {
|
|
|
557
557
|
abstract splitText({ text }: {
|
|
558
558
|
text: string;
|
|
559
559
|
}): string[];
|
|
560
|
-
createDocuments(texts: string[], metadatas?: Record<string, any>[]):
|
|
561
|
-
splitDocuments(documents:
|
|
562
|
-
transformDocuments(documents:
|
|
560
|
+
createDocuments(texts: string[], metadatas?: Record<string, any>[]): Document[];
|
|
561
|
+
splitDocuments(documents: Document[]): Document[];
|
|
562
|
+
transformDocuments(documents: Document[]): Document[];
|
|
563
563
|
protected joinDocs(docs: string[], separator: string): string | null;
|
|
564
564
|
protected mergeSplits(splits: string[], separator: string): string[];
|
|
565
565
|
}
|
|
@@ -618,10 +618,9 @@ export { topKDescription }
|
|
|
618
618
|
export { topKDescription as topKDescription_alias_1 }
|
|
619
619
|
export { topKDescription as topKDescription_alias_2 }
|
|
620
620
|
|
|
621
|
-
declare interface
|
|
622
|
-
transformDocuments(documents:
|
|
621
|
+
export declare interface Transformer {
|
|
622
|
+
transformDocuments(documents: Document[]): Document[];
|
|
623
623
|
}
|
|
624
|
-
export { Transformer_2 as Transformer }
|
|
625
624
|
|
|
626
625
|
declare const UPSTASH_PROMPT = "When querying Upstash Vector, you can ONLY use the operators listed below. Any other operators will be rejected.\nImportant: Don't explain how to construct the filter - use the specified operators and fields to search the content and return relevant results.\nIf a user tries to give an explicit operator that is not supported, reject the filter entirely and let them know that the operator is not supported.\n\nBasic Comparison Operators:\n- $eq: Exact match (default when using field: value)\n Example: { \"category\": \"electronics\" } or { \"category\": { \"$eq\": \"electronics\" } }\n- $ne: Not equal\n Example: { \"category\": { \"$ne\": \"electronics\" } }\n- $gt: Greater than\n Example: { \"price\": { \"$gt\": 100 } }\n- $gte: Greater than or equal\n Example: { \"price\": { \"$gte\": 100 } }\n- $lt: Less than\n Example: { \"price\": { \"$lt\": 100 } }\n- $lte: Less than or equal\n Example: { \"price\": { \"$lte\": 100 } }\n\nArray Operators:\n- $in: Match any value in array\n Example: { \"category\": { \"$in\": [\"electronics\", \"books\"] } }\n- $nin: Does not match any value in array\n Example: { \"category\": { \"$nin\": [\"electronics\", \"books\"] } }\n- $all: Matches all values in array\n Example: { \"tags\": { \"$all\": [\"premium\", \"new\"] } }\n\nLogical Operators:\n- $and: Logical AND (implicit when using multiple conditions)\n Example: { \"$and\": [{ \"price\": { \"$gt\": 100 } }, { \"category\": \"electronics\" }] }\n- $or: Logical OR\n Example: { \"$or\": [{ \"price\": { \"$lt\": 50 } }, { \"category\": \"books\" }] }\n- $not: Logical NOT\n Example: { \"$not\": { \"category\": \"electronics\" } }\n- $nor: Logical NOR\n Example: { \"$nor\": [{ \"price\": { \"$lt\": 50 } }, { \"category\": \"books\" }] }\n\nElement Operators:\n- $exists: Check if field exists\n Example: { \"rating\": { \"$exists\": true } }\n\nSpecial Operators:\n- $regex: Pattern matching using glob syntax (only as operator, not direct RegExp)\n Example: { \"name\": { \"$regex\": \"iphone*\" } }\n- $contains: Check if array/string contains value\n Example: { \"tags\": { \"$contains\": \"premium\" } }\n\nRestrictions:\n- Null/undefined values are not supported in any operator\n- Empty arrays are only supported in $in/$nin operators\n- Direct RegExp patterns are not supported, use $regex with glob syntax\n- Nested fields are supported using dot notation\n- Multiple conditions on same field are combined with AND\n- String values with quotes are automatically escaped\n- Only logical operators ($and, $or, $not, $nor) can be used at the top level\n- All other operators must be used within a field condition\n Valid: { \"field\": { \"$gt\": 100 } }\n Valid: { \"$and\": [...] }\n Invalid: { \"$gt\": 100 }\n- $regex uses glob syntax (*, ?) not standard regex patterns\n- $contains works on both arrays and string fields\n- Logical operators must contain field conditions, not direct operators\n Valid: { \"$and\": [{ \"field\": { \"$gt\": 100 } }] }\n Invalid: { \"$and\": [{ \"$gt\": 100 }] }\n- $not operator:\n - Must be an object\n - Cannot be empty\n - Can be used at field level or top level\n - Valid: { \"$not\": { \"field\": \"value\" } }\n - Valid: { \"field\": { \"$not\": { \"$eq\": \"value\" } } }\n- Other logical operators ($and, $or, $nor):\n - Can only be used at top level or nested within other logical operators\n - Can not be used on a field level, or be nested inside a field\n - Can not be used inside an operator\n - Valid: { \"$and\": [{ \"field\": { \"$gt\": 100 } }] }\n - Valid: { \"$or\": [{ \"$and\": [{ \"field\": { \"$gt\": 100 } }] }] }\n - Invalid: { \"field\": { \"$and\": [{ \"$gt\": 100 }] } }\n - Invalid: { \"field\": { \"$or\": [{ \"$gt\": 100 }] } }\n - Invalid: { \"field\": { \"$gt\": { \"$and\": [{...}] } } }\nExample Complex Query:\n{\n \"$and\": [\n { \"category\": { \"$in\": [\"electronics\", \"computers\"] } },\n { \"price\": { \"$gt\": 100, \"$lt\": 1000 } },\n { \"tags\": { \"$all\": [\"premium\", \"new\"] } },\n { \"name\": { \"$regex\": \"iphone*\" } },\n { \"description\": { \"$contains\": \"latest\" } },\n { \"$or\": [\n { \"brand\": \"Apple\" },\n { \"rating\": { \"$gte\": 4.5 } }\n ]}\n ]\n}";
|
|
627
626
|
export { UPSTASH_PROMPT }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/rag",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19-alpha.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
"author": "",
|
|
22
22
|
"license": "Elastic-2.0",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@llamaindex/core": "^0.
|
|
24
|
+
"@llamaindex/core": "^0.6.2",
|
|
25
25
|
"@llamaindex/env": "^0.1.29",
|
|
26
26
|
"@paralleldrive/cuid2": "^2.2.2",
|
|
27
27
|
"js-tiktoken": "^1.0.19",
|
|
28
|
-
"llamaindex": "^0.
|
|
28
|
+
"llamaindex": "^0.9.17",
|
|
29
29
|
"node-html-better-parser": "^1.4.7",
|
|
30
30
|
"pathe": "^2.0.3",
|
|
31
31
|
"zod": "^3.24.2",
|
|
32
|
-
"@mastra/core": "^0.8.
|
|
32
|
+
"@mastra/core": "^0.8.4-alpha.2"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"ai": "^4.0.0"
|