@mastra/libsql 0.0.0-oma-20260208093055 → 0.0.0-parallel-workflow-20260212235652
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 +166 -22
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-agents-agent-memory.md +45 -1
- package/dist/docs/references/docs-observability-overview.md +1 -1
- package/dist/docs/references/guides-agent-frameworks-ai-sdk.md +6 -2
- package/dist/index.cjs +3471 -1905
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3470 -1907
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/agents/index.d.ts +9 -12
- package/dist/storage/domains/agents/index.d.ts.map +1 -1
- package/dist/storage/domains/mcp-clients/index.d.ts +26 -0
- package/dist/storage/domains/mcp-clients/index.d.ts.map +1 -0
- package/dist/storage/domains/memory/index.d.ts +1 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/prompt-blocks/index.d.ts +25 -0
- package/dist/storage/domains/prompt-blocks/index.d.ts.map +1 -0
- package/dist/storage/domains/scorer-definitions/index.d.ts +26 -0
- package/dist/storage/domains/scorer-definitions/index.d.ts.map +1 -0
- package/dist/storage/index.d.ts +4 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +6 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,51 +1,195 @@
|
|
|
1
1
|
# @mastra/libsql
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-parallel-workflow-20260212235652
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fixed agent version storage to persist the requestContextSchema field. Previously, requestContextSchema was defined on the agent snapshot type but was not included in the database schema, INSERT statements, or row parsing logic, causing it to be silently dropped when saving and loading agent versions. ([#13003](https://github.com/mastra-ai/mastra/pull/13003))
|
|
8
|
+
|
|
9
|
+
- Added MCP client storage domain and ToolProvider interface for integrating external tool catalogs with stored agents. ([#12974](https://github.com/mastra-ai/mastra/pull/12974))
|
|
10
|
+
|
|
11
|
+
**MCP Client Storage**
|
|
12
|
+
|
|
13
|
+
New storage domain for persisting MCP client configurations with CRUD operations. Each MCP client can contain multiple servers with independent tool selection:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
// Store an MCP client with multiple servers
|
|
17
|
+
await storage.mcpClients.create({
|
|
18
|
+
id: 'my-mcp',
|
|
19
|
+
name: 'My MCP Client',
|
|
20
|
+
servers: {
|
|
21
|
+
'github-server': { url: 'https://mcp.github.com/sse' },
|
|
22
|
+
'slack-server': { url: 'https://mcp.slack.com/sse' },
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
LibSQL, PostgreSQL, and MongoDB storage adapters all implement the new MCP client domain.
|
|
28
|
+
|
|
29
|
+
**ToolProvider Interface**
|
|
30
|
+
|
|
31
|
+
New `ToolProvider` interface at `@mastra/core/tool-provider` enables third-party tool catalog integration (e.g., Composio, Arcade AI):
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import type { ToolProvider } from '@mastra/core/tool-provider';
|
|
35
|
+
|
|
36
|
+
# Providers implement: listToolkits(), listTools(), getToolSchema(), resolveTools()
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`resolveTools()` receives `requestContext` from the current request, enabling per-user API keys and credentials in multi-tenant setups:
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
const tools = await provider.resolveTools(slugs, configs, {
|
|
43
|
+
requestContext: { apiKey: 'user-specific-key', userId: 'tenant-123' },
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Tool Selection Semantics**
|
|
48
|
+
|
|
49
|
+
Both `mcpClients` and `integrationTools` on stored agents follow consistent three-state selection:
|
|
50
|
+
- `{ tools: undefined }` — provider registered, no tools selected
|
|
51
|
+
- `{ tools: {} }` — all tools from provider included
|
|
52
|
+
- `{ tools: { 'TOOL_SLUG': { description: '...' } } }` — specific tools with optional overrides
|
|
53
|
+
|
|
54
|
+
- Updated dependencies [[`7ef618f`](https://github.com/mastra-ai/mastra/commit/7ef618f3c49c27e2f6b27d7f564c557c0734325b), [`b373564`](https://github.com/mastra-ai/mastra/commit/b37356491d43b4d53067f10cb669abaf2502f218), [`b896b41`](https://github.com/mastra-ai/mastra/commit/b896b41343de7fcc14442fb40fe82d189e65bbe2), [`6415277`](https://github.com/mastra-ai/mastra/commit/6415277a438faa00db2af850ead5dee25f40c428), [`0831bbb`](https://github.com/mastra-ai/mastra/commit/0831bbb5bc750c18e9b22b45f18687c964b70828), [`63f7eda`](https://github.com/mastra-ai/mastra/commit/63f7eda605eb3e0c8c35ee3912ffe7c999c69f69), [`a5b67a3`](https://github.com/mastra-ai/mastra/commit/a5b67a3589a74415feb663a55d1858324a2afde9), [`877b02c`](https://github.com/mastra-ai/mastra/commit/877b02cdbb15e199184c7f2b8f217be8d3ebada7), [`eb36bd8`](https://github.com/mastra-ai/mastra/commit/eb36bd8c52fcd6ec9674ac3b7a6412405b5983e1), [`3cbf121`](https://github.com/mastra-ai/mastra/commit/3cbf121f55418141924754a83102aade89835947)]:
|
|
55
|
+
- @mastra/core@0.0.0-parallel-workflow-20260212235652
|
|
56
|
+
|
|
57
|
+
## 1.3.0
|
|
4
58
|
|
|
5
59
|
### Minor Changes
|
|
6
60
|
|
|
7
|
-
-
|
|
61
|
+
- **Updated storage adapters for generic storage domain API** ([#12846](https://github.com/mastra-ai/mastra/pull/12846))
|
|
62
|
+
|
|
63
|
+
All storage adapters now implement the unified `VersionedStorageDomain` method names. Entity-specific methods (`createAgent`, `getAgentById`, `deleteAgent`, etc.) have been replaced with generic equivalents (`create`, `getById`, `delete`, etc.) across agents, prompt blocks, and scorer definitions domains.
|
|
64
|
+
|
|
65
|
+
Added `scorer-definitions` domain support to all adapters.
|
|
66
|
+
|
|
67
|
+
**Before:**
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
const store = storage.getStore('agents');
|
|
71
|
+
await store.createAgent({ agent: input });
|
|
72
|
+
await store.getAgentById({ id: 'abc' });
|
|
73
|
+
await store.deleteAgent({ id: 'abc' });
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**After:**
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
const store = storage.getStore('agents');
|
|
80
|
+
await store.create({ agent: input });
|
|
81
|
+
await store.getById('abc');
|
|
82
|
+
await store.delete('abc');
|
|
83
|
+
```
|
|
8
84
|
|
|
9
85
|
### Patch Changes
|
|
10
86
|
|
|
11
|
-
-
|
|
87
|
+
- Fixed observational memory progress bars resetting to zero after agent responses finish. ([#12934](https://github.com/mastra-ai/mastra/pull/12934))
|
|
12
88
|
|
|
13
|
-
|
|
14
|
-
- `observation.bufferTokens` — Token interval for triggering background observation buffering (e.g., `6000` buffers every 6k tokens)
|
|
15
|
-
- `observation.bufferActivation` — Ratio of the message token threshold to activate when buffered observations are applied (0-1 float, e.g., `0.6` activates 60% of the threshold worth of message tokens)
|
|
16
|
-
- `observation.blockAfter` — Token count (or 1.x multiplier of the threshold) at which synchronous observation blocks the response. Defaults to 1.2x when async buffering is enabled
|
|
17
|
-
- `reflection.bufferActivation` — Same as observation but for reflections. Background reflection runs when observation tokens cross the activation point
|
|
18
|
-
- `reflection.blockAfter` — Same as observation but for reflections
|
|
89
|
+
- Fixed issues with stored agents ([#12790](https://github.com/mastra-ai/mastra/pull/12790))
|
|
19
90
|
|
|
20
|
-
|
|
91
|
+
- Supporting changes for async buffering in observational memory, including new config options, streaming events, and UI markers. ([#12891](https://github.com/mastra-ai/mastra/pull/12891))
|
|
92
|
+
|
|
93
|
+
- Added prompt block storage implementations. Each store supports full CRUD for prompt blocks and their versions, including JSON serialization for rules and metadata. Also updated agent instructions serialization to support the new `AgentInstructionBlock` array format alongside plain strings. ([#12776](https://github.com/mastra-ai/mastra/pull/12776))
|
|
94
|
+
|
|
95
|
+
- Updated dependencies [[`717ffab`](https://github.com/mastra-ai/mastra/commit/717ffab42cfd58ff723b5c19ada4939997773004), [`b31c922`](https://github.com/mastra-ai/mastra/commit/b31c922215b513791d98feaea1b98784aa00803a), [`e4b6dab`](https://github.com/mastra-ai/mastra/commit/e4b6dab171c5960e340b3ea3ea6da8d64d2b8672), [`5719fa8`](https://github.com/mastra-ai/mastra/commit/5719fa8880e86e8affe698ec4b3807c7e0e0a06f), [`83cda45`](https://github.com/mastra-ai/mastra/commit/83cda4523e588558466892bff8f80f631a36945a), [`11804ad`](https://github.com/mastra-ai/mastra/commit/11804adf1d6be46ebe216be40a43b39bb8b397d7), [`aa95f95`](https://github.com/mastra-ai/mastra/commit/aa95f958b186ae5c9f4219c88e268f5565c277a2), [`90f7894`](https://github.com/mastra-ai/mastra/commit/90f7894568dc9481f40a4d29672234fae23090bb), [`f5501ae`](https://github.com/mastra-ai/mastra/commit/f5501aedb0a11106c7db7e480d6eaf3971b7bda8), [`44573af`](https://github.com/mastra-ai/mastra/commit/44573afad0a4bc86f627d6cbc0207961cdcb3bc3), [`00e3861`](https://github.com/mastra-ai/mastra/commit/00e3861863fbfee78faeb1ebbdc7c0223aae13ff), [`8109aee`](https://github.com/mastra-ai/mastra/commit/8109aeeab758e16cd4255a6c36f044b70eefc6a6), [`7bfbc52`](https://github.com/mastra-ai/mastra/commit/7bfbc52a8604feb0fff2c0a082c13c0c2a3df1a2), [`1445994`](https://github.com/mastra-ai/mastra/commit/1445994aee19c9334a6a101cf7bd80ca7ed4d186), [`61f44a2`](https://github.com/mastra-ai/mastra/commit/61f44a26861c89e364f367ff40825bdb7f19df55), [`37145d2`](https://github.com/mastra-ai/mastra/commit/37145d25f99dc31f1a9105576e5452609843ce32), [`fdad759`](https://github.com/mastra-ai/mastra/commit/fdad75939ff008b27625f5ec0ce9c6915d99d9ec), [`e4569c5`](https://github.com/mastra-ai/mastra/commit/e4569c589e00c4061a686c9eb85afe1b7050b0a8), [`7309a85`](https://github.com/mastra-ai/mastra/commit/7309a85427281a8be23f4fb80ca52e18eaffd596), [`99424f6`](https://github.com/mastra-ai/mastra/commit/99424f6862ffb679c4ec6765501486034754a4c2), [`44eb452`](https://github.com/mastra-ai/mastra/commit/44eb4529b10603c279688318bebf3048543a1d61), [`6c40593`](https://github.com/mastra-ai/mastra/commit/6c40593d6d2b1b68b0c45d1a3a4c6ac5ecac3937), [`8c1135d`](https://github.com/mastra-ai/mastra/commit/8c1135dfb91b057283eae7ee11f9ec28753cc64f), [`dd39e54`](https://github.com/mastra-ai/mastra/commit/dd39e54ea34532c995b33bee6e0e808bf41a7341), [`b6fad9a`](https://github.com/mastra-ai/mastra/commit/b6fad9a602182b1cc0df47cd8c55004fa829ad61), [`4129c07`](https://github.com/mastra-ai/mastra/commit/4129c073349b5a66643fd8136ebfe9d7097cf793), [`5b930ab`](https://github.com/mastra-ai/mastra/commit/5b930aba1834d9898e8460a49d15106f31ac7c8d), [`4be93d0`](https://github.com/mastra-ai/mastra/commit/4be93d09d68e20aaf0ea3f210749422719618b5f), [`047635c`](https://github.com/mastra-ai/mastra/commit/047635ccd7861d726c62d135560c0022a5490aec), [`8c90ff4`](https://github.com/mastra-ai/mastra/commit/8c90ff4d3414e7f2a2d216ea91274644f7b29133), [`ed232d1`](https://github.com/mastra-ai/mastra/commit/ed232d1583f403925dc5ae45f7bee948cf2a182b), [`3891795`](https://github.com/mastra-ai/mastra/commit/38917953518eb4154a984ee36e6ededdcfe80f72), [`4f955b2`](https://github.com/mastra-ai/mastra/commit/4f955b20c7f66ed282ee1fd8709696fa64c4f19d), [`55a4c90`](https://github.com/mastra-ai/mastra/commit/55a4c9044ac7454349b9f6aeba0bbab5ee65d10f)]:
|
|
96
|
+
- @mastra/core@1.3.0
|
|
97
|
+
|
|
98
|
+
## 1.3.0-alpha.1
|
|
99
|
+
|
|
100
|
+
### Patch Changes
|
|
101
|
+
|
|
102
|
+
- Fixed observational memory progress bars resetting to zero after agent responses finish. The messages and observations sidebar bars now retain their values on stream completion, cancellation, and page reload. Also added a buffer-status endpoint so buffering badges resolve with accurate token counts instead of spinning forever when buffering outlives the stream. ([#12934](https://github.com/mastra-ai/mastra/pull/12934))
|
|
103
|
+
|
|
104
|
+
- Updated dependencies [[`b31c922`](https://github.com/mastra-ai/mastra/commit/b31c922215b513791d98feaea1b98784aa00803a)]:
|
|
105
|
+
- @mastra/core@1.3.0-alpha.2
|
|
106
|
+
|
|
107
|
+
## 1.3.0-alpha.0
|
|
108
|
+
|
|
109
|
+
### Minor Changes
|
|
110
|
+
|
|
111
|
+
- **Updated storage adapters for generic storage domain API** ([#12846](https://github.com/mastra-ai/mastra/pull/12846))
|
|
112
|
+
|
|
113
|
+
All storage adapters now implement the unified `VersionedStorageDomain` method names. Entity-specific methods (`createAgent`, `getAgentById`, `deleteAgent`, etc.) have been replaced with generic equivalents (`create`, `getById`, `delete`, etc.) across agents, prompt blocks, and scorer definitions domains.
|
|
114
|
+
|
|
115
|
+
Added `scorer-definitions` domain support to all adapters.
|
|
116
|
+
|
|
117
|
+
**Before:**
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
const store = storage.getStore('agents');
|
|
121
|
+
await store.createAgent({ agent: input });
|
|
122
|
+
await store.getAgentById({ id: 'abc' });
|
|
123
|
+
await store.deleteAgent({ id: 'abc' });
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**After:**
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
const store = storage.getStore('agents');
|
|
130
|
+
await store.create({ agent: input });
|
|
131
|
+
await store.getById('abc');
|
|
132
|
+
await store.delete('abc');
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Patch Changes
|
|
136
|
+
|
|
137
|
+
- Fixed issues with stored agents ([#12790](https://github.com/mastra-ai/mastra/pull/12790))
|
|
138
|
+
|
|
139
|
+
- **Async buffering for observational memory is now enabled by default.** Observations are pre-computed in the background as conversations grow — when the context window fills up, buffered observations activate instantly with no blocking LLM call. This keeps agents responsive during long conversations. ([#12891](https://github.com/mastra-ai/mastra/pull/12891))
|
|
140
|
+
|
|
141
|
+
**Default settings:**
|
|
142
|
+
- `observation.bufferTokens: 0.2` — buffer every 20% of `messageTokens` (~6k tokens with the default 30k threshold)
|
|
143
|
+
- `observation.bufferActivation: 0.8` — on activation, retain 20% of the message window
|
|
144
|
+
- `reflection.bufferActivation: 0.5` — start background reflection at 50% of the observation threshold
|
|
145
|
+
|
|
146
|
+
**Disabling async buffering:**
|
|
147
|
+
|
|
148
|
+
Set `observation.bufferTokens: false` to disable async buffering for both observations and reflections:
|
|
21
149
|
|
|
22
150
|
```ts
|
|
23
151
|
const memory = new Memory({
|
|
24
|
-
storage: new LibSQLStore({ url: 'file:memory.db' }),
|
|
25
152
|
options: {
|
|
26
153
|
observationalMemory: {
|
|
154
|
+
model: 'google/gemini-2.5-flash',
|
|
27
155
|
observation: {
|
|
28
|
-
|
|
29
|
-
bufferTokens: 6_000,
|
|
30
|
-
bufferActivation: 0.6,
|
|
31
|
-
blockAfter: 1.5,
|
|
32
|
-
},
|
|
33
|
-
reflection: {
|
|
34
|
-
observationTokens: 5_000,
|
|
35
|
-
bufferActivation: 0.5,
|
|
36
|
-
blockAfter: 1.2,
|
|
156
|
+
bufferTokens: false,
|
|
37
157
|
},
|
|
38
158
|
},
|
|
39
159
|
},
|
|
40
160
|
});
|
|
41
161
|
```
|
|
42
162
|
|
|
163
|
+
**Model is now required** when passing an observational memory config object. Use `observationalMemory: true` for the default (google/gemini-2.5-flash), or set a model explicitly:
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
// Uses default model (google/gemini-2.5-flash)
|
|
167
|
+
observationalMemory: true
|
|
168
|
+
|
|
169
|
+
// Explicit model
|
|
170
|
+
observationalMemory: {
|
|
171
|
+
model: "google/gemini-2.5-flash",
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**`shareTokenBudget` requires `bufferTokens: false`** (temporary limitation). If you use `shareTokenBudget: true`, you must explicitly disable async buffering:
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
observationalMemory: {
|
|
179
|
+
model: "google/gemini-2.5-flash",
|
|
180
|
+
shareTokenBudget: true,
|
|
181
|
+
observation: { bufferTokens: false },
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
43
185
|
**New streaming event:** `data-om-status` replaces `data-om-progress` with a structured status object containing active window usage, buffered observation/reflection state, and projected activation impact.
|
|
44
186
|
|
|
45
187
|
**Buffering markers:** New `data-om-buffering-start`, `data-om-buffering-end`, and `data-om-buffering-failed` streaming events for UI feedback during background operations.
|
|
46
188
|
|
|
47
|
-
-
|
|
48
|
-
|
|
189
|
+
- Added prompt block storage implementations. Each store supports full CRUD for prompt blocks and their versions, including JSON serialization for rules and metadata. Also updated agent instructions serialization to support the new `AgentInstructionBlock` array format alongside plain strings. ([#12776](https://github.com/mastra-ai/mastra/pull/12776))
|
|
190
|
+
|
|
191
|
+
- Updated dependencies [[`717ffab`](https://github.com/mastra-ai/mastra/commit/717ffab42cfd58ff723b5c19ada4939997773004), [`e4b6dab`](https://github.com/mastra-ai/mastra/commit/e4b6dab171c5960e340b3ea3ea6da8d64d2b8672), [`5719fa8`](https://github.com/mastra-ai/mastra/commit/5719fa8880e86e8affe698ec4b3807c7e0e0a06f), [`83cda45`](https://github.com/mastra-ai/mastra/commit/83cda4523e588558466892bff8f80f631a36945a), [`11804ad`](https://github.com/mastra-ai/mastra/commit/11804adf1d6be46ebe216be40a43b39bb8b397d7), [`aa95f95`](https://github.com/mastra-ai/mastra/commit/aa95f958b186ae5c9f4219c88e268f5565c277a2), [`f5501ae`](https://github.com/mastra-ai/mastra/commit/f5501aedb0a11106c7db7e480d6eaf3971b7bda8), [`44573af`](https://github.com/mastra-ai/mastra/commit/44573afad0a4bc86f627d6cbc0207961cdcb3bc3), [`00e3861`](https://github.com/mastra-ai/mastra/commit/00e3861863fbfee78faeb1ebbdc7c0223aae13ff), [`7bfbc52`](https://github.com/mastra-ai/mastra/commit/7bfbc52a8604feb0fff2c0a082c13c0c2a3df1a2), [`1445994`](https://github.com/mastra-ai/mastra/commit/1445994aee19c9334a6a101cf7bd80ca7ed4d186), [`61f44a2`](https://github.com/mastra-ai/mastra/commit/61f44a26861c89e364f367ff40825bdb7f19df55), [`37145d2`](https://github.com/mastra-ai/mastra/commit/37145d25f99dc31f1a9105576e5452609843ce32), [`fdad759`](https://github.com/mastra-ai/mastra/commit/fdad75939ff008b27625f5ec0ce9c6915d99d9ec), [`e4569c5`](https://github.com/mastra-ai/mastra/commit/e4569c589e00c4061a686c9eb85afe1b7050b0a8), [`7309a85`](https://github.com/mastra-ai/mastra/commit/7309a85427281a8be23f4fb80ca52e18eaffd596), [`99424f6`](https://github.com/mastra-ai/mastra/commit/99424f6862ffb679c4ec6765501486034754a4c2), [`44eb452`](https://github.com/mastra-ai/mastra/commit/44eb4529b10603c279688318bebf3048543a1d61), [`6c40593`](https://github.com/mastra-ai/mastra/commit/6c40593d6d2b1b68b0c45d1a3a4c6ac5ecac3937), [`8c1135d`](https://github.com/mastra-ai/mastra/commit/8c1135dfb91b057283eae7ee11f9ec28753cc64f), [`dd39e54`](https://github.com/mastra-ai/mastra/commit/dd39e54ea34532c995b33bee6e0e808bf41a7341), [`b6fad9a`](https://github.com/mastra-ai/mastra/commit/b6fad9a602182b1cc0df47cd8c55004fa829ad61), [`4129c07`](https://github.com/mastra-ai/mastra/commit/4129c073349b5a66643fd8136ebfe9d7097cf793), [`5b930ab`](https://github.com/mastra-ai/mastra/commit/5b930aba1834d9898e8460a49d15106f31ac7c8d), [`4be93d0`](https://github.com/mastra-ai/mastra/commit/4be93d09d68e20aaf0ea3f210749422719618b5f), [`047635c`](https://github.com/mastra-ai/mastra/commit/047635ccd7861d726c62d135560c0022a5490aec), [`8c90ff4`](https://github.com/mastra-ai/mastra/commit/8c90ff4d3414e7f2a2d216ea91274644f7b29133), [`ed232d1`](https://github.com/mastra-ai/mastra/commit/ed232d1583f403925dc5ae45f7bee948cf2a182b), [`3891795`](https://github.com/mastra-ai/mastra/commit/38917953518eb4154a984ee36e6ededdcfe80f72), [`4f955b2`](https://github.com/mastra-ai/mastra/commit/4f955b20c7f66ed282ee1fd8709696fa64c4f19d), [`55a4c90`](https://github.com/mastra-ai/mastra/commit/55a4c9044ac7454349b9f6aeba0bbab5ee65d10f)]:
|
|
192
|
+
- @mastra/core@1.3.0-alpha.1
|
|
49
193
|
|
|
50
194
|
## 1.2.0
|
|
51
195
|
|
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: "
|
|
6
|
+
version: "0.0.0-parallel-workflow-20260212235652"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Agents use memory to maintain context across interactions. LLMs are stateless and don't retain information between calls, so agents need memory to track message history and recall relevant information.
|
|
4
4
|
|
|
5
|
-
Mastra agents can be configured to store message history, with optional [working memory](https://mastra.ai/docs/memory/working-memory) to maintain recent context
|
|
5
|
+
Mastra agents can be configured to store message history, with optional [working memory](https://mastra.ai/docs/memory/working-memory) to maintain recent context, [semantic recall](https://mastra.ai/docs/memory/semantic-recall) to retrieve past messages based on meaning, or [observational memory](https://mastra.ai/docs/memory/observational-memory) for automatic long-term memory that compresses conversations as they grow.
|
|
6
6
|
|
|
7
7
|
## When to use memory
|
|
8
8
|
|
|
@@ -134,6 +134,49 @@ const response = await memoryAgent.generate("What's my favorite color?", {
|
|
|
134
134
|
|
|
135
135
|
To learn more about memory see the [Memory](https://mastra.ai/docs/memory/overview) documentation.
|
|
136
136
|
|
|
137
|
+
## Observational Memory
|
|
138
|
+
|
|
139
|
+
For long-running conversations, raw message history grows until it fills the context window, degrading agent performance. [Observational Memory](https://mastra.ai/docs/memory/observational-memory) solves this by running background agents that compress old messages into dense observations, keeping the context window small while preserving long-term memory.
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
import { Agent } from "@mastra/core/agent";
|
|
143
|
+
import { Memory } from "@mastra/memory";
|
|
144
|
+
|
|
145
|
+
export const memoryAgent = new Agent({
|
|
146
|
+
id: 'memory-agent',
|
|
147
|
+
name: 'Memory Agent',
|
|
148
|
+
memory: new Memory({
|
|
149
|
+
options: {
|
|
150
|
+
observationalMemory: true,
|
|
151
|
+
},
|
|
152
|
+
}),
|
|
153
|
+
});
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Setting `observationalMemory: true` uses `google/gemini-2.5-flash` as the default model for the Observer and Reflector. To use a different model or customize thresholds, pass a config object:
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
import { Agent } from "@mastra/core/agent";
|
|
160
|
+
import { Memory } from "@mastra/memory";
|
|
161
|
+
|
|
162
|
+
export const memoryAgent = new Agent({
|
|
163
|
+
id: 'memory-agent',
|
|
164
|
+
name: 'Memory Agent',
|
|
165
|
+
memory: new Memory({
|
|
166
|
+
options: {
|
|
167
|
+
observationalMemory: {
|
|
168
|
+
model: "deepseek/deepseek-reasoner",
|
|
169
|
+
observation: {
|
|
170
|
+
messageTokens: 20_000,
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
}),
|
|
175
|
+
});
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
> **Info:** See [Observational Memory](https://mastra.ai/docs/memory/observational-memory) for details on how observations and reflections work, and [the reference](https://mastra.ai/reference/memory/observational-memory) for all configuration options.
|
|
179
|
+
|
|
137
180
|
## Using `RequestContext`
|
|
138
181
|
|
|
139
182
|
Use [RequestContext](https://mastra.ai/docs/server/request-context) to access request-specific values. This lets you conditionally select different memory or storage configurations based on the context of the request.
|
|
@@ -162,6 +205,7 @@ export const memoryAgent = new Agent({
|
|
|
162
205
|
|
|
163
206
|
## Related
|
|
164
207
|
|
|
208
|
+
- [Observational Memory](https://mastra.ai/docs/memory/observational-memory)
|
|
165
209
|
- [Working Memory](https://mastra.ai/docs/memory/working-memory)
|
|
166
210
|
- [Semantic Recall](https://mastra.ai/docs/memory/semantic-recall)
|
|
167
211
|
- [Storage](https://mastra.ai/docs/memory/storage)
|
|
@@ -57,7 +57,7 @@ export const mastra = new Mastra({
|
|
|
57
57
|
});
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
> **Serverless environments:** The `file:./mastra.db` storage URL uses the local filesystem, which doesn't work in serverless environments like Vercel, AWS Lambda, or Cloudflare Workers. For serverless deployments, use external storage. See the [Vercel deployment guide](https://mastra.ai/guides/deployment/vercel
|
|
60
|
+
> **Serverless environments:** The `file:./mastra.db` storage URL uses the local filesystem, which doesn't work in serverless environments like Vercel, AWS Lambda, or Cloudflare Workers. For serverless deployments, use external storage. See the [Vercel deployment guide](https://mastra.ai/guides/deployment/vercel) for a complete example.
|
|
61
61
|
|
|
62
62
|
With this basic setup, you will see Traces and Logs in both Studio and in Mastra Cloud.
|
|
63
63
|
|
|
@@ -83,9 +83,11 @@ const storage = new LibSQLStore({
|
|
|
83
83
|
});
|
|
84
84
|
await storage.init();
|
|
85
85
|
|
|
86
|
+
const memoryStorage = await storage.getStore('memory');
|
|
87
|
+
|
|
86
88
|
const model = withMastra(openai('gpt-4o'), {
|
|
87
89
|
memory: {
|
|
88
|
-
storage
|
|
90
|
+
storage: memoryStorage!,
|
|
89
91
|
threadId: 'user-thread-123',
|
|
90
92
|
resourceId: 'user-123',
|
|
91
93
|
lastMessages: 10,
|
|
@@ -111,11 +113,13 @@ import { LibSQLStore } from '@mastra/libsql';
|
|
|
111
113
|
const storage = new LibSQLStore({ id: 'my-app', url: 'file:./data.db' });
|
|
112
114
|
await storage.init();
|
|
113
115
|
|
|
116
|
+
const memoryStorage = await storage.getStore('memory');
|
|
117
|
+
|
|
114
118
|
const model = withMastra(openai('gpt-4o'), {
|
|
115
119
|
inputProcessors: [myGuardProcessor],
|
|
116
120
|
outputProcessors: [myLoggingProcessor],
|
|
117
121
|
memory: {
|
|
118
|
-
storage
|
|
122
|
+
storage: memoryStorage!,
|
|
119
123
|
threadId: 'thread-123',
|
|
120
124
|
resourceId: 'user-123',
|
|
121
125
|
lastMessages: 10,
|