@mastra/memory 0.12.2 → 0.12.3-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.
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "strict": true,
7
+ "esModuleInterop": true,
8
+ "skipLibCheck": true,
9
+ "forceConsistentCasingInFileNames": true
10
+ },
11
+ "include": ["src/**/*", "vitest.config.ts"],
12
+ "exclude": ["node_modules"]
13
+ }
@@ -0,0 +1,18 @@
1
+ import { defineConfig } from 'vitest/config';
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ pool: 'forks',
6
+ globals: true,
7
+ environment: 'node',
8
+ testTimeout: 60000,
9
+ hookTimeout: 30000,
10
+ coverage: {
11
+ provider: 'v8',
12
+ reporter: ['text', 'json', 'html'],
13
+ },
14
+ // smaller output to save token space when LLMs run tests
15
+ reporters: 'dot',
16
+ bail: 1,
17
+ },
18
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/memory",
3
- "version": "0.12.2",
3
+ "version": "0.12.3-alpha.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -34,12 +34,13 @@
34
34
  "dependencies": {
35
35
  "@upstash/redis": "^1.35.3",
36
36
  "ai": "^4.3.16",
37
+ "ai-v5": "npm:ai@5.0.0",
37
38
  "js-tiktoken": "^1.0.20",
38
39
  "json-schema": "^0.4.0",
39
40
  "pg": "^8.16.3",
40
41
  "pg-pool": "^3.10.1",
41
42
  "postgres": "^3.4.7",
42
- "redis": "^5.8.0",
43
+ "redis": "^5.8.1",
43
44
  "async-mutex": "^0.5.0",
44
45
  "xxhash-wasm": "^1.1.0",
45
46
  "zod": "^3.25.67",
@@ -57,8 +58,8 @@
57
58
  "typescript": "^5.8.3",
58
59
  "typescript-eslint": "^8.38.0",
59
60
  "vitest": "^3.2.4",
60
- "@mastra/core": "0.13.2",
61
61
  "@internal/lint": "0.0.29",
62
+ "@mastra/core": "0.14.0-alpha.4",
62
63
  "@internal/types-builder": "0.0.4"
63
64
  },
64
65
  "peerDependencies": {
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@ import type { MemoryConfig, SharedMemoryConfig, StorageThreadType, WorkingMemory
7
7
  import type { StorageGetMessagesArg, ThreadSortOptions, PaginationInfo } from '@mastra/core/storage';
8
8
  import { embedMany } from 'ai';
9
9
  import type { CoreMessage, TextPart } from 'ai';
10
+ import { embedMany as embedManyV5 } from 'ai-v5';
10
11
  import { Mutex } from 'async-mutex';
11
12
  import type { JSONSchema7 } from 'json-schema';
12
13
 
@@ -522,10 +523,11 @@ export class Memory extends MastraMemory {
522
523
  await this.firstEmbed;
523
524
  }
524
525
 
525
- const promise = embedMany({
526
+ const promise = (this.embedder.specificationVersion === `v2` ? embedManyV5 : embedMany)({
526
527
  values: chunks,
527
- model: this.embedder,
528
528
  maxRetries: 3,
529
+ // @ts-ignore
530
+ model: this.embedder,
529
531
  });
530
532
 
531
533
  if (isFastEmbed && !this.firstEmbed) this.firstEmbed = promise;