@mastra/memory 1.26.1 → 1.26.2-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 +8 -0
- package/dist/docs/SKILL.md +4 -4
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-agents-agent-approval.md +5 -5
- package/dist/docs/references/docs-capabilities-subagents.md +1 -1
- package/dist/docs/references/docs-memory-working-memory.md +1 -1
- package/dist/docs/references/docs-storage-overview.md +7 -6
- package/dist/docs/references/integrations-databases-postgresql.md +8 -8
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @mastra/memory
|
|
2
2
|
|
|
3
|
+
## 1.26.2-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`aa3e7be`](https://github.com/mastra-ai/mastra/commit/aa3e7be30f8addb0278ea74429f4df054517a287), [`90822db`](https://github.com/mastra-ai/mastra/commit/90822dba08fb2169c518e4a6d7f127c098eb46b8), [`3700208`](https://github.com/mastra-ai/mastra/commit/37002080c7838267803a7e579a7d58b908d62f36), [`8b7131e`](https://github.com/mastra-ai/mastra/commit/8b7131eb0407f58f5205e68fb27b81f026488f28), [`cf418b6`](https://github.com/mastra-ai/mastra/commit/cf418b65efb81997e9b8dc7638eee363c5d96c96), [`79c4f82`](https://github.com/mastra-ai/mastra/commit/79c4f8295f568752eeadf8a9b50010a7d9ec06ae)]:
|
|
8
|
+
- @mastra/core@1.59.0-alpha.1
|
|
9
|
+
- @mastra/schema-compat@1.3.7-alpha.0
|
|
10
|
+
|
|
3
11
|
## 1.26.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -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.26.
|
|
6
|
+
version: "1.26.2-alpha.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -16,7 +16,7 @@ Read the individual reference documents for detailed explanations and code examp
|
|
|
16
16
|
|
|
17
17
|
### Docs
|
|
18
18
|
|
|
19
|
-
- [
|
|
19
|
+
- [Human-in-the-loop](references/docs-agents-agent-approval.md) - Learn how to require approvals and suspend tool execution, plus automatically resume suspended tools while keeping humans in control of agent workflows.
|
|
20
20
|
- [Agent networks](references/docs-agents-networks.md) - Coordinate multiple agents, workflows, and tools using agent networks for complex, non-deterministic task execution.
|
|
21
21
|
- [Subagents](references/docs-capabilities-subagents.md) - Learn how to coordinate multiple agents with delegation hooks, iteration monitoring, message filtering, and task completion scoring.
|
|
22
22
|
- [Evals with memory](references/docs-evals-evals-with-memory.md) - Run scorers against memory-enabled agents, including observational memory in thread scope, using runEvals and dataset experiments.
|
|
@@ -26,10 +26,10 @@ Read the individual reference documents for detailed explanations and code examp
|
|
|
26
26
|
- [Message history](references/docs-memory-message-history.md) - Learn how to configure message history in Mastra to store recent messages from the current conversation.
|
|
27
27
|
- [Multi-user threads](references/docs-memory-multi-user-threads.md) - Share one Mastra thread between multiple users by carrying speaker identity in the message body.
|
|
28
28
|
- [Observational Memory](references/docs-memory-observational-memory.md) - Learn how Observational Memory keeps your agent's context window small while preserving long-term memory across conversations.
|
|
29
|
-
- [Memory
|
|
29
|
+
- [Memory](references/docs-memory-overview.md) - Learn how Mastra's memory system works with working memory, message history, semantic recall, and observational memory.
|
|
30
30
|
- [Semantic recall](references/docs-memory-semantic-recall.md) - Learn how to use semantic recall in Mastra to retrieve relevant messages from past conversations using vector search and embeddings.
|
|
31
31
|
- [Working memory](references/docs-memory-working-memory.md) - Learn how to configure working memory in Mastra to store persistent user data, preferences.
|
|
32
|
-
- [Storage
|
|
32
|
+
- [Storage](references/docs-storage-overview.md) - Configure storage for Mastra to persist runtime state across agents, workflows, observability, evals, schedules, and memory.
|
|
33
33
|
|
|
34
34
|
### Integrations
|
|
35
35
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# Human-in-the-loop
|
|
4
4
|
|
|
5
|
-
Agents sometimes require the same [human-in-the-loop](https://mastra.ai/docs/workflows/human-in-the-loop) oversight used in workflows when calling tools that handle sensitive operations, like deleting resources or running long processes. With
|
|
5
|
+
Agents sometimes require the same [human-in-the-loop (HITL)](https://mastra.ai/docs/workflows/human-in-the-loop) oversight used in workflows when calling tools that handle sensitive operations, like deleting resources or running long processes. With human-in-the-loop you can suspend a tool call before it executes so a human can approve or decline it, or let tools suspend themselves to request additional context from the user.
|
|
6
6
|
|
|
7
|
-
## When to use
|
|
7
|
+
## When to use human-in-the-loop
|
|
8
8
|
|
|
9
9
|
- **Destructive or irreversible actions** such as deleting records or sending emails, or alternatively processing payments.
|
|
10
10
|
- **Cost-heavy operations** like calling expensive third-party APIs where you want to verify arguments first.
|
|
@@ -12,7 +12,7 @@ Agents sometimes require the same [human-in-the-loop](https://mastra.ai/docs/wor
|
|
|
12
12
|
|
|
13
13
|
## Quickstart
|
|
14
14
|
|
|
15
|
-
Mark a tool with `requireApproval: true`, then check for the `tool-call-approval` chunk in the stream to approve or decline:
|
|
15
|
+
Mark a tool with `requireApproval: true`, then check for the `tool-call-approval` chunk in the stream to approve or decline the action:
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
18
|
import { Agent } from '@mastra/core/agent'
|
|
@@ -48,7 +48,7 @@ for await (const chunk of stream.fullStream) {
|
|
|
48
48
|
}
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
> **Note:**
|
|
51
|
+
> **Note:** Human-in-the-loop uses snapshots to capture request state. Configure a [storage provider](https://mastra.ai/docs/storage/overview) on your Mastra instance or you'll see a "snapshot not found" error.
|
|
52
52
|
>
|
|
53
53
|
> Snapshots for agent runs are minimal resume artifacts: they hold only what's needed to resume the suspended run and are deleted once the run finishes. Use [tracing](https://mastra.ai/docs/observability/overview) for the execution record and [memory](https://mastra.ai/docs/memory/overview) for the conversation history.
|
|
54
54
|
|
|
@@ -447,7 +447,7 @@ Version overrides propagate automatically through delegation. See [Subagent vers
|
|
|
447
447
|
|
|
448
448
|
- [Background tasks](https://mastra.ai/docs/long-running-agents/background-tasks)
|
|
449
449
|
- [Subagent versioning](https://mastra.ai/reference/editor/versioning)
|
|
450
|
-
- [Guide: Research coordinator](https://mastra.ai/
|
|
450
|
+
- [Guide: Research coordinator](https://mastra.ai/blog/build-a-research-coordinator-with-supervisor-agents)
|
|
451
451
|
- [Agent.stream() reference](https://mastra.ai/reference/streaming/agents/stream)
|
|
452
452
|
- [Agent.streamUntilIdle() reference](https://mastra.ai/reference/streaming/agents/streamUntilIdle)
|
|
453
453
|
- [Agent.generate() reference](https://mastra.ai/reference/agents/generate)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
2
|
|
|
3
|
-
# Working
|
|
3
|
+
# Working memory
|
|
4
4
|
|
|
5
5
|
While [message history](https://mastra.ai/docs/memory/message-history) and [semantic recall](https://mastra.ai/docs/memory/semantic-recall) help agents remember conversations, working memory allows them to maintain persistent information about users across interactions.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
2
|
|
|
3
|
-
# Storage
|
|
3
|
+
# Storage
|
|
4
4
|
|
|
5
5
|
Storage is the persistence layer for the Mastra runtime. It keeps memory, workflow state, observability data, eval results, schedules, and long-running agent state available after a process restarts.
|
|
6
6
|
|
|
@@ -188,25 +188,26 @@ You can also route `observability` to a dedicated analytics backend. See the [ob
|
|
|
188
188
|
|
|
189
189
|
## Supported providers
|
|
190
190
|
|
|
191
|
-
Each provider page includes installation instructions, configuration parameters, and usage examples
|
|
191
|
+
Each provider page includes installation instructions, configuration parameters, and usage examples. libSQL is the fastest path for local development because it doesn't require running a separate database server.
|
|
192
192
|
|
|
193
|
+
- [Aurora DSQL](https://mastra.ai/integrations/databases/aurora-dsql)
|
|
194
|
+
- [ClickHouse](https://mastra.ai/integrations/databases/clickhouse)
|
|
193
195
|
- [Cloudflare D1](https://mastra.ai/integrations/databases/cloudflare-d1)
|
|
194
|
-
- [Cloudflare KV
|
|
196
|
+
- [Cloudflare KV](https://mastra.ai/integrations/databases/cloudflare-kv)
|
|
195
197
|
- [Convex](https://mastra.ai/integrations/databases/convex)
|
|
198
|
+
- [DuckDB](https://mastra.ai/integrations/databases/duckdb)
|
|
196
199
|
- [DynamoDB](https://mastra.ai/integrations/databases/dynamodb)
|
|
197
200
|
- [Google Cloud Spanner](https://mastra.ai/integrations/databases/spanner)
|
|
198
201
|
- [LanceDB](https://mastra.ai/integrations/databases/lancedb)
|
|
199
202
|
- [libSQL](https://mastra.ai/integrations/databases/libsql)
|
|
200
|
-
- [Microsoft SQL Server](https://mastra.ai/integrations/databases/mssql)
|
|
201
203
|
- [MongoDB](https://mastra.ai/integrations/databases/mongodb)
|
|
204
|
+
- [MSSQL](https://mastra.ai/integrations/databases/mssql)
|
|
202
205
|
- [Neon Postgres](https://mastra.ai/integrations/databases/neon)
|
|
203
206
|
- [OracleDB](https://mastra.ai/integrations/databases/oracledb)
|
|
204
207
|
- [PostgreSQL](https://mastra.ai/integrations/databases/postgresql)
|
|
205
208
|
- [Redis](https://mastra.ai/integrations/databases/redis)
|
|
206
209
|
- [Upstash](https://mastra.ai/integrations/databases/upstash)
|
|
207
210
|
|
|
208
|
-
> **Tip:** libSQL is the fastest path for local development because it doesn't require running a separate database server.
|
|
209
|
-
|
|
210
211
|
## Next steps
|
|
211
212
|
|
|
212
213
|
- [Composite storage](https://mastra.ai/reference/storage/composite)
|
|
@@ -521,11 +521,11 @@ const stats = await storage.db.one(`
|
|
|
521
521
|
|
|
522
522
|
PostgreSQL offers different index types optimized for specific scenarios:
|
|
523
523
|
|
|
524
|
-
| Index Type | Best For | Storage
|
|
525
|
-
| ------------------- | --------------------------------------- |
|
|
526
|
-
| **btree** (default) | Range queries, sorting, general purpose | Moderate
|
|
527
|
-
| **hash** | Equality comparisons only | Small
|
|
528
|
-
| **gin** | JSONB, arrays, full-text search | Large
|
|
529
|
-
| **gist** | Geometric data, full-text search | Moderate
|
|
530
|
-
| **spgist** | Non-balanced data, text patterns | Small
|
|
531
|
-
| **brin** | Large tables with natural ordering | Very small
|
|
524
|
+
| Index Type | Best For | Storage size | Speed |
|
|
525
|
+
| ------------------- | --------------------------------------- | ------------ | -------------------------- |
|
|
526
|
+
| **btree** (default) | Range queries, sorting, general purpose | Moderate | Fast |
|
|
527
|
+
| **hash** | Equality comparisons only | Small | Very fast for `=` |
|
|
528
|
+
| **gin** | JSONB, arrays, full-text search | Large | Fast for contains |
|
|
529
|
+
| **gist** | Geometric data, full-text search | Moderate | Fast for nearest-neighbor |
|
|
530
|
+
| **spgist** | Non-balanced data, text patterns | Small | Fast for specific patterns |
|
|
531
|
+
| **brin** | Large tables with natural ordering | Very small | Fast for ranges |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/memory",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.2-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"tokenx": "^1.3.0",
|
|
45
45
|
"xxhash-wasm": "^1.1.0",
|
|
46
46
|
"zod": "^4.4.3",
|
|
47
|
-
"@mastra/schema-compat": "1.3.
|
|
47
|
+
"@mastra/schema-compat": "1.3.7-alpha.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@ai-sdk/openai": "^1.3.24",
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
"vitest": "4.1.10",
|
|
63
63
|
"@internal/ai-sdk-v4": "0.0.69",
|
|
64
64
|
"@internal/ai-sdk-v5": "0.0.69",
|
|
65
|
-
"@internal/lint": "0.0.122",
|
|
66
65
|
"@internal/ai-v6": "0.0.69",
|
|
66
|
+
"@internal/lint": "0.0.122",
|
|
67
67
|
"@internal/types-builder": "0.0.97",
|
|
68
|
-
"@mastra/core": "1.
|
|
68
|
+
"@mastra/core": "1.59.0-alpha.1"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@mastra/core": ">=1.4.1-0 <2.0.0-0"
|