@mastra/libsql 1.27.0-alpha.4 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/docs/SKILL.md
CHANGED
|
@@ -28,13 +28,15 @@ Retrieves message history and persists new messages.
|
|
|
28
28
|
|
|
29
29
|
```typescript
|
|
30
30
|
memory: new Memory({
|
|
31
|
-
|
|
31
|
+
options: {
|
|
32
|
+
lastMessages: 10,
|
|
33
|
+
},
|
|
32
34
|
})
|
|
33
35
|
```
|
|
34
36
|
|
|
35
37
|
**Mastra internally:**
|
|
36
38
|
|
|
37
|
-
1. Creates a `MessageHistory` processor with `
|
|
39
|
+
1. Creates a `MessageHistory` processor with `lastMessages: 10`
|
|
38
40
|
2. Adds it to the agent's input processors (runs before the LLM)
|
|
39
41
|
3. Adds it to the agent's output processors (runs after the LLM)
|
|
40
42
|
|
|
@@ -61,7 +63,9 @@ const agent = new Agent({
|
|
|
61
63
|
id: 'memory-store',
|
|
62
64
|
url: 'file:memory.db',
|
|
63
65
|
}),
|
|
64
|
-
|
|
66
|
+
options: {
|
|
67
|
+
lastMessages: 10, // MessageHistory processor automatically added
|
|
68
|
+
},
|
|
65
69
|
}),
|
|
66
70
|
})
|
|
67
71
|
```
|
|
@@ -85,7 +89,7 @@ memory: new Memory({
|
|
|
85
89
|
1. Creates a `SemanticRecall` processor
|
|
86
90
|
2. Adds it to the agent's input processors (runs before the LLM)
|
|
87
91
|
3. Adds it to the agent's output processors (runs after the LLM)
|
|
88
|
-
4. Requires
|
|
92
|
+
4. Requires a vector store, plus an embedder unless the vector store generates embeddings itself
|
|
89
93
|
|
|
90
94
|
**What it does:**
|
|
91
95
|
|
|
@@ -190,7 +194,9 @@ const agent = new Agent({
|
|
|
190
194
|
model: 'openai/gpt-5.6-sol',
|
|
191
195
|
memory: new Memory({
|
|
192
196
|
storage: new LibSQLStore({ id: 'memory-store', url: 'file:memory.db' }),
|
|
193
|
-
|
|
197
|
+
options: {
|
|
198
|
+
lastMessages: 10, // This would normally add MessageHistory(10)
|
|
199
|
+
},
|
|
194
200
|
}),
|
|
195
201
|
inputProcessors: [
|
|
196
202
|
customMessageHistory, // Your custom one is used instead
|
|
@@ -259,7 +265,7 @@ const agent = new Agent({
|
|
|
259
265
|
name: 'safe-agent',
|
|
260
266
|
instructions: 'You are a helpful assistant',
|
|
261
267
|
model: 'openai/gpt-5.6-sol',
|
|
262
|
-
memory: new Memory({ lastMessages: 10 }),
|
|
268
|
+
memory: new Memory({ options: { lastMessages: 10 } }),
|
|
263
269
|
// Your guardrail runs BEFORE memory saves
|
|
264
270
|
outputProcessors: [contentBlocker],
|
|
265
271
|
})
|
|
@@ -299,7 +305,7 @@ const agent = new Agent({
|
|
|
299
305
|
name: 'validated-agent',
|
|
300
306
|
instructions: 'You are a helpful assistant',
|
|
301
307
|
model: 'openai/gpt-5.6-sol',
|
|
302
|
-
memory: new Memory({ lastMessages: 10 }),
|
|
308
|
+
memory: new Memory({ options: { lastMessages: 10 } }),
|
|
303
309
|
// Your guardrail runs AFTER memory loads history
|
|
304
310
|
inputProcessors: [inputValidator],
|
|
305
311
|
})
|
|
@@ -376,7 +382,7 @@ export const supportAgent = new Agent({
|
|
|
376
382
|
name: 'Support agent',
|
|
377
383
|
instructions: 'Answer customer support questions.',
|
|
378
384
|
model: 'openai/gpt-5.6-sol',
|
|
379
|
-
memory: new Memory({ lastMessages: 10 }),
|
|
385
|
+
memory: new Memory({ options: { lastMessages: 10 } }),
|
|
380
386
|
inputProcessors: [new AttachmentUploader()],
|
|
381
387
|
})
|
|
382
388
|
```
|
|
@@ -217,7 +217,7 @@ const paragraphMemory = new Memory({
|
|
|
217
217
|
|
|
218
218
|
Working memory can also be defined using a structured schema instead of a Markdown template. A [Standard JSON Schema](https://standardschema.dev/json-schema) ([Zod](https://zod.dev/), [Valibot](https://valibot.dev/), [ArkType](https://arktype.io/), etc.). When using a schema, the agent will see and update working memory as a JSON object matching your schema.
|
|
219
219
|
|
|
220
|
-
|
|
220
|
+
You can specify either `template` or `schema`, but not both. If you omit both, Mastra uses the default working memory template.
|
|
221
221
|
|
|
222
222
|
### Example: Schema-Based Working Memory
|
|
223
223
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/libsql",
|
|
3
|
-
"version": "1.27.0
|
|
3
|
+
"version": "1.27.0",
|
|
4
4
|
"description": "Libsql provider for Mastra - includes both vector and db storage capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"tsx": "^4.23.1",
|
|
32
32
|
"typescript": "^7.0.2",
|
|
33
33
|
"vitest": "4.1.11",
|
|
34
|
-
"@internal/
|
|
35
|
-
"@internal/
|
|
36
|
-
"@internal/
|
|
37
|
-
"@internal/
|
|
38
|
-
"@mastra/
|
|
39
|
-
"@mastra/
|
|
34
|
+
"@internal/core": "0.1.3",
|
|
35
|
+
"@internal/storage-test-utils": "0.0.141",
|
|
36
|
+
"@internal/types-builder": "0.0.120",
|
|
37
|
+
"@internal/lint": "0.0.145",
|
|
38
|
+
"@mastra/pg": "1.32.0",
|
|
39
|
+
"@mastra/core": "1.79.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@mastra/core": ">=1.76.0-0 <2.0.0-0"
|