@mastra/libsql 1.25.0 → 1.25.1
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 +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-memory-semantic-recall.md +35 -1
- package/dist/docs/references/docs-storage.md +1 -0
- package/dist/docs/references/reference-file-based-agents-memory.md +0 -2
- package/dist/docs/references/reference-file-based-agents-storage.md +0 -2
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/schedules/index.d.ts +2 -2
- package/dist/storage/domains/schedules/index.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/docs/SKILL.md
CHANGED
|
@@ -20,7 +20,7 @@ After getting a response from the LLM, all new messages (user, assistant, and to
|
|
|
20
20
|
|
|
21
21
|
## Quickstart
|
|
22
22
|
|
|
23
|
-
Semantic recall is disabled by default. To enable it, set `semanticRecall: true` in `options` and provide a `vector` store and `embedder
|
|
23
|
+
Semantic recall is disabled by default. To enable it, set `semanticRecall: true` in `options` and provide a `vector` store and an `embedder`. A store that generates embeddings itself, such as MongoDB with Automated Embedding, works without one. See [Server-side embeddings](#server-side-embeddings).
|
|
24
24
|
|
|
25
25
|
**LibSQL**:
|
|
26
26
|
|
|
@@ -242,6 +242,40 @@ const options = {
|
|
|
242
242
|
}
|
|
243
243
|
```
|
|
244
244
|
|
|
245
|
+
## Server-side embeddings
|
|
246
|
+
|
|
247
|
+
Some vector stores generate the embeddings themselves. With one of those, semantic recall runs without an `embedder`: the database embeds each message on write and the search string on arrival. The embedding provider stays out of your application entirely.
|
|
248
|
+
|
|
249
|
+
MongoDB does this through [Automated Embedding](https://mastra.ai/reference/vectors/mongodb): name a Voyage AI model on the vector store and leave the `embedder` out.
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
import { Memory } from '@mastra/memory'
|
|
253
|
+
import { MongoDBStore, MongoDBVector } from '@mastra/mongodb'
|
|
254
|
+
|
|
255
|
+
const memory = new Memory({
|
|
256
|
+
storage: new MongoDBStore({
|
|
257
|
+
id: 'agent-storage',
|
|
258
|
+
uri: process.env.MONGODB_URI,
|
|
259
|
+
dbName: process.env.MONGODB_DB_NAME,
|
|
260
|
+
}),
|
|
261
|
+
vector: new MongoDBVector({
|
|
262
|
+
id: 'agent-vector',
|
|
263
|
+
uri: process.env.MONGODB_URI,
|
|
264
|
+
dbName: process.env.MONGODB_DB_NAME,
|
|
265
|
+
autoEmbed: { model: 'voyage-4' },
|
|
266
|
+
}),
|
|
267
|
+
options: {
|
|
268
|
+
semanticRecall: { topK: 3, messageRange: 2 },
|
|
269
|
+
},
|
|
270
|
+
})
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Messages are stored as text and MongoDB embeds them, so the model choice and the vector size belong to the index rather than to your application. Recall works the same way through an agent and through [`recall()`](#using-the-recall-method).
|
|
274
|
+
|
|
275
|
+
MongoDB embeds newly written messages in the background. A message saved moments ago may not be recallable immediately.
|
|
276
|
+
|
|
277
|
+
Every other store expects your application to supply the vectors, and keeps requiring an `embedder`. Enabling semantic recall with neither an `embedder` nor a store that embeds server-side raises an error naming both options.
|
|
278
|
+
|
|
245
279
|
## Embedder configuration
|
|
246
280
|
|
|
247
281
|
Semantic recall relies on an [embedding model](https://mastra.ai/reference/memory/memory-class) to convert messages into embeddings. Mastra supports embedding models through the model router using `provider/model` strings, or you can use any [embedding model](https://sdk.vercel.ai/docs/ai-sdk-core/embeddings) compatible with the AI SDK.
|
|
@@ -194,6 +194,7 @@ Each provider page includes installation instructions, configuration parameters,
|
|
|
194
194
|
|
|
195
195
|
- [Aurora DSQL](https://mastra.ai/integrations/databases/aurora-dsql)
|
|
196
196
|
- [ClickHouse](https://mastra.ai/integrations/databases/clickhouse)
|
|
197
|
+
- [ClickHouse Managed Postgres](https://mastra.ai/integrations/databases/clickhouse-managed-postgres)
|
|
197
198
|
- [Cloudflare D1](https://mastra.ai/integrations/databases/cloudflare-d1)
|
|
198
199
|
- [Cloudflare KV](https://mastra.ai/integrations/databases/cloudflare-kv)
|
|
199
200
|
- [Convex](https://mastra.ai/integrations/databases/convex)
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
# Memory
|
|
6
6
|
|
|
7
|
-
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
8
|
-
|
|
9
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.
|
|
10
8
|
|
|
11
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.
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
# Storage
|
|
6
6
|
|
|
7
|
-
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
8
|
-
|
|
9
7
|
Mastra sets the project's default [storage](https://mastra.ai/docs/storage) 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.
|
|
10
8
|
|
|
11
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).
|
package/dist/index.cjs
CHANGED
|
@@ -11455,16 +11455,17 @@ var SchedulesLibSQL = class SchedulesLibSQL extends _mastra_core_storage.Schedul
|
|
|
11455
11455
|
if (!updated) throw new Error(`Schedule ${id} not found`);
|
|
11456
11456
|
return updated;
|
|
11457
11457
|
}
|
|
11458
|
-
async updateScheduleNextFire(id, expectedNextFireAt, newNextFireAt, lastFireAt, lastRunId) {
|
|
11458
|
+
async updateScheduleNextFire(id, expectedNextFireAt, newNextFireAt, lastFireAt, lastRunId, newStatus) {
|
|
11459
11459
|
return ((await this.#client.execute({
|
|
11460
11460
|
sql: `UPDATE ${_mastra_core_storage.TABLE_SCHEDULES}
|
|
11461
|
-
SET next_fire_at = ?, last_fire_at = ?, last_run_id = ?, updated_at =
|
|
11461
|
+
SET next_fire_at = ?, last_fire_at = ?, last_run_id = ?, updated_at = ?, status = COALESCE(?, status)
|
|
11462
11462
|
WHERE id = ? AND next_fire_at = ? AND status = ?`,
|
|
11463
11463
|
args: [
|
|
11464
11464
|
newNextFireAt,
|
|
11465
11465
|
lastFireAt,
|
|
11466
11466
|
lastRunId,
|
|
11467
11467
|
Date.now(),
|
|
11468
|
+
newStatus ?? null,
|
|
11468
11469
|
id,
|
|
11469
11470
|
expectedNextFireAt,
|
|
11470
11471
|
"active"
|