@mastra/libsql 1.20.0-alpha.2 → 1.20.0-alpha.3
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 +11 -0
- package/dist/docs/SKILL.md +8 -4
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-agents-agent-approval.md +14 -0
- package/dist/docs/references/docs-agents-networks.md +2 -2
- package/dist/docs/references/docs-deployment-workers.md +1 -1
- package/dist/docs/references/docs-memory-memory-processors.md +5 -5
- package/dist/docs/references/docs-memory-message-history.md +3 -3
- package/dist/docs/references/docs-storage-overview.md +14 -13
- package/dist/docs/references/docs-workflows-snapshots.md +11 -11
- package/dist/docs/references/guides-agent-frameworks-ai-sdk.md +2 -2
- package/dist/docs/references/integrations-channels-github.md +103 -0
- package/dist/docs/references/{reference-storage-dynamodb.md → integrations-databases-dynamodb.md} +1 -1
- package/dist/docs/references/{reference-storage-libsql.md → integrations-databases-libsql.md} +2 -2
- package/dist/docs/references/reference-file-based-agents-memory.md +2 -0
- package/dist/docs/references/reference-file-based-agents-storage.md +3 -1
- package/dist/docs/references/{guides-rag-retrieval.md → reference-rag-retrieval.md} +1 -1
- package/dist/docs/references/reference-storage-composite.md +4 -4
- package/dist/docs/references/reference-storage-retention.md +4 -4
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts +1 -0
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @mastra/libsql
|
|
2
2
|
|
|
3
|
+
## 1.20.0-alpha.3
|
|
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
|
+
|
|
3
14
|
## 1.20.0-alpha.2
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-libsql
|
|
|
3
3
|
description: Documentation for @mastra/libsql. Use when working with @mastra/libsql APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/libsql"
|
|
6
|
-
version: "1.20.0-alpha.
|
|
6
|
+
version: "1.20.0-alpha.3"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -32,7 +32,12 @@ Read the individual reference documents for detailed explanations and code examp
|
|
|
32
32
|
### Guides
|
|
33
33
|
|
|
34
34
|
- [AI SDK](references/guides-agent-frameworks-ai-sdk.md) - Use Mastra processors and memory with the Vercel AI SDK
|
|
35
|
-
|
|
35
|
+
|
|
36
|
+
### Integrations
|
|
37
|
+
|
|
38
|
+
- [GitHub](references/integrations-channels-github.md) - Notify a Mastra agent when subscribed GitHub pull requests change.
|
|
39
|
+
- [DynamoDB](references/integrations-databases-dynamodb.md) - Documentation for the DynamoDB storage implementation in Mastra, using a single-table design with ElectroDB.
|
|
40
|
+
- [libSQL](references/integrations-databases-libsql.md) - Documentation for the libSQL storage implementation in Mastra.
|
|
36
41
|
|
|
37
42
|
### Reference
|
|
38
43
|
|
|
@@ -42,9 +47,8 @@ Read the individual reference documents for detailed explanations and code examp
|
|
|
42
47
|
- [Memory](references/reference-file-based-agents-memory.md) - Give a file-based agent persistent memory with a memory.ts module.
|
|
43
48
|
- [Storage](references/reference-file-based-agents-storage.md) - Set the default Mastra store by file convention with storage.ts.
|
|
44
49
|
- [Reference: Memory class](references/reference-memory-memory-class.md) - Documentation for the `Memory` class in Mastra, which provides a reliable system for managing conversation history and thread-based message storage.
|
|
50
|
+
- [Retrieval, semantic search, reranking](references/reference-rag-retrieval.md) - Guide on retrieval processes in Mastra's RAG systems, including semantic search, filtering, and re-ranking.
|
|
45
51
|
- [Reference: Composite storage](references/reference-storage-composite.md) - Documentation for combining multiple storage backends in Mastra.
|
|
46
|
-
- [Reference: DynamoDB storage](references/reference-storage-dynamodb.md) - Documentation for the DynamoDB storage implementation in Mastra, using a single-table design with ElectroDB.
|
|
47
|
-
- [Reference: libSQL storage](references/reference-storage-libsql.md) - Documentation for the libSQL storage implementation in Mastra.
|
|
48
52
|
- [Reference: Storage retention (prune)](references/reference-storage-retention.md) - API reference for retention policies and prune() on Mastra storage.
|
|
49
53
|
- [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.
|
|
50
54
|
|
|
@@ -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/
|
|
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/
|
|
184
|
+
- [Migration: `.network()` to supervisor agents](https://mastra.ai/reference/migrations/network-to-supervisor)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Workers
|
|
4
4
|
|
|
5
|
-
> **Beta:**
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable. See [known limitations](#known-limitations) for current gaps.
|
|
6
6
|
|
|
7
7
|
Workers handle background processing outside the request-response cycle. Workflow step execution, cron-based scheduling, and long-running tool calls all run in workers, keeping the API responsive.
|
|
8
8
|
|
|
@@ -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
|
|
317
|
-
|
|
|
318
|
-
| [DynamoDB](https://mastra.ai/
|
|
319
|
-
| [Convex](https://mastra.ai/
|
|
320
|
-
| [Cloudflare D1](https://mastra.ai/
|
|
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
|
-
> **
|
|
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/
|
|
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
|
-
> **
|
|
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
|
|
|
@@ -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
|
-
- [
|
|
194
|
-
- [
|
|
195
|
-
- [
|
|
196
|
-
- [
|
|
197
|
-
- [
|
|
198
|
-
- [
|
|
199
|
-
- [
|
|
200
|
-
- [
|
|
201
|
-
- [
|
|
202
|
-
- [
|
|
203
|
-
- [
|
|
204
|
-
- [
|
|
205
|
-
- [
|
|
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
|
|
|
@@ -85,10 +85,10 @@ Snapshots are saved to the configured storage system. By default, they use libSQ
|
|
|
85
85
|
|
|
86
86
|
Read more about:
|
|
87
87
|
|
|
88
|
-
- [libSQL Storage](https://mastra.ai/
|
|
89
|
-
- [Upstash Storage](https://mastra.ai/
|
|
90
|
-
- [PostgreSQL Storage](https://mastra.ai/
|
|
91
|
-
- [OracleDB Storage](https://mastra.ai/
|
|
88
|
+
- [libSQL Storage](https://mastra.ai/integrations/databases/libsql)
|
|
89
|
+
- [Upstash Storage](https://mastra.ai/integrations/databases/upstash)
|
|
90
|
+
- [PostgreSQL Storage](https://mastra.ai/integrations/databases/postgresql)
|
|
91
|
+
- [OracleDB Storage](https://mastra.ai/integrations/databases/oracledb)
|
|
92
92
|
|
|
93
93
|
### Saving snapshots
|
|
94
94
|
|
|
@@ -140,13 +140,13 @@ export const mastra = new Mastra({
|
|
|
140
140
|
})
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
- [libSQL Storage](https://mastra.ai/
|
|
144
|
-
- [PostgreSQL Storage](https://mastra.ai/
|
|
145
|
-
- [OracleDB Storage](https://mastra.ai/
|
|
146
|
-
- [MongoDB Storage](https://mastra.ai/
|
|
147
|
-
- [Upstash Storage](https://mastra.ai/
|
|
148
|
-
- [Cloudflare D1](https://mastra.ai/
|
|
149
|
-
- [DynamoDB](https://mastra.ai/
|
|
143
|
+
- [libSQL Storage](https://mastra.ai/integrations/databases/libsql)
|
|
144
|
+
- [PostgreSQL Storage](https://mastra.ai/integrations/databases/postgresql)
|
|
145
|
+
- [OracleDB Storage](https://mastra.ai/integrations/databases/oracledb)
|
|
146
|
+
- [MongoDB Storage](https://mastra.ai/integrations/databases/mongodb)
|
|
147
|
+
- [Upstash Storage](https://mastra.ai/integrations/databases/upstash)
|
|
148
|
+
- [Cloudflare D1](https://mastra.ai/integrations/databases/cloudflare-d1)
|
|
149
|
+
- [DynamoDB](https://mastra.ai/integrations/databases/dynamodb)
|
|
150
150
|
- [More storage providers](https://mastra.ai/docs/storage/overview)
|
|
151
151
|
|
|
152
152
|
## Best practices
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
If you're already using the [Vercel AI SDK](https://sdk.vercel.ai) directly and want to add Mastra capabilities like [processors](https://mastra.ai/docs/agents/processors) or [memory](https://mastra.ai/docs/memory/memory-processors) without switching to the full Mastra agent API, [`withMastra()`](https://mastra.ai/reference/ai-sdk/with-mastra) lets you wrap any AI SDK model with these features. This is useful when you want to keep your existing AI SDK code but add input/output processing, conversation persistence, or content filtering.
|
|
6
6
|
|
|
7
|
-
> **Tip:** If you want to use Mastra together with AI SDK UI (e.g. `useChat()`), visit the [AI SDK UI guide](https://mastra.ai/
|
|
7
|
+
> **Tip:** If you want to use Mastra together with AI SDK UI (e.g. `useChat()`), visit the [AI SDK UI guide](https://mastra.ai/integrations/agentic-ui/ai-sdk-ui).
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -139,4 +139,4 @@ const { text } = await generateText({
|
|
|
139
139
|
- [`withMastra()`](https://mastra.ai/reference/ai-sdk/with-mastra): API reference for `withMastra()`
|
|
140
140
|
- [Processors](https://mastra.ai/docs/agents/processors): Learn about input and output processors
|
|
141
141
|
- [Memory](https://mastra.ai/docs/memory/overview): Overview of Mastra's memory system
|
|
142
|
-
- [AI SDK UI](https://mastra.ai/
|
|
142
|
+
- [AI SDK UI](https://mastra.ai/integrations/agentic-ui/ai-sdk-ui): Using AI SDK UI hooks with Mastra agents, workflows, and networks
|
|
@@ -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.
|
package/dist/docs/references/{reference-storage-dynamodb.md → integrations-databases-dynamodb.md}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
2
|
|
|
3
|
-
# DynamoDB
|
|
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
|
|
package/dist/docs/references/{reference-storage-libsql.md → integrations-databases-libsql.md}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
2
|
|
|
3
|
-
# libSQL
|
|
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/
|
|
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).
|
|
@@ -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.
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
# Storage
|
|
4
4
|
|
|
5
|
+
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
|
+
|
|
5
7
|
Mastra sets the project's default [storage](https://mastra.ai/docs/storage/overview) from a `storage.ts` file directly under `src/mastra/`. The file default-exports a store, which replaces the built-in in-memory store used for memory, workflows, observability, and other storage domains.
|
|
6
8
|
|
|
7
9
|
Use this page for the file-based convention. For backend choice, storage domains, retention, and provider details, see [storage overview](https://mastra.ai/docs/storage/overview).
|
|
8
10
|
|
|
9
11
|
## Quickstart
|
|
10
12
|
|
|
11
|
-
Use [`LibSQLStore`](https://mastra.ai/
|
|
13
|
+
Use [`LibSQLStore`](https://mastra.ai/integrations/databases/libsql) for a local file-backed store:
|
|
12
14
|
|
|
13
15
|
```typescript
|
|
14
16
|
import { LibSQLStore } from '@mastra/libsql'
|
|
@@ -534,4 +534,4 @@ The re-ranked results combine vector similarity with semantic understanding to i
|
|
|
534
534
|
|
|
535
535
|
For more details about re-ranking, see the [rerank()](https://mastra.ai/reference/rag/rerankWithScorer) method.
|
|
536
536
|
|
|
537
|
-
For graph-based retrieval that follows connections between chunks, see the [GraphRAG](https://mastra.ai/
|
|
537
|
+
For graph-based retrieval that follows connections between chunks, see the [GraphRAG](https://mastra.ai/reference/rag/graph-rag-guide) documentation.
|
|
@@ -338,7 +338,7 @@ const storage = new MastraCompositeStore({
|
|
|
338
338
|
|
|
339
339
|
Observability data can quickly overwhelm general-purpose databases in production. A single agent interaction can generate hundreds of spans, and high-traffic applications can produce thousands of traces per day.
|
|
340
340
|
|
|
341
|
-
**[ClickHouse](https://mastra.ai/
|
|
341
|
+
**[ClickHouse](https://mastra.ai/integrations/databases/clickhouse)** is recommended for production observability because it's optimized for high-volume, write-heavy analytics workloads. Use composite storage to route observability to ClickHouse while keeping other data in your primary database:
|
|
342
342
|
|
|
343
343
|
```typescript
|
|
344
344
|
import { MastraCompositeStore } from '@mastra/core/storage'
|
|
@@ -360,7 +360,7 @@ const storage = new MastraCompositeStore({
|
|
|
360
360
|
})
|
|
361
361
|
```
|
|
362
362
|
|
|
363
|
-
> **Note:** `ObservabilityStorageClickhouseVNext` is the current observability domain implementation. The legacy `ObservabilityStorageClickhouse` class is also exported and remains supported for projects that haven't migrated. See the [ClickHouse storage reference](https://mastra.ai/
|
|
363
|
+
> **Note:** `ObservabilityStorageClickhouseVNext` is the current observability domain implementation. The legacy `ObservabilityStorageClickhouse` class is also exported and remains supported for projects that haven't migrated. See the [ClickHouse storage reference](https://mastra.ai/integrations/databases/clickhouse) for details.
|
|
364
364
|
|
|
365
365
|
### Replicated ClickHouse for multi-replica clusters
|
|
366
366
|
|
|
@@ -392,6 +392,6 @@ const storage = new MastraCompositeStore({
|
|
|
392
392
|
})
|
|
393
393
|
```
|
|
394
394
|
|
|
395
|
-
Don't set `replication` on ClickHouse Cloud. Cloud rewrites `MergeTree` to `SharedMergeTree` server-side. See the [ClickHouse storage reference](https://mastra.ai/
|
|
395
|
+
Don't set `replication` on ClickHouse Cloud. Cloud rewrites `MergeTree` to `SharedMergeTree` server-side. See the [ClickHouse storage reference](https://mastra.ai/integrations/databases/clickhouse) for the full config shape and operator notes.
|
|
396
396
|
|
|
397
|
-
> **
|
|
397
|
+
> **Note:** This approach is also required when using storage providers that don't support observability (like Convex, DynamoDB, or Cloudflare). See the [MastraStorageExporter documentation](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage) for the full list of supported providers.
|
|
@@ -8,7 +8,7 @@ Storage grows without bound by default. Retention is an opt-in, age-based cleanu
|
|
|
8
8
|
|
|
9
9
|
Retention covers **growth tables** only: tables that accumulate rows unbounded as a side effect of normal operation (conversation history, telemetry, job and run records, schedule fire history, event feeds). User-authored artifacts and config (agents, skills, workspaces, prompt blocks, datasets, schedule definitions, channel installations, and so on) grow with user intent and are edited or deleted explicitly, so they're not valid retention keys.
|
|
10
10
|
|
|
11
|
-
The reference implementations are [libSQL](https://mastra.ai/
|
|
11
|
+
The reference implementations are [libSQL](https://mastra.ai/integrations/databases/libsql), [PostgreSQL](https://mastra.ai/integrations/databases/postgresql), and [MongoDB](https://mastra.ai/integrations/databases/mongodb). Other adapters keep rows forever until they implement retention.
|
|
12
12
|
|
|
13
13
|
## Usage example
|
|
14
14
|
|
|
@@ -238,11 +238,11 @@ Handing that free space back to the OS is a separate concern that Mastra doesn't
|
|
|
238
238
|
|
|
239
239
|
For MongoDB, deleted documents are reused by future insertions. To reclaim disk space, run [`db.runCommand({ compact: "collection_name" })`](https://www.mongodb.com/docs/manual/reference/command/compact/) during a maintenance window.
|
|
240
240
|
|
|
241
|
-
> **LibSQL and Turso:** [Turso Cloud](https://mastra.ai/
|
|
241
|
+
> **LibSQL and Turso:** [Turso Cloud](https://mastra.ai/integrations/databases/libsql) manages storage compaction for you, so there's nothing to reclaim manually. This applies only to self-hosted libSQL files.
|
|
242
242
|
|
|
243
243
|
## Related
|
|
244
244
|
|
|
245
|
-
- [libSQL storage](https://mastra.ai/
|
|
246
|
-
- [PostgreSQL storage](https://mastra.ai/
|
|
245
|
+
- [libSQL storage](https://mastra.ai/integrations/databases/libsql)
|
|
246
|
+
- [PostgreSQL storage](https://mastra.ai/integrations/databases/postgresql)
|
|
247
247
|
- [Composite storage](https://mastra.ai/reference/storage/composite)
|
|
248
248
|
- [Storage overview](https://mastra.ai/reference/storage/overview)
|
package/dist/index.cjs
CHANGED
|
@@ -6572,6 +6572,7 @@ function addSqliteMetadataValuePredicate(conditions, params, path, value) {
|
|
|
6572
6572
|
params.push(path, value ? "true" : "false", path, value ? 1 : 0);
|
|
6573
6573
|
}
|
|
6574
6574
|
var MemoryLibSQL = class MemoryLibSQL extends _mastra_core_storage.MemoryStorage {
|
|
6575
|
+
supportsPartialThreadUpdate = true;
|
|
6575
6576
|
supportsObservationalMemory = true;
|
|
6576
6577
|
/**
|
|
6577
6578
|
* Retention-eligible tables. `threads`, `messages`, and `resources` all anchor
|