@mastra/memory 0.13.2-alpha.0 → 0.14.0-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.
@@ -10,9 +10,9 @@ case `uname` in
10
10
  esac
11
11
 
12
12
  if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/home/runner/work/mastra/mastra/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.9_@vitest+ui@3.2.3_jiti@2.4.2_jsdom@_01cfaf0d6bf085f2477a8f2d60758c73/node_modules/vitest/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.9_@vitest+ui@3.2.3_jiti@2.4.2_jsdom@_01cfaf0d6bf085f2477a8f2d60758c73/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/node_modules"
13
+ export NODE_PATH="/home/runner/work/mastra/mastra/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.9_@vitest+ui@3.2.3_jiti@2.4.2_jsdom@_1fa9bcbc4e1992fa15d4041825cc914c/node_modules/vitest/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.9_@vitest+ui@3.2.3_jiti@2.4.2_jsdom@_1fa9bcbc4e1992fa15d4041825cc914c/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/node_modules"
14
14
  else
15
- export NODE_PATH="/home/runner/work/mastra/mastra/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.9_@vitest+ui@3.2.3_jiti@2.4.2_jsdom@_01cfaf0d6bf085f2477a8f2d60758c73/node_modules/vitest/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.9_@vitest+ui@3.2.3_jiti@2.4.2_jsdom@_01cfaf0d6bf085f2477a8f2d60758c73/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/node_modules:$NODE_PATH"
15
+ export NODE_PATH="/home/runner/work/mastra/mastra/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.9_@vitest+ui@3.2.3_jiti@2.4.2_jsdom@_1fa9bcbc4e1992fa15d4041825cc914c/node_modules/vitest/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.9_@vitest+ui@3.2.3_jiti@2.4.2_jsdom@_1fa9bcbc4e1992fa15d4041825cc914c/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/node_modules:$NODE_PATH"
16
16
  fi
17
17
  if [ -x "$basedir/node" ]; then
18
18
  exec "$basedir/node" "$basedir/../vitest/vitest.mjs" "$@"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mastra/memory-integration-tests-v5",
3
3
  "private": true,
4
- "version": "0.1.3-alpha.0",
4
+ "version": "0.1.3-alpha.2",
5
5
  "scripts": {
6
6
  "test": "pnpm test:streaming && pnpm test:working-memory && pnpm test:agent-memory && pnpm test:processors",
7
7
  "test:agent-memory": "vitest run ./src/agent-memory.test.ts",
@@ -2,9 +2,9 @@ import { randomUUID } from 'node:crypto';
2
2
  import { google } from '@ai-sdk/google';
3
3
  import { openai } from '@ai-sdk/openai';
4
4
  import { Mastra } from '@mastra/core';
5
- import type { CoreMessage } from '@mastra/core';
6
5
  import { Agent } from '@mastra/core/agent';
7
6
  import type { UIMessageWithMetadata } from '@mastra/core/agent';
7
+ import type { CoreMessage } from '@mastra/core/llm';
8
8
  import { RuntimeContext } from '@mastra/core/runtime-context';
9
9
  import { MockStore } from '@mastra/core/storage';
10
10
  import { fastembed } from '@mastra/fastembed';
@@ -1,6 +1,6 @@
1
1
  import { openai } from '@ai-sdk/openai';
2
- import { createTool } from '@mastra/core';
3
2
  import { Agent } from '@mastra/core/agent';
3
+ import { createTool } from '@mastra/core/tools';
4
4
  import { LibSQLStore, LibSQLVector } from '@mastra/libsql';
5
5
  import { Memory } from '@mastra/memory';
6
6
  import { ToolCallFilter } from '@mastra/memory/processors';
@@ -3,10 +3,11 @@ import { afterEach } from 'node:test';
3
3
  import { tmpdir } from 'os';
4
4
  import { join } from 'path';
5
5
  import { openai } from '@ai-sdk/openai';
6
- import type { CoreMessage, MemoryProcessorOpts } from '@mastra/core';
7
- import { MemoryProcessor } from '@mastra/core';
8
6
  import type { MastraMessageV2 } from '@mastra/core/agent';
9
7
  import { Agent, MessageList } from '@mastra/core/agent';
8
+ import type { CoreMessage } from '@mastra/core/llm';
9
+ import type { MemoryProcessorOpts } from '@mastra/core/memory';
10
+ import { MemoryProcessor } from '@mastra/core/memory';
10
11
  import { createTool } from '@mastra/core/tools';
11
12
  import { fastembed } from '@mastra/fastembed';
12
13
  import { LibSQLVector, LibSQLStore } from '@mastra/libsql';
@@ -1,6 +1,7 @@
1
- import type { CoreMessage, MastraMessageV1 } from '@mastra/core';
2
1
  import { MessageList } from '@mastra/core/agent';
3
2
  import type { MastraMessageV2 } from '@mastra/core/agent';
3
+ import type { CoreMessage } from '@mastra/core/llm';
4
+ import type { MastraMessageV1 } from '@mastra/core/memory';
4
5
 
5
6
  const toolArgs = {
6
7
  weather: { location: 'New York' },
@@ -3,8 +3,8 @@ import { mkdtemp } from 'node:fs/promises';
3
3
  import { tmpdir } from 'node:os';
4
4
  import { join } from 'node:path';
5
5
  import { openai } from '@ai-sdk/openai';
6
- import type { MastraMessageV1 } from '@mastra/core';
7
6
  import { Agent } from '@mastra/core/agent';
7
+ import type { MastraMessageV1 } from '@mastra/core/memory';
8
8
  import { fastembed } from '@mastra/fastembed';
9
9
  import { LibSQLVector, LibSQLStore } from '@mastra/libsql';
10
10
  import { Memory } from '@mastra/memory';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/memory",
3
- "version": "0.13.2-alpha.0",
3
+ "version": "0.14.0-alpha.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -43,9 +43,8 @@
43
43
  "redis": "^5.8.2",
44
44
  "async-mutex": "^0.5.0",
45
45
  "xxhash-wasm": "^1.1.0",
46
- "zod": "^3.25.67",
47
46
  "zod-to-json-schema": "^3.24.5",
48
- "@mastra/schema-compat": "0.10.7"
47
+ "@mastra/schema-compat": "0.10.6-alpha.1"
49
48
  },
50
49
  "devDependencies": {
51
50
  "@ai-sdk/openai": "^1.3.24",
@@ -58,12 +57,13 @@
58
57
  "typescript": "^5.8.3",
59
58
  "typescript-eslint": "^8.38.0",
60
59
  "vitest": "^3.2.4",
61
- "@internal/types-builder": "0.0.6",
62
60
  "@internal/lint": "0.0.31",
63
- "@mastra/core": "0.14.2-alpha.0"
61
+ "@internal/types-builder": "0.0.6",
62
+ "@mastra/core": "0.15.0-alpha.3"
64
63
  },
65
64
  "peerDependencies": {
66
- "@mastra/core": ">=0.14.0-0 <0.15.0-0"
65
+ "@mastra/core": ">=0.14.2-0 <0.15.0-0",
66
+ "zod": "^3.0.0 || ^4.0.0"
67
67
  },
68
68
  "scripts": {
69
69
  "check": "tsc --noEmit",
package/src/index.ts CHANGED
@@ -1,10 +1,16 @@
1
- import { generateEmptyFromSchema } from '@mastra/core';
2
- import type { MastraMessageV1, ToolAction } from '@mastra/core';
3
1
  import { MessageList } from '@mastra/core/agent';
4
2
  import type { MastraMessageV2, UIMessageWithMetadata } from '@mastra/core/agent';
5
3
  import { MastraMemory } from '@mastra/core/memory';
6
- import type { MemoryConfig, SharedMemoryConfig, StorageThreadType, WorkingMemoryTemplate } from '@mastra/core/memory';
4
+ import type {
5
+ MastraMessageV1,
6
+ MemoryConfig,
7
+ SharedMemoryConfig,
8
+ StorageThreadType,
9
+ WorkingMemoryTemplate,
10
+ } from '@mastra/core/memory';
7
11
  import type { StorageGetMessagesArg, ThreadSortOptions, PaginationInfo } from '@mastra/core/storage';
12
+ import type { ToolAction } from '@mastra/core/tools';
13
+ import { generateEmptyFromSchema } from '@mastra/core/utils';
8
14
  import { embedMany } from 'ai';
9
15
  import type { CoreMessage, TextPart } from 'ai';
10
16
  import { embedMany as embedManyV5 } from 'ai-v5';
@@ -1,7 +1,7 @@
1
1
  import { openai } from '@ai-sdk/openai';
2
- import { createTool } from '@mastra/core';
3
- import type { MastraMessageV1 } from '@mastra/core';
4
2
  import { Agent } from '@mastra/core/agent';
3
+ import type { MastraMessageV1 } from '@mastra/core/memory';
4
+ import { createTool } from '@mastra/core/tools';
5
5
  import type { CoreMessage } from 'ai';
6
6
  import cl100k_base from 'js-tiktoken/ranks/cl100k_base';
7
7
  import { describe, it, expect, vi } from 'vitest';
@@ -1,5 +1,7 @@
1
- import type { CoreMessage, MemoryProcessorOpts } from '@mastra/core';
1
+ import type { CoreMessage } from '@mastra/core/llm';
2
2
  import { MemoryProcessor } from '@mastra/core/memory';
3
+ import type { MemoryProcessorOpts } from '@mastra/core/memory';
4
+
3
5
  import { Tiktoken } from 'js-tiktoken/lite';
4
6
  import type { TiktokenBPE } from 'js-tiktoken/lite';
5
7
  import o200k_base from 'js-tiktoken/ranks/o200k_base';
@@ -1,5 +1,5 @@
1
- import type { CoreMessage } from '@mastra/core';
2
- import { MemoryProcessor } from '@mastra/core';
1
+ import type { CoreMessage } from '@mastra/core/llm';
2
+ import { MemoryProcessor } from '@mastra/core/memory';
3
3
 
4
4
  /**
5
5
  * Filters out tool calls and results from messages.
@@ -1,14 +1,14 @@
1
- import type { MemoryConfig } from '@mastra/core';
2
- import { createTool } from '@mastra/core';
1
+ import type { MemoryConfig } from '@mastra/core/memory';
2
+ import { createTool } from '@mastra/core/tools';
3
3
  import { convertSchemaToZod } from '@mastra/schema-compat';
4
4
  import type { Schema } from 'ai';
5
5
  import { z, ZodObject } from 'zod';
6
- import type { ZodTypeAny } from 'zod';
6
+ import type { ZodType } from 'zod';
7
7
 
8
8
  export const updateWorkingMemoryTool = (memoryConfig?: MemoryConfig) => {
9
9
  const schema = memoryConfig?.workingMemory?.schema;
10
10
 
11
- let inputSchema: ZodTypeAny = z.object({
11
+ let inputSchema: ZodType = z.object({
12
12
  memory: z
13
13
  .string()
14
14
  .describe(`The Markdown formatted working memory content to store. This MUST be a string. Never pass an object.`),
@@ -19,9 +19,9 @@ export const updateWorkingMemoryTool = (memoryConfig?: MemoryConfig) => {
19
19
  memory:
20
20
  schema instanceof ZodObject
21
21
  ? schema
22
- : convertSchemaToZod({ jsonSchema: schema } as Schema).describe(
22
+ : (convertSchemaToZod({ jsonSchema: schema } as Schema).describe(
23
23
  `The JSON formatted working memory content to store.`,
24
- ),
24
+ ) as ZodObject<any>),
25
25
  });
26
26
  }
27
27