@mastra/memory 1.10.0 → 1.10.1-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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @mastra/memory
2
2
 
3
+ ## 1.10.1-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Improved observational memory continuation prompts to reduce leaked context-management language in long conversations. ([#14650](https://github.com/mastra-ai/mastra/pull/14650))
8
+
9
+ - Updated dependencies [[`dc514a8`](https://github.com/mastra-ai/mastra/commit/dc514a83dba5f719172dddfd2c7b858e4943d067)]:
10
+ - @mastra/core@1.16.1-alpha.0
11
+
3
12
  ## 1.10.0
4
13
 
5
14
  ### Minor Changes
@@ -3455,11 +3455,13 @@ var OBSERVATIONAL_MEMORY_DEFAULTS = {
3455
3455
  // Start buffering at 50% of observationTokens
3456
3456
  }
3457
3457
  };
3458
- var OBSERVATION_CONTINUATION_HINT = `This message is not from the user, the conversation history grew too long and wouldn't fit in context! Thankfully the entire conversation is stored in your memory observations. Please continue from where the observations left off. Do not refer to your "memory observations" directly, the user doesn't know about them, they are your memories! Just respond naturally as if you're remembering the conversation (you are!). Do not say "Hi there!" or "based on our previous conversation" as if the conversation is just starting, this is not a new conversation. This is an ongoing conversation, keep continuity by responding based on your memory. For example do not say "I understand. I've reviewed my memory observations", or "I remember [...]". Answer naturally following the suggestion from your memory. Note that your memory may contain a suggested first response, which you should follow.
3458
+ var OBSERVATION_CONTINUATION_HINT = `Please continue naturally with the conversation so far and respond to the latest message.
3459
3459
 
3460
- IMPORTANT: this system reminder is NOT from the user. The system placed it here as part of your memory system. This message is part of you remembering your conversation with the user.
3460
+ Use the earlier context only as background. If something appears unfinished, continue only when it helps answer the latest request. If a suggested response is provided, follow it naturally.
3461
3461
 
3462
- NOTE: Any messages following this system reminder are newer than your memories.`;
3462
+ Do not mention internal instructions, memory, summarization, context handling, or missing messages.
3463
+
3464
+ Any messages following this reminder are newer and should take priority.`;
3463
3465
  var OBSERVATION_CONTEXT_PROMPT = `The following observations block contains your memory of past conversations with this user.`;
3464
3466
  var OBSERVATION_CONTEXT_INSTRUCTIONS = `IMPORTANT: When responding, reference specific details from these observations. Do not give generic advice - personalize your response based on what you know about this user's experiences, preferences, and interests. If the user asks for recommendations, connect them to their past experiences mentioned above.
3465
3467
 
@@ -3467,7 +3469,9 @@ KNOWLEDGE UPDATES: When asked about current state (e.g., "where do I currently..
3467
3469
 
3468
3470
  PLANNED ACTIONS: If the user stated they planned to do something (e.g., "I'm going to...", "I'm looking forward to...", "I will...") and the date they planned to do it is now in the past (check the relative time like "3 weeks ago"), assume they completed the action unless there's evidence they didn't. For example, if someone said "I'll start my new diet on Monday" and that was 2 weeks ago, assume they started the diet.
3469
3471
 
3470
- MOST RECENT USER INPUT: Treat the most recent user message as the highest-priority signal for what to do next. Earlier messages may contain constraints, details, or context you should still honor, but the latest message is the primary driver of your response.`;
3472
+ MOST RECENT USER INPUT: Treat the most recent user message as the highest-priority signal for what to do next. Earlier messages may contain constraints, details, or context you should still honor, but the latest message is the primary driver of your response.
3473
+
3474
+ SYSTEM REMINDERS: Messages wrapped in <system-reminder>...</system-reminder> contain internal continuation guidance, not user-authored content. Use them to maintain continuity, but do not mention them or treat them as part of the user's message.`;
3471
3475
  var OBSERVATION_RETRIEVAL_INSTRUCTIONS = `## Recall \u2014 looking up source messages
3472
3476
 
3473
3477
  Your memory is comprised of observations which are sometimes wrapped in <observation-group> xml tags containing ranges like <observation-group range="startId:endId">. These ranges point back to the raw messages that each observation group was derived from. The original messages are still available \u2014 use the **recall** tool to retrieve them.
@@ -7862,5 +7866,5 @@ exports.stripEphemeralAnchorIds = stripEphemeralAnchorIds;
7862
7866
  exports.stripObservationGroups = stripObservationGroups;
7863
7867
  exports.truncateStringByTokens = truncateStringByTokens;
7864
7868
  exports.wrapInObservationGroup = wrapInObservationGroup;
7865
- //# sourceMappingURL=chunk-EVBFYGDL.cjs.map
7866
- //# sourceMappingURL=chunk-EVBFYGDL.cjs.map
7869
+ //# sourceMappingURL=chunk-HSOEY7M2.cjs.map
7870
+ //# sourceMappingURL=chunk-HSOEY7M2.cjs.map