@mastra/memory 1.0.0 → 1.0.1-alpha.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/CHANGELOG.md +31 -0
- package/dist/{chunk-SG3GRV3O.cjs → chunk-23EXJLET.cjs} +3 -3
- package/dist/chunk-23EXJLET.cjs.map +1 -0
- package/dist/{chunk-KMQS2YEC.js → chunk-BSDWQEU3.js} +3 -3
- package/dist/chunk-BSDWQEU3.js.map +1 -0
- package/dist/{chunk-WC4XBMZT.js → chunk-HJYHDIOC.js} +5 -5
- package/dist/chunk-HJYHDIOC.js.map +1 -0
- package/dist/{chunk-YMNW6DEN.cjs → chunk-LIBOSOHM.cjs} +14 -14
- package/dist/chunk-LIBOSOHM.cjs.map +1 -0
- package/dist/{chunk-ZUQPUTTO.cjs → chunk-O3CS4UGX.cjs} +3 -3
- package/dist/chunk-O3CS4UGX.cjs.map +1 -0
- package/dist/{chunk-QY6BZOPJ.js → chunk-WM6IIUQW.js} +5 -5
- package/dist/chunk-WM6IIUQW.js.map +1 -0
- package/dist/{chunk-MMUHFOCG.js → chunk-YF4R74L2.js} +3 -3
- package/dist/chunk-YF4R74L2.js.map +1 -0
- package/dist/{chunk-W72AYUIF.cjs → chunk-ZSBBXHNM.cjs} +14 -14
- package/dist/chunk-ZSBBXHNM.cjs.map +1 -0
- package/dist/docs/README.md +2 -2
- package/dist/docs/SKILL.md +2 -2
- package/dist/docs/SOURCE_MAP.json +1 -1
- package/dist/docs/agents/01-agent-memory.md +8 -8
- package/dist/docs/agents/02-networks.md +1 -1
- package/dist/docs/agents/03-agent-approval.md +2 -2
- package/dist/docs/agents/04-network-approval.md +2 -2
- package/dist/docs/core/01-reference.md +6 -6
- package/dist/docs/memory/01-overview.md +22 -53
- package/dist/docs/memory/02-storage.md +115 -87
- package/dist/docs/memory/03-message-history.md +249 -0
- package/dist/docs/memory/{03-working-memory.md → 04-working-memory.md} +22 -1
- package/dist/docs/memory/{04-semantic-recall.md → 05-semantic-recall.md} +45 -22
- package/dist/docs/memory/{05-memory-processors.md → 06-memory-processors.md} +4 -4
- package/dist/docs/memory/{06-reference.md → 07-reference.md} +33 -33
- package/dist/docs/processors/01-reference.md +1 -1
- package/dist/docs/storage/01-reference.md +114 -35
- package/dist/docs/vectors/01-reference.md +12 -12
- package/dist/index.cjs +56 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +44 -16
- package/dist/index.js.map +1 -1
- package/dist/{token-6GSAFR2W-JV3TZR4M.cjs → token-6GSAFR2W-2B4WM6AQ.cjs} +8 -8
- package/dist/token-6GSAFR2W-2B4WM6AQ.cjs.map +1 -0
- package/dist/{token-6GSAFR2W-VLY2XUPA.js → token-6GSAFR2W-ABXTQD64.js} +5 -5
- package/dist/token-6GSAFR2W-ABXTQD64.js.map +1 -0
- package/dist/{token-6GSAFR2W-YCB5SK2Z.cjs → token-6GSAFR2W-TW2P7HCS.cjs} +8 -8
- package/dist/token-6GSAFR2W-TW2P7HCS.cjs.map +1 -0
- package/dist/{token-6GSAFR2W-K2BTU23I.js → token-6GSAFR2W-WGTMOPEU.js} +5 -5
- package/dist/token-6GSAFR2W-WGTMOPEU.js.map +1 -0
- package/dist/token-util-NEHG7TUY-GYFEVMWP.cjs +10 -0
- package/dist/{token-util-NEHG7TUY-7IL6JUVY.cjs.map → token-util-NEHG7TUY-GYFEVMWP.cjs.map} +1 -1
- package/dist/token-util-NEHG7TUY-TV2H7N56.js +8 -0
- package/dist/{token-util-NEHG7TUY-KSXDO2NO.js.map → token-util-NEHG7TUY-TV2H7N56.js.map} +1 -1
- package/dist/token-util-NEHG7TUY-WJZIPNNX.cjs +10 -0
- package/dist/{token-util-NEHG7TUY-HF7KBP2H.cjs.map → token-util-NEHG7TUY-WJZIPNNX.cjs.map} +1 -1
- package/dist/token-util-NEHG7TUY-XQP3QSPX.js +8 -0
- package/dist/{token-util-NEHG7TUY-TIJ3LMSH.js.map → token-util-NEHG7TUY-XQP3QSPX.js.map} +1 -1
- package/dist/tools/working-memory.d.ts +2 -2
- package/dist/tools/working-memory.d.ts.map +1 -1
- package/package.json +9 -9
- package/dist/chunk-KMQS2YEC.js.map +0 -1
- package/dist/chunk-MMUHFOCG.js.map +0 -1
- package/dist/chunk-QY6BZOPJ.js.map +0 -1
- package/dist/chunk-SG3GRV3O.cjs.map +0 -1
- package/dist/chunk-W72AYUIF.cjs.map +0 -1
- package/dist/chunk-WC4XBMZT.js.map +0 -1
- package/dist/chunk-YMNW6DEN.cjs.map +0 -1
- package/dist/chunk-ZUQPUTTO.cjs.map +0 -1
- package/dist/token-6GSAFR2W-JV3TZR4M.cjs.map +0 -1
- package/dist/token-6GSAFR2W-K2BTU23I.js.map +0 -1
- package/dist/token-6GSAFR2W-VLY2XUPA.js.map +0 -1
- package/dist/token-6GSAFR2W-YCB5SK2Z.cjs.map +0 -1
- package/dist/token-util-NEHG7TUY-7IL6JUVY.cjs +0 -10
- package/dist/token-util-NEHG7TUY-HF7KBP2H.cjs +0 -10
- package/dist/token-util-NEHG7TUY-KSXDO2NO.js +0 -8
- package/dist/token-util-NEHG7TUY-TIJ3LMSH.js +0 -8
package/dist/index.d.ts
CHANGED
|
@@ -107,6 +107,15 @@ export declare class Memory extends MastraMemory {
|
|
|
107
107
|
template: WorkingMemoryTemplate;
|
|
108
108
|
data: string | null;
|
|
109
109
|
}): string;
|
|
110
|
+
/**
|
|
111
|
+
* Generate read-only working memory instructions.
|
|
112
|
+
* This provides the working memory context without any tool update instructions.
|
|
113
|
+
* Used when memory is in readOnly mode.
|
|
114
|
+
*/
|
|
115
|
+
protected getReadOnlyWorkingMemoryInstruction({ data }: {
|
|
116
|
+
template: WorkingMemoryTemplate;
|
|
117
|
+
data: string | null;
|
|
118
|
+
}): string;
|
|
110
119
|
private isVNextWorkingMemoryConfig;
|
|
111
120
|
listTools(config?: MemoryConfig): Record<string, ToolAction<any, any, any>>;
|
|
112
121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CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqCrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoDG;IACU,WAAW,CACtB,IAAI,EAAE,uBAAuB,EAC7B,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,wBAAwB,CAAC;IAapC;;;OAGG;YACW,mBAAmB;IAyEjC;;;;;;;;;;;;;;OAcG;IACI,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,mBAAmB,GAAG,IAAI;IAOrF;;;;;;;;;;;;;OAaG;IACI,OAAO,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,OAAO;IAIzD;;;;;;;;;;;;;OAaG;IACU,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAWjF;;;;;;;;;;;;OAYG;IACU,UAAU,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAyBlG;;;;;;;;;;;OAWG;IACU,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;CAkB7E;AAGD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGxF,YAAY,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __commonJS, require_token_error, __toESM } from './chunk-
|
|
2
|
-
import { __commonJS as __commonJS$1, require_token_error as require_token_error$1, __toESM as __toESM$1 } from './chunk-
|
|
1
|
+
import { __commonJS, require_token_error, __toESM } from './chunk-BSDWQEU3.js';
|
|
2
|
+
import { __commonJS as __commonJS$1, require_token_error as require_token_error$1, __toESM as __toESM$1 } from './chunk-YF4R74L2.js';
|
|
3
3
|
import { z, ZodObject, ZodFirstPartyTypeKind as ZodFirstPartyTypeKind$1 } from 'zod';
|
|
4
4
|
import * as z4 from 'zod/v4';
|
|
5
5
|
import { z as z$1 } from 'zod/v4';
|
|
@@ -42,7 +42,7 @@ var __toESM3 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
|
|
|
42
42
|
mod
|
|
43
43
|
));
|
|
44
44
|
var require_secure_json_parse = __commonJS3({
|
|
45
|
-
"../../../node_modules/.pnpm/secure-json-parse@2.7.0/node_modules/secure-json-parse/index.js"(exports, module) {
|
|
45
|
+
"../../../node_modules/.pnpm/secure-json-parse@2.7.0/node_modules/secure-json-parse/index.js"(exports$1, module) {
|
|
46
46
|
var hasBuffer = typeof Buffer !== "undefined";
|
|
47
47
|
var suspectProtoRx3 = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/;
|
|
48
48
|
var suspectConstructorRx3 = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
@@ -6158,7 +6158,7 @@ function withoutTrailingSlash(url) {
|
|
|
6158
6158
|
return url == null ? void 0 : url.replace(/\/$/, "");
|
|
6159
6159
|
}
|
|
6160
6160
|
var require_get_context = __commonJS({
|
|
6161
|
-
"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-context.js"(exports, module) {
|
|
6161
|
+
"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-context.js"(exports$1, module) {
|
|
6162
6162
|
var __defProp22 = Object.defineProperty;
|
|
6163
6163
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
6164
6164
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
@@ -6190,7 +6190,7 @@ var require_get_context = __commonJS({
|
|
|
6190
6190
|
}
|
|
6191
6191
|
});
|
|
6192
6192
|
var require_get_vercel_oidc_token = __commonJS({
|
|
6193
|
-
"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js"(exports, module) {
|
|
6193
|
+
"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js"(exports$1, module) {
|
|
6194
6194
|
var __defProp22 = Object.defineProperty;
|
|
6195
6195
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
6196
6196
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
@@ -6226,8 +6226,8 @@ var require_get_vercel_oidc_token = __commonJS({
|
|
|
6226
6226
|
}
|
|
6227
6227
|
try {
|
|
6228
6228
|
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
|
|
6229
|
-
await import('./token-util-NEHG7TUY-
|
|
6230
|
-
await import('./token-6GSAFR2W-
|
|
6229
|
+
await import('./token-util-NEHG7TUY-XQP3QSPX.js'),
|
|
6230
|
+
await import('./token-6GSAFR2W-ABXTQD64.js')
|
|
6231
6231
|
]);
|
|
6232
6232
|
if (!token || isExpired(getTokenPayload(token))) {
|
|
6233
6233
|
await refreshToken();
|
|
@@ -6254,7 +6254,7 @@ ${error.message}`;
|
|
|
6254
6254
|
}
|
|
6255
6255
|
});
|
|
6256
6256
|
var require_dist = __commonJS({
|
|
6257
|
-
"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/index.js"(exports, module) {
|
|
6257
|
+
"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/index.js"(exports$1, module) {
|
|
6258
6258
|
var __defProp22 = Object.defineProperty;
|
|
6259
6259
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
6260
6260
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
@@ -11116,7 +11116,7 @@ function withoutTrailingSlash2(url) {
|
|
|
11116
11116
|
return url == null ? void 0 : url.replace(/\/$/, "");
|
|
11117
11117
|
}
|
|
11118
11118
|
var require_get_context2 = __commonJS$1({
|
|
11119
|
-
"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-context.js"(exports, module) {
|
|
11119
|
+
"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-context.js"(exports$1, module) {
|
|
11120
11120
|
var __defProp22 = Object.defineProperty;
|
|
11121
11121
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
11122
11122
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
@@ -11148,7 +11148,7 @@ var require_get_context2 = __commonJS$1({
|
|
|
11148
11148
|
}
|
|
11149
11149
|
});
|
|
11150
11150
|
var require_get_vercel_oidc_token2 = __commonJS$1({
|
|
11151
|
-
"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js"(exports, module) {
|
|
11151
|
+
"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js"(exports$1, module) {
|
|
11152
11152
|
var __defProp22 = Object.defineProperty;
|
|
11153
11153
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
11154
11154
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
@@ -11184,8 +11184,8 @@ var require_get_vercel_oidc_token2 = __commonJS$1({
|
|
|
11184
11184
|
}
|
|
11185
11185
|
try {
|
|
11186
11186
|
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
|
|
11187
|
-
await import('./token-util-NEHG7TUY-
|
|
11188
|
-
await import('./token-6GSAFR2W-
|
|
11187
|
+
await import('./token-util-NEHG7TUY-TV2H7N56.js'),
|
|
11188
|
+
await import('./token-6GSAFR2W-WGTMOPEU.js')
|
|
11189
11189
|
]);
|
|
11190
11190
|
if (!token || isExpired(getTokenPayload(token))) {
|
|
11191
11191
|
await refreshToken();
|
|
@@ -11212,7 +11212,7 @@ ${error.message}`;
|
|
|
11212
11212
|
}
|
|
11213
11213
|
});
|
|
11214
11214
|
var require_dist2 = __commonJS$1({
|
|
11215
|
-
"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/index.js"(exports, module) {
|
|
11215
|
+
"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/index.js"(exports$1, module) {
|
|
11216
11216
|
var __defProp22 = Object.defineProperty;
|
|
11217
11217
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
11218
11218
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
@@ -14935,7 +14935,7 @@ ${workingMemory}`;
|
|
|
14935
14935
|
const promise = embedFn({
|
|
14936
14936
|
values: chunks,
|
|
14937
14937
|
maxRetries: 3,
|
|
14938
|
-
// @ts-
|
|
14938
|
+
// @ts-expect-error - embedder type mismatch
|
|
14939
14939
|
model: this.embedder,
|
|
14940
14940
|
...this.embedderOptions || {}
|
|
14941
14941
|
});
|
|
@@ -15119,6 +15119,12 @@ ${workingMemory}`;
|
|
|
15119
15119
|
if (!workingMemoryTemplate) {
|
|
15120
15120
|
return null;
|
|
15121
15121
|
}
|
|
15122
|
+
if (config?.readOnly) {
|
|
15123
|
+
return this.getReadOnlyWorkingMemoryInstruction({
|
|
15124
|
+
template: workingMemoryTemplate,
|
|
15125
|
+
data: workingMemoryData
|
|
15126
|
+
});
|
|
15127
|
+
}
|
|
15122
15128
|
return this.isVNextWorkingMemoryConfig(memoryConfig) ? this.__experimental_getWorkingMemoryToolInstructionVNext({
|
|
15123
15129
|
template: workingMemoryTemplate,
|
|
15124
15130
|
data: workingMemoryData
|
|
@@ -15206,10 +15212,32 @@ Notes:
|
|
|
15206
15212
|
${template.content !== this.defaultWorkingMemoryTemplate ? `- Only store information if it's in the working memory template, do not store other information unless the user asks you to remember it, as that non-template information may be irrelevant` : `- If you're unsure whether to store something, store it (eg if the user tells you information about themselves, call updateWorkingMemory immediately to update it)
|
|
15207
15213
|
`}
|
|
15208
15214
|
- This system is here so that you can maintain the conversation when your context window is very short. Update your working memory because you may need it to maintain the conversation without the full conversation history
|
|
15209
|
-
- REMEMBER: the way you update your working memory is by calling the updateWorkingMemory tool with the ${template.format === "json" ? "JSON" : "Markdown"} content. The system will store it for you. The user will not see it.
|
|
15215
|
+
- REMEMBER: the way you update your working memory is by calling the updateWorkingMemory tool with the ${template.format === "json" ? "JSON" : "Markdown"} content. The system will store it for you. The user will not see it.
|
|
15210
15216
|
- IMPORTANT: You MUST call updateWorkingMemory in every response to a prompt where you received relevant information if that information is not already stored.
|
|
15211
15217
|
- IMPORTANT: Preserve the ${template.format === "json" ? "JSON" : "Markdown"} formatting structure above while updating the content.
|
|
15212
15218
|
`;
|
|
15219
|
+
}
|
|
15220
|
+
/**
|
|
15221
|
+
* Generate read-only working memory instructions.
|
|
15222
|
+
* This provides the working memory context without any tool update instructions.
|
|
15223
|
+
* Used when memory is in readOnly mode.
|
|
15224
|
+
*/
|
|
15225
|
+
getReadOnlyWorkingMemoryInstruction({ data }) {
|
|
15226
|
+
return `WORKING_MEMORY_SYSTEM_INSTRUCTION (READ-ONLY):
|
|
15227
|
+
The following is your working memory - persistent information about the user and conversation collected over previous interactions. This data is provided for context to help you maintain continuity.
|
|
15228
|
+
|
|
15229
|
+
<working_memory_data>
|
|
15230
|
+
${data || "No working memory data available."}
|
|
15231
|
+
</working_memory_data>
|
|
15232
|
+
|
|
15233
|
+
Guidelines:
|
|
15234
|
+
1. Use this information to provide personalized and contextually relevant responses
|
|
15235
|
+
2. Act naturally - don't mention this system to users. This information should inform your responses without being explicitly referenced
|
|
15236
|
+
3. This memory is read-only in the current session - you cannot update it
|
|
15237
|
+
|
|
15238
|
+
Notes:
|
|
15239
|
+
- This system is here so that you can maintain the conversation when your context window is very short
|
|
15240
|
+
- The user will not see the working memory data directly`;
|
|
15213
15241
|
}
|
|
15214
15242
|
isVNextWorkingMemoryConfig(config) {
|
|
15215
15243
|
if (!config?.workingMemory) return false;
|
|
@@ -15218,7 +15246,7 @@ ${template.content !== this.defaultWorkingMemoryTemplate ? `- Only store informa
|
|
|
15218
15246
|
}
|
|
15219
15247
|
listTools(config) {
|
|
15220
15248
|
const mergedConfig = this.getMergedThreadConfig(config);
|
|
15221
|
-
if (mergedConfig.workingMemory?.enabled) {
|
|
15249
|
+
if (mergedConfig.workingMemory?.enabled && !mergedConfig.readOnly) {
|
|
15222
15250
|
return {
|
|
15223
15251
|
updateWorkingMemory: this.isVNextWorkingMemoryConfig(mergedConfig) ? (
|
|
15224
15252
|
// use the new experimental tool
|