@mastra/memory 1.21.0 → 1.21.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.21.1-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed direct memory recall so semantic recall score thresholds filter recalled messages. ([#18211](https://github.com/mastra-ai/mastra/pull/18211))
8
+
9
+ - Updated dependencies [[`5bd72d2`](https://github.com/mastra-ai/mastra/commit/5bd72d255f45b5ea8ab342643bd463814a980a24), [`1cc9ee1`](https://github.com/mastra-ai/mastra/commit/1cc9ee1ba51db53020a735626d33017a60b4b5b3), [`417baae`](https://github.com/mastra-ai/mastra/commit/417baae40b995db5819c845036947f0c27dc1c00), [`74955f9`](https://github.com/mastra-ai/mastra/commit/74955f9120cde8b1d8ce4399232b4033236be858), [`30ebaf0`](https://github.com/mastra-ai/mastra/commit/30ebaf07bed5f4d30f2f257836c15d1bf7e40aae), [`5704634`](https://github.com/mastra-ai/mastra/commit/5704634b22133167dea337a942a34f57aaa3fa14), [`417baae`](https://github.com/mastra-ai/mastra/commit/417baae40b995db5819c845036947f0c27dc1c00), [`74955f9`](https://github.com/mastra-ai/mastra/commit/74955f9120cde8b1d8ce4399232b4033236be858), [`74955f9`](https://github.com/mastra-ai/mastra/commit/74955f9120cde8b1d8ce4399232b4033236be858), [`c0eda2b`](https://github.com/mastra-ai/mastra/commit/c0eda2bcd91a228427314b12c91d8b147f3a739f), [`c0eda2b`](https://github.com/mastra-ai/mastra/commit/c0eda2bcd91a228427314b12c91d8b147f3a739f), [`b13925b`](https://github.com/mastra-ai/mastra/commit/b13925bfa91aa8700f56fa54a9ce707ee7e4ba62), [`bf94ec6`](https://github.com/mastra-ai/mastra/commit/bf94ec68192d9f16e46ef7e5ac36370aeeddf35d), [`a29f371`](https://github.com/mastra-ai/mastra/commit/a29f371aef629ac8562661524a497127e93b5131), [`74955f9`](https://github.com/mastra-ai/mastra/commit/74955f9120cde8b1d8ce4399232b4033236be858), [`073f910`](https://github.com/mastra-ai/mastra/commit/073f910481e7d94b95ba3830f96531774ae95d33), [`ebbe1d3`](https://github.com/mastra-ai/mastra/commit/ebbe1d31a965a3adb0e728758f326b8122b4b55f), [`1f97ce5`](https://github.com/mastra-ai/mastra/commit/1f97ce5695463bebb4eaacf501da6fb403e20885), [`74955f9`](https://github.com/mastra-ai/mastra/commit/74955f9120cde8b1d8ce4399232b4033236be858), [`64f58c0`](https://github.com/mastra-ai/mastra/commit/64f58c04e78b40137497d47f781e897e416f22a5), [`74955f9`](https://github.com/mastra-ai/mastra/commit/74955f9120cde8b1d8ce4399232b4033236be858), [`ebbe1d3`](https://github.com/mastra-ai/mastra/commit/ebbe1d31a965a3adb0e728758f326b8122b4b55f), [`417baae`](https://github.com/mastra-ai/mastra/commit/417baae40b995db5819c845036947f0c27dc1c00), [`8e25a78`](https://github.com/mastra-ai/mastra/commit/8e25a78e0597575f0b0729bae8c5e190c84869b5), [`417baae`](https://github.com/mastra-ai/mastra/commit/417baae40b995db5819c845036947f0c27dc1c00), [`a5b22d3`](https://github.com/mastra-ai/mastra/commit/a5b22d314d62a68d801886a8d3d0eb6c089473db), [`417baae`](https://github.com/mastra-ai/mastra/commit/417baae40b995db5819c845036947f0c27dc1c00), [`74955f9`](https://github.com/mastra-ai/mastra/commit/74955f9120cde8b1d8ce4399232b4033236be858), [`74955f9`](https://github.com/mastra-ai/mastra/commit/74955f9120cde8b1d8ce4399232b4033236be858)]:
10
+ - @mastra/core@1.46.0-alpha.0
11
+
3
12
  ## 1.21.0
4
13
 
5
14
  ### Minor Changes
@@ -3,7 +3,7 @@ name: mastra-memory
3
3
  description: Documentation for @mastra/memory. Use when working with @mastra/memory APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/memory"
6
- version: "1.21.0"
6
+ version: "1.21.1-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.21.0",
2
+ "version": "1.21.1-alpha.0",
3
3
  "package": "@mastra/memory",
4
4
  "exports": {
5
5
  "ModelByInputTokens": {
@@ -2,12 +2,12 @@
2
2
 
3
3
  **Added in:** `@mastra/core@1.42.0`
4
4
 
5
+ > **Alpha:** The Goals feature is in alpha stage and subject to breaking changes in minor versions until it graduates from its alpha status.
6
+
5
7
  A goal is a durable, thread-scoped objective: a standing instruction the agent keeps working toward across loop iterations until a judge model decides it is satisfied or a run budget is exhausted. The objective is persisted in thread state, so it survives reloads and is evaluated in-loop — even when a new message arrives in the middle of an already-running turn.
6
8
 
7
9
  Goals build on the same machinery as [`isTaskComplete`](https://mastra.ai/docs/agents/supervisor-agents): an LLM-as-judge scores the agent's output each iteration and gates the loop. The difference is that a goal is **durable** (stored in thread state, not passed per call) and is set and updated through `Agent` methods rather than per-`stream()` options.
8
10
 
9
- > **Note:** Goals are experimental and may change in a future release.
10
-
11
11
  ## When to use goals
12
12
 
13
13
  Use a goal when you want an agent to keep working toward a single objective across many iterations and messages, without re-supplying the success criteria on every call:
package/dist/index.cjs CHANGED
@@ -22919,7 +22919,7 @@ var ZodFirstPartyTypeKind3;
22919
22919
  ZodFirstPartyTypeKind4["ZodReadonly"] = "ZodReadonly";
22920
22920
  })(ZodFirstPartyTypeKind3 || (ZodFirstPartyTypeKind3 = {}));
22921
22921
 
22922
- // ../_vendored/ai_v5/dist/chunk-OMTTDYJT.js
22922
+ // ../_vendored/ai_v5/dist/chunk-I2JBSJEA.js
22923
22923
  var marker17 = "vercel.ai.error";
22924
22924
  var symbol18 = Symbol.for(marker17);
22925
22925
  var _a19;
@@ -47348,6 +47348,9 @@ var Memory = class extends memory.MastraMemory {
47348
47348
  })
47349
47349
  );
47350
47350
  }
47351
+ const semanticConfig = typeof config3.semanticRecall === "object" ? config3.semanticRecall : void 0;
47352
+ const threshold = semanticConfig?.threshold;
47353
+ const filteredVectorResults = threshold !== void 0 ? vectorResults.filter((r) => r.score >= threshold) : vectorResults;
47351
47354
  const memoryStore = await this.getMemoryStore();
47352
47355
  const effectivePerPage = historyDisabledByConfig ? 0 : perPage;
47353
47356
  const paginatedResult = await memoryStore.listMessages({
@@ -47357,8 +47360,8 @@ var Memory = class extends memory.MastraMemory {
47357
47360
  page,
47358
47361
  orderBy: effectiveOrderBy,
47359
47362
  filter: filter3,
47360
- ...vectorResults?.length ? {
47361
- include: vectorResults.map((r) => ({
47363
+ ...filteredVectorResults?.length ? {
47364
+ include: filteredVectorResults.map((r) => ({
47362
47365
  id: r.metadata?.message_id,
47363
47366
  threadId: r.metadata?.thread_id,
47364
47367
  withNextMessages: typeof vectorConfig.messageRange === "number" ? vectorConfig.messageRange : vectorConfig.messageRange.after,