@mastra/memory 1.26.1-alpha.4 → 1.26.1-alpha.7

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/docs/SKILL.md +15 -9
  3. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  4. package/dist/docs/references/docs-agents-agent-approval.md +14 -0
  5. package/dist/docs/references/docs-agents-networks.md +2 -2
  6. package/dist/docs/references/docs-capabilities-subagents.md +6 -3
  7. package/dist/docs/references/docs-long-running-agents-goals.md +1 -1
  8. package/dist/docs/references/docs-memory-memory-processors.md +5 -5
  9. package/dist/docs/references/docs-memory-message-history.md +3 -3
  10. package/dist/docs/references/docs-memory-observational-memory.md +1 -1
  11. package/dist/docs/references/docs-storage-overview.md +14 -13
  12. package/dist/docs/references/integrations-channels-github.md +103 -0
  13. package/dist/docs/references/{reference-storage-dsql.md → integrations-databases-aurora-dsql.md} +1 -1
  14. package/dist/docs/references/{reference-storage-dynamodb.md → integrations-databases-dynamodb.md} +1 -1
  15. package/dist/docs/references/{reference-storage-libsql.md → integrations-databases-libsql.md} +2 -2
  16. package/dist/docs/references/{reference-storage-mongodb.md → integrations-databases-mongodb.md} +1 -1
  17. package/dist/docs/references/{reference-storage-oracledb.md → integrations-databases-oracledb.md} +1 -1
  18. package/dist/docs/references/{reference-storage-postgresql.md → integrations-databases-postgresql.md} +1 -1
  19. package/dist/docs/references/{reference-storage-redis.md → integrations-databases-redis.md} +1 -1
  20. package/dist/docs/references/{reference-storage-upstash.md → integrations-databases-upstash.md} +1 -1
  21. package/dist/docs/references/reference-file-based-agents-memory.md +2 -0
  22. package/dist/docs/references/reference-migrations-agentnetwork.md +100 -0
  23. package/dist/docs/references/reference-migrations-upgrade-to-v1-memory.md +288 -0
  24. package/dist/docs/references/reference-vectors-oracledb.md +2 -2
  25. package/dist/index.cjs +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/processors/index.cjs +1 -1
  28. package/dist/processors/index.js +1 -1
  29. package/dist/processors/observational-memory/measure-image-buffer.d.ts +23 -0
  30. package/dist/processors/observational-memory/measure-image-buffer.d.ts.map +1 -0
  31. package/dist/processors/observational-memory/observation-strategies/async-buffer.d.ts.map +1 -1
  32. package/dist/{src-kjoZv97r.cjs → src-CTwoCwmY.cjs} +65 -32
  33. package/dist/src-CTwoCwmY.cjs.map +1 -0
  34. package/dist/{src-hv0DMVM-.js → src-DGdlH4fo.js} +64 -31
  35. package/dist/src-DGdlH4fo.js.map +1 -0
  36. package/package.json +4 -5
  37. package/dist/src-hv0DMVM-.js.map +0 -1
  38. package/dist/src-kjoZv97r.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @mastra/memory
2
2
 
3
+ ## 1.26.1-alpha.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed a crash where updating a thread without a title (for example during observational memory buffering) could write a null title and violate the database's not-null constraint when running a newer @mastra/memory against an older storage package. Memory now checks whether the connected storage adapter supports partial thread updates and backfills the existing title for older adapters, so mixed-version deployments keep working. See #21041 for the original title-clobbering fix this makes backward compatible. ([#21257](https://github.com/mastra-ai/mastra/pull/21257))
8
+
9
+ - Storage adapters now declare support for partial thread updates, letting newer @mastra/memory preserve existing thread titles instead of overwriting them, while remaining safe against older versions. ([#21257](https://github.com/mastra-ai/mastra/pull/21257))
10
+
11
+ - Updated dependencies [[`dc4a25d`](https://github.com/mastra-ai/mastra/commit/dc4a25d41af4e2fe97a816070eaec6aa963ab53b), [`dc4a25d`](https://github.com/mastra-ai/mastra/commit/dc4a25d41af4e2fe97a816070eaec6aa963ab53b)]:
12
+ - @mastra/core@1.58.0-alpha.15
13
+
14
+ ## 1.26.1-alpha.6
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [[`2e4624e`](https://github.com/mastra-ai/mastra/commit/2e4624edb6917e61249cb60ee377735e7af7e4a9), [`e6534fa`](https://github.com/mastra-ai/mastra/commit/e6534fab031216f6cb48c4c9907cbfdce9d60bc6), [`7fdcaa6`](https://github.com/mastra-ai/mastra/commit/7fdcaa66105d64290f9b14432a12ec99f39c4d3a), [`5dba2a4`](https://github.com/mastra-ai/mastra/commit/5dba2a41600385751f5aace79878904e1972609d), [`cfd0d9e`](https://github.com/mastra-ai/mastra/commit/cfd0d9ec77ec3c69dd96f79cdb579e03d79f22ce), [`d9d93b2`](https://github.com/mastra-ai/mastra/commit/d9d93b25e4a65ad5fa153fa35be7ed149c8d587f)]:
19
+ - @mastra/core@1.58.0-alpha.12
20
+ - @mastra/schema-compat@1.3.6-alpha.3
21
+
22
+ ## 1.26.1-alpha.5
23
+
24
+ ### Patch Changes
25
+
26
+ - Remove the `image-size` dependency from `@mastra/memory` and measure image dimensions with the already-present `probe-image-size` instead. ([#21120](https://github.com/mastra-ai/mastra/pull/21120))
27
+
28
+ Every published version of `image-size` carries unfixed denial-of-service advisories (GHSA-w3rx-r6r6-pgpr / CVE-2025-71330 and GHSA-5p2g-fcmc-qvqq): a malformed image could hang its parse loop and exhaust the heap. The repository is archived, so no fixed release is coming, and the previous pin to `1.2.1` moved between two equally affected releases rather than remediating the flaw. Because image bytes reaching agent memory are untrusted, a crafted 32-byte image was enough to crash the process.
29
+
30
+ Dimension detection still covers the formats models accept (PNG, JPEG, WebP, GIF, AVIF, BMP, ICO, PSD, SVG, TIFF). Unrecognized formats now report unknown dimensions, which token counting already handled.
31
+
32
+ - Updated dependencies [[`b8ce7ec`](https://github.com/mastra-ai/mastra/commit/b8ce7ec96e39343c6c2f36d12d68a9ad816c09f7), [`a3a3624`](https://github.com/mastra-ai/mastra/commit/a3a3624f646b98e409424d8defccbd334da9e8b8), [`6246914`](https://github.com/mastra-ai/mastra/commit/62469146636911f3cbbe0880bd011c6a897a59a7), [`3f73c07`](https://github.com/mastra-ai/mastra/commit/3f73c076727e8c36b4fff7a1b40290fb68957fa8), [`7c1ebb1`](https://github.com/mastra-ai/mastra/commit/7c1ebb15690c4b3f0eabb19077cf8af573311e57), [`32980a3`](https://github.com/mastra-ai/mastra/commit/32980a3e2413d0274ac244d32c37d910edc13f00), [`4bcdfaf`](https://github.com/mastra-ai/mastra/commit/4bcdfaf0eac3199d7cb171b0a19a92c9c341eea4), [`af4636a`](https://github.com/mastra-ai/mastra/commit/af4636a74463275d71c1d13a38f7d2b738f128bf), [`a463cdf`](https://github.com/mastra-ai/mastra/commit/a463cdf1c95c3059e70f0bff27959e8558bb899d), [`0ea6b80`](https://github.com/mastra-ai/mastra/commit/0ea6b8001408ce02b56e8be0536b0fd8cbaf8ad2)]:
33
+ - @mastra/core@1.58.0-alpha.11
34
+
3
35
  ## 1.26.1-alpha.4
4
36
 
5
37
  ### Patch 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.26.1-alpha.4"
6
+ version: "1.26.1-alpha.7"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -31,6 +31,18 @@ Read the individual reference documents for detailed explanations and code examp
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
32
  - [Storage overview](references/docs-storage-overview.md) - Configure storage for Mastra to persist runtime state across agents, workflows, observability, evals, schedules, and memory.
33
33
 
34
+ ### Integrations
35
+
36
+ - [GitHub](references/integrations-channels-github.md) - Notify a Mastra agent when subscribed GitHub pull requests change.
37
+ - [Aurora DSQL](references/integrations-databases-aurora-dsql.md) - Documentation for the Amazon Aurora DSQL storage implementation in Mastra.
38
+ - [DynamoDB](references/integrations-databases-dynamodb.md) - Documentation for the DynamoDB storage implementation in Mastra, using a single-table design with ElectroDB.
39
+ - [libSQL](references/integrations-databases-libsql.md) - Documentation for the libSQL storage implementation in Mastra.
40
+ - [MongoDB](references/integrations-databases-mongodb.md) - Documentation for the MongoDB storage implementation in Mastra.
41
+ - [OracleDB](references/integrations-databases-oracledb.md) - Documentation for the Oracle Database storage provider in Mastra.
42
+ - [PostgreSQL](references/integrations-databases-postgresql.md) - Documentation for the PostgreSQL storage implementation in Mastra.
43
+ - [Redis](references/integrations-databases-redis.md) - Documentation for the Redis storage implementation in Mastra.
44
+ - [Upstash](references/integrations-databases-upstash.md) - Documentation for the Upstash storage implementation in Mastra.
45
+
34
46
  ### Reference
35
47
 
36
48
  - [Reference: Mastra.getMemory()](references/reference-core-getMemory.md) - Documentation for the `Mastra.getMemory()` method in Mastra, which retrieves a registered memory instance by its registry key.
@@ -45,15 +57,9 @@ Read the individual reference documents for detailed explanations and code examp
45
57
  - [Reference: Observational Memory](references/reference-memory-observational-memory.md) - API reference for Observational Memory in Mastra: a three-tier memory system that uses Observer and Reflector agents to maintain long-term memory across conversations.
46
58
  - [Reference: summarizeConversation()](references/reference-memory-summarizeConversation.md) - Documentation for the standalone `summarizeConversation()` function in Mastra, which summarizes messages you pass in and extracts structured values from them.
47
59
  - [Reference: Memory.summarizeThread()](references/reference-memory-summarizeThread.md) - Documentation for the `Memory.summarizeThread()` method in Mastra, which summarizes a thread's conversation in one shot and extracts structured values from it.
60
+ - [Migration: AgentNetwork to .network()](references/reference-migrations-agentnetwork.md) - Learn how to migrate from AgentNetwork primitives to .network() in Mastra.
61
+ - [Memory](references/reference-migrations-upgrade-to-v1-memory.md) - Learn how to migrate memory-related changes when upgrading to v1.
48
62
  - [Reference: TokenLimiterProcessor](references/reference-processors-token-limiter-processor.md) - Documentation for the TokenLimiterProcessor in Mastra, which limits the number of tokens in messages.
49
- - [Reference: Aurora DSQL Storage](references/reference-storage-dsql.md) - Documentation for the Amazon Aurora DSQL storage implementation in Mastra.
50
- - [Reference: DynamoDB storage](references/reference-storage-dynamodb.md) - Documentation for the DynamoDB storage implementation in Mastra, using a single-table design with ElectroDB.
51
- - [Reference: libSQL storage](references/reference-storage-libsql.md) - Documentation for the libSQL storage implementation in Mastra.
52
- - [Reference: MongoDB storage](references/reference-storage-mongodb.md) - Documentation for the MongoDB storage implementation in Mastra.
53
- - [Reference: OracleDB storage](references/reference-storage-oracledb.md) - Documentation for the Oracle Database storage provider in Mastra.
54
- - [Reference: PostgreSQL storage](references/reference-storage-postgresql.md) - Documentation for the PostgreSQL storage implementation in Mastra.
55
- - [Reference: Redis Storage](references/reference-storage-redis.md) - Documentation for the Redis storage implementation in Mastra.
56
- - [Reference: Upstash storage](references/reference-storage-upstash.md) - Documentation for the Upstash storage implementation in Mastra.
57
63
  - [Reference: libSQL vector store](references/reference-vectors-libsql.md) - Documentation for the LibSQLVector class in Mastra, which provides vector search using libSQL with vector extensions.
58
64
  - [Reference: MongoDB vector store](references/reference-vectors-mongodb.md) - Documentation for the MongoDBVector class in Mastra, which provides vector search using MongoDB Atlas and Atlas Vector Search.
59
65
  - [Reference: OracleDB vector store](references/reference-vectors-oracledb.md) - Documentation for the Oracle Database vector provider in Mastra.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.26.1-alpha.4",
2
+ "version": "1.26.1-alpha.7",
3
3
  "package": "@mastra/memory",
4
4
  "exports": {},
5
5
  "modules": {
@@ -90,6 +90,20 @@ for await (const chunk of stream.fullStream) {
90
90
  }
91
91
  ```
92
92
 
93
+ #### Explaining a decline
94
+
95
+ `declineToolCall()`, `declineToolCallGenerate()`, and `declineNetworkToolCall()` accept an optional `reason`. The reason is returned to the model in place of the tool result, so the model can adjust instead of retrying blindly. It's also stored on the tool call's `approval` metadata, so it's still there when the conversation is recalled.
96
+
97
+ ```typescript
98
+ const declined = await agent.declineToolCall({
99
+ runId: stream.runId,
100
+ toolCallId,
101
+ reason: 'Reading other users PII is not allowed, ask the user for their own email instead',
102
+ })
103
+ ```
104
+
105
+ Without a `reason`, the model receives the default message `Tool call was not approved by the user`.
106
+
93
107
  #### Conditional approval with a function
94
108
 
95
109
  Instead of a boolean, `requireToolApproval` accepts a function that decides per tool call. It receives the `toolName`, the `args` the model passed, the `requestContext`, and the `workspace`. Return `true` to require approval for that call, or `false` to allow it. This lets you gate approval at runtime, for example, only for tools whose name matches a pattern:
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **Deprecated:** Agent networks are deprecated and will be removed in a future major release. [Supervisor agents](https://mastra.ai/docs/capabilities/subagents) using `agent.stream()` or `agent.generate()` are now the recommended approach. It provides the same multi-agent coordination with better control, a simpler API, and easier debugging.
6
6
  >
7
- > See the [migration guide](https://mastra.ai/guides/migrations/network-to-supervisor) to upgrade.
7
+ > See the [migration guide](https://mastra.ai/reference/migrations/network-to-supervisor) to upgrade.
8
8
 
9
9
  A **routing agent** uses an LLM to interpret a request and decide which primitives (subagents, workflows, or tools) to call, in what order, and with what data.
10
10
 
@@ -181,4 +181,4 @@ Requirements for automatic resumption:
181
181
  ## Related
182
182
 
183
183
  - [Supervisor agents](https://mastra.ai/docs/capabilities/subagents)
184
- - [Migration: `.network()` to supervisor agents](https://mastra.ai/guides/migrations/network-to-supervisor)
184
+ - [Migration: `.network()` to supervisor agents](https://mastra.ai/reference/migrations/network-to-supervisor)
@@ -16,7 +16,7 @@ Common use cases:
16
16
  - Multi-step tasks that need different expertise at each stage
17
17
  - Tasks where you need fine-grained control over delegation behavior
18
18
 
19
- > **Note:** A parent agent that coordinates subagents is often called a supervisor. The supervisor pattern is one approach to building multi-agent systems in Mastra. For other patterns, read the [conceptual overview](https://mastra.ai/guides/concepts/multi-agent-systems).
19
+ > **Note:** A parent agent that coordinates subagents is often called a supervisor. The supervisor pattern is one approach to building multi-agent systems in Mastra. For other patterns, read the [conceptual overview](https://mastra.ai/docs/guides/multi-agent-systems).
20
20
 
21
21
  ## Quickstart
22
22
 
@@ -113,7 +113,7 @@ The `context` object includes:
113
113
 
114
114
  ### Request context at the delegation boundary
115
115
 
116
- Each delegation receives a request context whose entries are shallowly copied from the parent run, excluding run-scoped identity keys. Setting or deleting entries during the subagent run does not affect the parent's context. Set entries on `context.requestContext` in `onDelegationStart` to pass values to the delegated run:
116
+ Each delegation receives a request context whose entries are shallowly copied from the parent run, excluding run-scoped identity keys. Setting or deleting entries during the subagent run doesn't affect the parent's context. Set entries on `context.requestContext` in `onDelegationStart` to pass values to the delegated run:
117
117
 
118
118
  ```typescript
119
119
  const stream = await parentAgent.stream('Research AI trends', {
@@ -134,6 +134,9 @@ Called after a delegation finishes. Use it to inspect results or provide feedbac
134
134
 
135
135
  - `context.bail()`: Stop the parent agent's loop immediately
136
136
  - Return `{ feedback: '...' }`: Add feedback that gets saved to the parent agent's memory and is visible to subsequent iterations
137
+ - Return `{ resultText: '...' }`: Replace the tool result text the parent model sees for this delegation, within the current run
138
+
139
+ Use `resultText` when the subagent's own result would mislead the parent immediately. For example, a subagent that stops on a tool-calls step returns empty text, which the parent model reads as a successful but empty delegation. Unlike `feedback`, which only reaches the model on the next turn, `resultText` changes what the parent reasons on right away.
137
140
 
138
141
  ```typescript
139
142
  const stream = await parentAgent.stream('Research AI trends', {
@@ -450,5 +453,5 @@ Version overrides propagate automatically through delegation. See [Subagent vers
450
453
  - [Agent.generate() reference](https://mastra.ai/reference/agents/generate)
451
454
  - [Agent approval](https://mastra.ai/docs/agents/agent-approval)
452
455
  - [Memory in multi-agent systems](https://mastra.ai/docs/memory/overview)
453
- - [Concept: Multi-agent systems](https://mastra.ai/guides/concepts/multi-agent-systems)
456
+ - [Concept: Multi-agent systems](https://mastra.ai/docs/guides/multi-agent-systems)
454
457
  - 📹 [Mastra supervisor agents workshop](https://www.youtube.com/watch?v=FNb2fL9WhQg\&t=1872s)
@@ -4,7 +4,7 @@
4
4
 
5
5
  **Added in:** `@mastra/core@1.42.0`
6
6
 
7
- > **Beta:** The Goals feature is in beta stage and subject to breaking changes in minor versions until it graduates from its beta status.
7
+ > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
8
8
 
9
9
  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's satisfied or a run budget is exhausted.
10
10
 
@@ -313,11 +313,11 @@ Both scenarios are safe - guardrails prevent inappropriate content from being pe
313
313
 
314
314
  Some storage providers enforce record size limits that base64-encoded file attachments can exceed:
315
315
 
316
- | Provider | Record size limit |
317
- | ------------------------------------------------------------------ | ----------------- |
318
- | [DynamoDB](https://mastra.ai/reference/storage/dynamodb) | 400 KB |
319
- | [Convex](https://mastra.ai/reference/storage/convex) | 1 MiB |
320
- | [Cloudflare D1](https://mastra.ai/reference/storage/cloudflare-d1) | 1 MiB |
316
+ | Provider | Record size limit |
317
+ | ----------------------------------------------------------------------- | ----------------- |
318
+ | [DynamoDB](https://mastra.ai/integrations/databases/dynamodb) | 400 KB |
319
+ | [Convex](https://mastra.ai/integrations/databases/convex) | 1 MiB |
320
+ | [Cloudflare D1](https://mastra.ai/integrations/databases/cloudflare-d1) | 1 MiB |
321
321
 
322
322
  PostgreSQL, MongoDB, and libSQL have higher limits and are usually unaffected.
323
323
 
@@ -6,13 +6,13 @@ Message history is the most basic and important form of memory. It gives the LLM
6
6
 
7
7
  You can also retrieve message history to display past conversations in your UI.
8
8
 
9
- > **Info:** Each message belongs to a thread (the conversation) and a resource (the user or entity it's associated with). See [Threads and resources](#threads-and-resources) for more detail.
9
+ > **Note:** Each message belongs to a thread (the conversation) and a resource (the user or entity it's associated with). See [Threads and resources](#threads-and-resources) for more detail.
10
10
 
11
11
  > **Warning:** When you use memory with a client application, send **only the new message** from the client instead of the full conversation history.
12
12
  >
13
13
  > Sending the full history is redundant because Mastra loads messages from storage, and it can cause message ordering bugs when client-side timestamps conflict with stored timestamps.
14
14
  >
15
- > For an AI SDK example, see [Using Mastra Memory](https://mastra.ai/guides/build-your-ui/ai-sdk-ui).
15
+ > For an AI SDK example, see [Using Mastra Memory](https://mastra.ai/integrations/agentic-ui/ai-sdk-ui).
16
16
 
17
17
  ## Threads and resources
18
18
 
@@ -113,7 +113,7 @@ await agent.stream('Hello', {
113
113
  })
114
114
  ```
115
115
 
116
- > **Info:** Threads and messages are created automatically when you call `agent.generate()` or `agent.stream()`, but you can also create them manually with [`createThread()`](https://mastra.ai/reference/memory/createThread) and [`saveMessages()`](https://mastra.ai/reference/memory/memory-class).
116
+ > **Note:** Threads and messages are created automatically when you call `agent.generate()` or `agent.stream()`, but you can also create them manually with [`createThread()`](https://mastra.ai/reference/memory/createThread) and [`saveMessages()`](https://mastra.ai/reference/memory/memory-class).
117
117
 
118
118
  You can use this history in two ways:
119
119
 
@@ -92,7 +92,7 @@ See [configuration options](https://mastra.ai/reference/memory/observational-mem
92
92
  >
93
93
  > Observational memory still relies on stored conversation history. Sending the full history is redundant and can cause message ordering bugs when client-side timestamps conflict with stored timestamps.
94
94
  >
95
- > For an AI SDK example, see [Using Mastra Memory](https://mastra.ai/guides/build-your-ui/ai-sdk-ui).
95
+ > For an AI SDK example, see [Using Mastra Memory](https://mastra.ai/integrations/agentic-ui/ai-sdk-ui).
96
96
 
97
97
  > **Note:** OM currently only supports `@mastra/pg`, `@mastra/libsql`, `@mastra/mysql`, `@mastra/mongodb`, `@mastra/convex`, and `@mastra/oracledb` storage adapters. It uses background agents for managing memory. When no model is set, the default model is `google/gemini-2.5-flash`.
98
98
 
@@ -190,19 +190,20 @@ You can also route `observability` to a dedicated analytics backend. See the [ob
190
190
 
191
191
  Each provider page includes installation instructions, configuration parameters, and usage examples:
192
192
 
193
- - [libSQL](https://mastra.ai/reference/storage/libsql)
194
- - [PostgreSQL](https://mastra.ai/reference/storage/postgresql)
195
- - [MongoDB](https://mastra.ai/reference/storage/mongodb)
196
- - [OracleDB](https://mastra.ai/reference/storage/oracledb)
197
- - [Upstash](https://mastra.ai/reference/storage/upstash)
198
- - [Redis](https://mastra.ai/reference/storage/redis)
199
- - [Cloudflare D1](https://mastra.ai/reference/storage/cloudflare-d1)
200
- - [Cloudflare KV & Durable Objects](https://mastra.ai/reference/storage/cloudflare)
201
- - [Convex](https://mastra.ai/reference/storage/convex)
202
- - [DynamoDB](https://mastra.ai/reference/storage/dynamodb)
203
- - [LanceDB](https://mastra.ai/reference/storage/lance)
204
- - [Microsoft SQL Server](https://mastra.ai/reference/storage/mssql)
205
- - [Google Cloud Spanner](https://mastra.ai/reference/storage/spanner)
193
+ - [Cloudflare D1](https://mastra.ai/integrations/databases/cloudflare-d1)
194
+ - [Cloudflare KV & Durable Objects](https://mastra.ai/integrations/databases/cloudflare-kv)
195
+ - [Convex](https://mastra.ai/integrations/databases/convex)
196
+ - [DynamoDB](https://mastra.ai/integrations/databases/dynamodb)
197
+ - [Google Cloud Spanner](https://mastra.ai/integrations/databases/spanner)
198
+ - [LanceDB](https://mastra.ai/integrations/databases/lancedb)
199
+ - [libSQL](https://mastra.ai/integrations/databases/libsql)
200
+ - [Microsoft SQL Server](https://mastra.ai/integrations/databases/mssql)
201
+ - [MongoDB](https://mastra.ai/integrations/databases/mongodb)
202
+ - [Neon Postgres](https://mastra.ai/integrations/databases/neon)
203
+ - [OracleDB](https://mastra.ai/integrations/databases/oracledb)
204
+ - [PostgreSQL](https://mastra.ai/integrations/databases/postgresql)
205
+ - [Redis](https://mastra.ai/integrations/databases/redis)
206
+ - [Upstash](https://mastra.ai/integrations/databases/upstash)
206
207
 
207
208
  > **Tip:** libSQL is the fastest path for local development because it doesn't require running a separate database server.
208
209
 
@@ -0,0 +1,103 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # GitHub
4
+
5
+ The `@mastra/github-signals` provider lets an agent follow pull requests (PRs). It polls subscribed PRs and sends [notification signals](https://mastra.ai/docs/long-running-agents/signals) to the agent thread when relevant activity occurs.
6
+
7
+ ## Installation
8
+
9
+ Install GitHub Signals and the memory packages used in this example:
10
+
11
+ **npm**:
12
+
13
+ ```bash
14
+ npm install @mastra/github-signals @mastra/libsql @mastra/memory
15
+ ```
16
+
17
+ **pnpm**:
18
+
19
+ ```bash
20
+ pnpm add @mastra/github-signals @mastra/libsql @mastra/memory
21
+ ```
22
+
23
+ **Yarn**:
24
+
25
+ ```bash
26
+ yarn add @mastra/github-signals @mastra/libsql @mastra/memory
27
+ ```
28
+
29
+ **Bun**:
30
+
31
+ ```bash
32
+ bun add @mastra/github-signals @mastra/libsql @mastra/memory
33
+ ```
34
+
35
+ ## Prerequisites
36
+
37
+ GitHub Signals requires:
38
+
39
+ - A Mastra storage adapter with memory and notification support. The provider stores each subscription in the thread's metadata, so the thread must already exist.
40
+ - The `gitcrawl` command on `PATH`, configured to access the repositories you want to monitor. The provider runs `gitcrawl sync` and reads its SQLite database.
41
+ - The `sqlite3` command on `PATH`.
42
+ - The [GitHub CLI](https://cli.github.com/) installed and authenticated. The provider uses `gh api` to check whether comment authors have access to the repository before notifying the agent.
43
+
44
+ By default, comments from users with `admin`, `maintain`, or `write` access can trigger notifications. CodeRabbit and Devin bot comments are also allowed. Configure `authorizedPermissions`, `authorizedBots`, or `ignoredBots` when you need different rules.
45
+
46
+ ## Agent and subscription
47
+
48
+ Create one `GithubSignals` instance and register it on the agent. Register the agent and a storage adapter on the Mastra instance:
49
+
50
+ ```typescript
51
+ import { Agent } from '@mastra/core/agent'
52
+ import { Mastra } from '@mastra/core/mastra'
53
+ import { Memory } from '@mastra/memory'
54
+ import { GithubSignals } from '@mastra/github-signals'
55
+ import { LibSQLStore } from '@mastra/libsql'
56
+
57
+ export const githubSignals = new GithubSignals()
58
+
59
+ export const devAgent = new Agent({
60
+ id: 'dev-agent',
61
+ name: 'Development Agent',
62
+ instructions: 'Triage pull request activity and help resolve issues.',
63
+ model: 'openai/gpt-5.6-sol',
64
+ memory: new Memory(),
65
+ signals: [githubSignals],
66
+ })
67
+
68
+ export const mastra = new Mastra({
69
+ agents: { devAgent },
70
+ storage: new LibSQLStore({
71
+ id: 'mastra-storage',
72
+ url: 'file:./mastra.db',
73
+ }),
74
+ })
75
+ ```
76
+
77
+ After the agent has created a memory thread, subscribe that thread to a PR. Passing `owner` and `repo` works from any directory:
78
+
79
+ ```typescript
80
+ await githubSignals.subscribeThreadToPR({
81
+ threadId: 'thread-123',
82
+ resourceId: 'user-123',
83
+ pr: {
84
+ owner: 'acme',
85
+ repo: 'web-app',
86
+ number: 42,
87
+ },
88
+ })
89
+ ```
90
+
91
+ The provider syncs the PR immediately, stores the subscription, and starts polling every five minutes. Set `pollIntervalMs` in the `GithubSignals` constructor to change the interval. If the process restarts, call `startPollingForThread()` for each persisted thread subscription to resume polling.
92
+
93
+ ## Pull request notifications
94
+
95
+ GitHub Signals notifies the agent when a subscribed PR has:
96
+
97
+ - A new authorized comment, commit, or other pull request activity.
98
+ - A change in unresolved review threads.
99
+ - Continuous integration (CI) checks that start, fail, or recover.
100
+ - Merge conflicts that appear or are resolved.
101
+ - A state change to closed, reopened, or merged.
102
+
103
+ The initial sync sends a baseline notification with the current PR state. A merge automatically removes the thread's subscription to that PR.
@@ -1,6 +1,6 @@
1
1
  > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
2
 
3
- # Aurora DSQL Storage
3
+ # Aurora DSQL
4
4
 
5
5
  The Aurora DSQL storage implementation provides storage using Amazon Aurora DSQL with IAM authentication.
6
6
 
@@ -1,6 +1,6 @@
1
1
  > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
2
 
3
- # DynamoDB storage
3
+ # DynamoDB
4
4
 
5
5
  The DynamoDB storage implementation provides a high-capacity and performant NoSQL database solution for Mastra, using a single-table design pattern with [ElectroDB](https://electrodb.dev/).
6
6
 
@@ -1,6 +1,6 @@
1
1
  > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
2
 
3
- # libSQL storage
3
+ # libSQL
4
4
 
5
5
  [libSQL](https://docs.turso.tech/libsql) is an open-source, SQLite-compatible database that supports both local and remote deployments. It can be used to store message history, workflow snapshots, traces, and eval scores.
6
6
 
@@ -140,4 +140,4 @@ const thread = await memoryStore?.getThreadById({ threadId: '...' })
140
140
 
141
141
  libSQL supports observability and is ideal for local development. Use the `realtime` [tracing strategy](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage) for immediate visibility while debugging.
142
142
 
143
- For production environments with higher trace volumes, consider using [PostgreSQL](https://mastra.ai/reference/storage/postgresql) or [ClickHouse via composite storage](https://mastra.ai/reference/storage/composite).
143
+ For production environments with higher trace volumes, consider using [PostgreSQL](https://mastra.ai/integrations/databases/postgresql) or [ClickHouse via composite storage](https://mastra.ai/reference/storage/composite).
@@ -1,6 +1,6 @@
1
1
  > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
2
 
3
- # MongoDB storage
3
+ # MongoDB
4
4
 
5
5
  The MongoDB storage implementation provides a high-capacity storage solution using MongoDB databases with support for both document storage and vector operations.
6
6
 
@@ -1,6 +1,6 @@
1
1
  > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
2
 
3
- # OracleDB storage
3
+ # OracleDB
4
4
 
5
5
  The OracleDB storage provider stores Mastra application state in Oracle Database. It implements Mastra's composite storage interface, so one `OracleStore` instance can back memory, workflow snapshots, observability, scores, scorer definitions, MCP client metadata, and agent registry data.
6
6
 
@@ -1,6 +1,6 @@
1
1
  > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
2
 
3
- # PostgreSQL storage
3
+ # PostgreSQL
4
4
 
5
5
  The PostgreSQL storage implementation provides a production-ready storage solution using PostgreSQL databases.
6
6
 
@@ -1,6 +1,6 @@
1
1
  > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
2
 
3
- # Redis Storage
3
+ # Redis
4
4
 
5
5
  The Redis storage implementation provides a high-performance storage solution using direct Redis connections via [`node-redis`](https://github.com/redis/node-redis) (the official Redis client for Node.js). It supports standalone Redis, and through custom client configuration, Redis Sentinel and Cluster deployments.
6
6
 
@@ -1,6 +1,6 @@
1
1
  > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
2
 
3
- # Upstash storage
3
+ # Upstash
4
4
 
5
5
  The Upstash storage implementation provides a serverless-friendly storage solution using Upstash's Redis-compatible key-value store.
6
6
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  # Memory
4
4
 
5
+ > **Beta:** Breaking changes may occur without a major version bump until the API is stable.
6
+
5
7
  A file-based agent gets [memory](https://mastra.ai/docs/memory/overview) from a `memory.ts` file that default-exports a [`Memory`](https://mastra.ai/reference/memory/memory-class) instance. Use this page for the file-based convention; use the memory docs for message history, semantic recall, storage, and processors.
6
8
 
7
9
  Without `memory.ts` or `config.memory`, the agent has no memory by default. Each `generate()` or `stream()` call starts without remembered conversation state unless you pass the prior context yourself.
@@ -0,0 +1,100 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # Migrate from AgentNetwork to `.network()`
4
+
5
+ As of `v0.20.0` for `@mastra/core`, the following changes apply.
6
+
7
+ ## Upgrade from AI SDK v4 to v5
8
+
9
+ - Bump all your model provider packages by a major version.
10
+
11
+ > **Note:** This will ensure that they're all v5 models now.
12
+
13
+ ## Memory is required
14
+
15
+ - Memory is now required for the agent network to function properly.
16
+
17
+ > **Note:** You must configure memory for the agent.
18
+
19
+ ## Migration paths
20
+
21
+ If you were using the `AgentNetwork` primitive, you can replace the `AgentNetwork` with `Agent`.
22
+
23
+ Before:
24
+
25
+ ```typescript
26
+ import { AgentNetwork } from '@mastra/core/network'
27
+
28
+ const agent = new AgentNetwork({
29
+ name: 'agent-network',
30
+ agents: [agent1, agent2],
31
+ tools: { tool1, tool2 },
32
+ model: 'openai/gpt-5.6-sol',
33
+ instructions: 'You are a network agent that can help users with a variety of tasks.',
34
+ })
35
+
36
+ await agent.stream('Find me the weather in Tokyo.')
37
+ ```
38
+
39
+ After:
40
+
41
+ ```typescript
42
+ import { Agent } from '@mastra/core/agent'
43
+ import { Memory } from '@mastra/memory'
44
+
45
+ const memory = new Memory()
46
+
47
+ const agent = new Agent({
48
+ id: 'agent-network',
49
+ name: 'agent-network',
50
+ agents: { agent1, agent2 },
51
+ tools: { tool1, tool2 },
52
+ model: 'openai/gpt-5.6-sol',
53
+ instructions: 'You are a network agent that can help users with a variety of tasks.',
54
+ memory,
55
+ })
56
+
57
+ await agent.network('Find me the weather in Tokyo.')
58
+ ```
59
+
60
+ If you were using the `NewAgentNetwork` primitive, you can replace the `NewAgentNetwork` with `Agent`.
61
+
62
+ Before:
63
+
64
+ ```typescript
65
+ import { NewAgentNetwork } from '@mastra/core/network/vnext'
66
+
67
+ const agent = new NewAgentNetwork({
68
+ id: 'agent-network',
69
+ name: 'agent-network',
70
+ agents: { agent1, agent2 },
71
+ workflows: { workflow1 },
72
+ tools: { tool1, tool2 },
73
+ model: 'openai/gpt-5.6-sol',
74
+ instructions: 'You are a network agent that can help users with a variety of tasks.',
75
+ })
76
+
77
+ await agent.loop('Find me the weather in Tokyo.')
78
+ ```
79
+
80
+ After:
81
+
82
+ ```typescript
83
+ import { Agent } from '@mastra/core/agent'
84
+ import { Memory } from '@mastra/memory'
85
+
86
+ const memory = new Memory()
87
+
88
+ const agent = new Agent({
89
+ id: 'agent-network',
90
+ name: 'agent-network',
91
+ agents: { agent1, agent2 },
92
+ workflows: { workflow1 },
93
+ tools: { tool1, tool2 },
94
+ model: 'openai/gpt-5.6-sol',
95
+ instructions: 'You are a network agent that can help users with a variety of tasks.',
96
+ memory,
97
+ })
98
+
99
+ await agent.network('Find me the weather in Tokyo.')
100
+ ```