@mastra/libsql 1.7.3-alpha.3 → 1.7.4-alpha.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/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @mastra/libsql
2
2
 
3
+ ## 1.7.4-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Added expectedTrajectory support to dataset items across all storage backends and API layer. Dataset items can now store trajectory expectations that define expected agent execution steps, ordering, and constraints for trajectory-based evaluation scoring. ([#14902](https://github.com/mastra-ai/mastra/pull/14902))
8
+
9
+ - Updated dependencies [[`cb15509`](https://github.com/mastra-ai/mastra/commit/cb15509b58f6a83e11b765c945082afc027db972), [`80c5668`](https://github.com/mastra-ai/mastra/commit/80c5668e365470d3a96d3e953868fd7a643ff67c), [`3d478c1`](https://github.com/mastra-ai/mastra/commit/3d478c1e13f17b80f330ac49d7aa42ef929b93ff), [`6039f17`](https://github.com/mastra-ai/mastra/commit/6039f176f9c457304825ff1df8c83b8e457376c0), [`06b928d`](https://github.com/mastra-ai/mastra/commit/06b928dfc2f5630d023467476cc5919dfa858d0a), [`6a8d984`](https://github.com/mastra-ai/mastra/commit/6a8d9841f2933456ee1598099f488d742b600054)]:
10
+ - @mastra/core@1.22.0-alpha.2
11
+
12
+ ## 1.7.3
13
+
14
+ ### Patch Changes
15
+
16
+ - The internal architecture of observational memory has been refactored. The public API and behavior remain unchanged. ([#14453](https://github.com/mastra-ai/mastra/pull/14453))
17
+
18
+ - Add `getReviewSummary()` to experiments storage for aggregating review status counts ([#14649](https://github.com/mastra-ai/mastra/pull/14649))
19
+
20
+ Query experiment results grouped by experiment ID, returning counts of `needs-review`, `reviewed`, and `complete` items in a single query instead of fetching all results client-side.
21
+
22
+ ```ts
23
+ const summary = await storage.experiments.getReviewSummary();
24
+ // [{ experimentId: 'exp-1', needsReview: 3, reviewed: 5, complete: 2, total: 10 }, ...]
25
+ ```
26
+
27
+ - Added `scorerIds` persistence for datasets. The `scorerIds` field is now stored and retrieved correctly when creating or updating datasets. ([#14783](https://github.com/mastra-ai/mastra/pull/14783))
28
+
29
+ - Updated dependencies [[`dc514a8`](https://github.com/mastra-ai/mastra/commit/dc514a83dba5f719172dddfd2c7b858e4943d067), [`e333b77`](https://github.com/mastra-ai/mastra/commit/e333b77e2d76ba57ccec1818e08cebc1993469ff), [`dc9fc19`](https://github.com/mastra-ai/mastra/commit/dc9fc19da4437f6b508cc355f346a8856746a76b), [`60a224d`](https://github.com/mastra-ai/mastra/commit/60a224dd497240e83698cfa5bfd02e3d1d854844), [`fbf22a7`](https://github.com/mastra-ai/mastra/commit/fbf22a7ad86bcb50dcf30459f0d075e51ddeb468), [`f16d92c`](https://github.com/mastra-ai/mastra/commit/f16d92c677a119a135cebcf7e2b9f51ada7a9df4), [`949b7bf`](https://github.com/mastra-ai/mastra/commit/949b7bfd4e40f2b2cba7fef5eb3f108a02cfe938), [`404fea1`](https://github.com/mastra-ai/mastra/commit/404fea13042181f0b0c73a101392ac87c79ceae2), [`ebf5047`](https://github.com/mastra-ai/mastra/commit/ebf5047e825c38a1a356f10b214c1d4260dfcd8d), [`12c647c`](https://github.com/mastra-ai/mastra/commit/12c647cf3a26826eb72d40b42e3c8356ceae16ed), [`d084b66`](https://github.com/mastra-ai/mastra/commit/d084b6692396057e83c086b954c1857d20b58a14), [`79c699a`](https://github.com/mastra-ai/mastra/commit/79c699acf3cd8a77e11c55530431f48eb48456e9), [`62757b6`](https://github.com/mastra-ai/mastra/commit/62757b6db6e8bb86569d23ad0b514178f57053f8), [`675f15b`](https://github.com/mastra-ai/mastra/commit/675f15b7eaeea649158d228ea635be40480c584d), [`b174c63`](https://github.com/mastra-ai/mastra/commit/b174c63a093108d4e53b9bc89a078d9f66202b3f), [`819f03c`](https://github.com/mastra-ai/mastra/commit/819f03c25823373b32476413bd76be28a5d8705a), [`04160ee`](https://github.com/mastra-ai/mastra/commit/04160eedf3130003cf842ad08428c8ff69af4cc1), [`2c27503`](https://github.com/mastra-ai/mastra/commit/2c275032510d131d2cde47f99953abf0fe02c081), [`424a1df`](https://github.com/mastra-ai/mastra/commit/424a1df7bee59abb5c83717a54807fdd674a6224), [`3d70b0b`](https://github.com/mastra-ai/mastra/commit/3d70b0b3524d817173ad870768f259c06d61bd23), [`eef7cb2`](https://github.com/mastra-ai/mastra/commit/eef7cb2abe7ef15951e2fdf792a5095c6c643333), [`260fe12`](https://github.com/mastra-ai/mastra/commit/260fe1295fe7354e39d6def2775e0797a7a277f0), [`12c88a6`](https://github.com/mastra-ai/mastra/commit/12c88a6e32bf982c2fe0c6af62e65a3414519a75), [`43595bf`](https://github.com/mastra-ai/mastra/commit/43595bf7b8df1a6edce7a23b445b5124d2a0b473), [`78670e9`](https://github.com/mastra-ai/mastra/commit/78670e97e76d7422cf7025faf371b2aeafed860d), [`e8a5b0b`](https://github.com/mastra-ai/mastra/commit/e8a5b0b9bc94d12dee4150095512ca27a288d778), [`3b45a13`](https://github.com/mastra-ai/mastra/commit/3b45a138d09d040779c0aba1edbbfc1b57442d23), [`d400e7c`](https://github.com/mastra-ai/mastra/commit/d400e7c8b8d7afa6ba2c71769eace4048e3cef8e), [`f58d1a7`](https://github.com/mastra-ai/mastra/commit/f58d1a7a457588a996c3ecb53201a68f3d28c432), [`a49a929`](https://github.com/mastra-ai/mastra/commit/a49a92904968b4fc67e01effee8c7c8d0464ba85), [`8127d96`](https://github.com/mastra-ai/mastra/commit/8127d96280492e335d49b244501088dfdd59a8f1)]:
30
+ - @mastra/core@1.18.0
31
+
3
32
  ## 1.7.3-alpha.3
4
33
 
5
34
  ### Patch Changes
@@ -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.7.3-alpha.3"
6
+ version: "1.7.4-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -24,8 +24,6 @@ Read the individual reference documents for detailed explanations and code examp
24
24
  - [Semantic recall](references/docs-memory-semantic-recall.md) - Learn how to use semantic recall in Mastra to retrieve relevant messages from past conversations using vector search and embeddings.
25
25
  - [Storage](references/docs-memory-storage.md) - Configure storage for Mastra to persist conversations and other runtime state.
26
26
  - [Working memory](references/docs-memory-working-memory.md) - Learn how to configure working memory in Mastra to store persistent user data, preferences.
27
- - [Observability overview](references/docs-observability-overview.md) - Monitor and debug applications with Mastra's Observability features.
28
- - [Default exporter](references/docs-observability-tracing-exporters-default.md) - Store traces locally for development and debugging
29
27
  - [Retrieval, semantic search, reranking](references/docs-rag-retrieval.md) - Guide on retrieval processes in Mastra's RAG systems, including semantic search, filtering, and re-ranking.
30
28
  - [Snapshots](references/docs-workflows-snapshots.md) - Learn how to save and resume workflow execution state with snapshots in Mastra
31
29
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.7.3-alpha.3",
2
+ "version": "1.7.4-alpha.0",
3
3
  "package": "@mastra/libsql",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -48,7 +48,7 @@ export const mastra = new Mastra({
48
48
  })
49
49
  ```
50
50
 
51
- Give your agent a `Memory`:
51
+ Instantiate a [`Memory`](https://mastra.ai/reference/memory/memory-class) instance in your agent:
52
52
 
53
53
  ```typescript
54
54
  import { Memory } from '@mastra/memory'
@@ -66,7 +66,7 @@ export const agent = new Agent({
66
66
 
67
67
  When you call the agent, messages are automatically saved to the database. You can specify a `threadId`, `resourceId`, and optional `metadata`:
68
68
 
69
- **Generate**:
69
+ **.generate()**:
70
70
 
71
71
  ```typescript
72
72
  await agent.generate('Hello', {
@@ -81,7 +81,7 @@ await agent.generate('Hello', {
81
81
  })
82
82
  ```
83
83
 
84
- **Stream**:
84
+ **.stream()**:
85
85
 
86
86
  ```typescript
87
87
  await agent.stream('Hello', {
@@ -103,12 +103,14 @@ You can use this history in two ways:
103
103
  - **Automatic inclusion** - Mastra automatically fetches and includes recent messages in the context window. By default, it includes the last 10 messages, keeping agents grounded in the conversation. You can adjust this number with `lastMessages`, but in most cases you don't need to think about it.
104
104
  - [**Manual querying**](#querying) - For more control, use the `recall()` function to query threads and messages directly. This lets you choose exactly which memories are included in the context window, or fetch messages to render conversation history in your UI.
105
105
 
106
+ > **Tip:** When memory is enabled, [Studio](https://mastra.ai/docs/studio/overview) uses message history to display past conversations in the chat sidebar.
107
+
106
108
  ## Accessing memory
107
109
 
108
110
  To access memory functions for querying, cloning, or deleting threads and messages, call `getMemory()` on an agent:
109
111
 
110
112
  ```typescript
111
- const agent = mastra.getAgent('weatherAgent')
113
+ const agent = mastra.getAgentById('test-agent')
112
114
  const memory = await agent.getMemory()
113
115
  ```
114
116
 
@@ -107,7 +107,7 @@ Use memory when your agent needs to maintain multi-turn conversations that refer
107
107
 
108
108
  > **Note:** Visit [Memory Class](https://mastra.ai/reference/memory/memory-class) for a full list of configuration options.
109
109
 
110
- 5. Call your agent, for example in [Mastra Studio](https://mastra.ai/docs/getting-started/studio). Inside Studio, start a new chat with your agent and take a look at the right sidebar. It'll now display various memory-related information.
110
+ 5. Call your agent, for example in [Studio](https://mastra.ai/docs/studio/overview). Inside Studio, start a new chat with your agent and take a look at the right sidebar. It'll now display various memory-related information.
111
111
 
112
112
  ## Message history
113
113
 
@@ -165,7 +165,7 @@ export const memoryAgent = new Agent({
165
165
 
166
166
  ## Memory in multi-agent systems
167
167
 
168
- When a [supervisor agent](https://mastra.ai/docs/agents/supervisor-agents) delegates to a subagent, Mastra isolates subagent memory automatically. There is no flag to enable this as it happens on every delegation. Understanding how this scoping works lets you decide what stays private and what to share intentionally.
168
+ When a [supervisor agent](https://mastra.ai/docs/agents/supervisor-agents) delegates to a subagent, Mastra isolates subagent memory automatically. No flag enables this as it happens on every delegation. Understanding how this scoping works lets you decide what stays private and what to share intentionally.
169
169
 
170
170
  ### How delegation scopes memory
171
171
 
@@ -175,7 +175,7 @@ Each delegation creates a fresh `threadId` and a deterministic `resourceId` for
175
175
  - **Resource ID**: Derived as `{parentResourceId}-{agentName}`. Because the resource ID is stable across delegations, resource-scoped memory persists between calls. A subagent remembers facts from previous delegations by the same user.
176
176
  - **Memory instance**: If a subagent has no memory configured, it inherits the supervisor's `Memory` instance. If the subagent defines its own, that takes precedence.
177
177
 
178
- The supervisor forwards its conversation context to the subagent so it has enough background to complete the task. Only the delegation prompt and the subagent's response are saved — the full parent conversation is not stored. You can control which messages reach the subagent with the [`messageFilter`](https://mastra.ai/docs/agents/supervisor-agents) callback.
178
+ The supervisor forwards its conversation context to the subagent so it has enough background to complete the task. Only the delegation prompt and the subagent's response are saved — the full parent conversation isn't stored. You can control which messages reach the subagent with the [`messageFilter`](https://mastra.ai/docs/agents/supervisor-agents) callback.
179
179
 
180
180
  > **Note:** Subagent resource IDs are always suffixed with the agent name (`{parentResourceId}-{agentName}`). Two different subagents under the same supervisor never share a resource ID through delegation.
181
181
 
@@ -206,7 +206,7 @@ Because both calls use `resource: 'project-42'`, the writer can access the resea
206
206
 
207
207
  Enable [Tracing](https://mastra.ai/docs/observability/tracing/overview) to monitor and debug memory in action. Traces show you exactly which messages and observations the agent included in its context for each request, helping you understand agent behavior and verify that memory retrieval is working as expected.
208
208
 
209
- Open [Mastra Studio](https://mastra.ai/docs/getting-started/studio) and select the **Observability** tab in the sidebar. Open the trace of a recent agent request, then look for spans of LLMs calls.
209
+ Open [Studio](https://mastra.ai/docs/studio/overview) and select the **Observability** tab in the sidebar. Open the trace of a recent agent request, then look for spans of LLMs calls.
210
210
 
211
211
  ## Switch memory per request
212
212
 
@@ -18,18 +18,33 @@ After getting a response from the LLM, all new messages (user, assistant, and to
18
18
 
19
19
  ## Quickstart
20
20
 
21
- Semantic recall is enabled by default, so if you give your agent memory it will be included:
21
+ Semantic recall is disabled by default. To enable it, set `semanticRecall: true` in `options` and provide a `vector` store and `embedder`:
22
22
 
23
23
  ```typescript
24
24
  import { Agent } from '@mastra/core/agent'
25
25
  import { Memory } from '@mastra/memory'
26
+ import { LibSQLStore, LibSQLVector } from '@mastra/libsql'
27
+ import { ModelRouterEmbeddingModel } from '@mastra/core/llm'
26
28
 
27
29
  const agent = new Agent({
28
30
  id: 'support-agent',
29
31
  name: 'SupportAgent',
30
32
  instructions: 'You are a helpful support agent.',
31
33
  model: 'openai/gpt-5.4',
32
- memory: new Memory(),
34
+ memory: new Memory({
35
+ storage: new LibSQLStore({
36
+ id: 'agent-storage',
37
+ url: 'file:./local.db',
38
+ }),
39
+ vector: new LibSQLVector({
40
+ id: 'agent-vector',
41
+ url: 'file:./local.db',
42
+ }),
43
+ embedder: new ModelRouterEmbeddingModel('openai/text-embedding-3-small'),
44
+ options: {
45
+ semanticRecall: true,
46
+ },
47
+ }),
33
48
  })
34
49
  ```
35
50
 
@@ -77,6 +92,9 @@ const agent = new Agent({
77
92
  id: 'agent-vector',
78
93
  url: 'file:./local.db',
79
94
  }),
95
+ options: {
96
+ semanticRecall: true,
97
+ },
80
98
  }),
81
99
  })
82
100
  ```
@@ -139,6 +157,9 @@ import { ModelRouterEmbeddingModel } from '@mastra/core/llm'
139
157
  const agent = new Agent({
140
158
  memory: new Memory({
141
159
  embedder: new ModelRouterEmbeddingModel('openai/text-embedding-3-small'),
160
+ options: {
161
+ semanticRecall: true,
162
+ },
142
163
  }),
143
164
  })
144
165
  ```
@@ -262,26 +283,14 @@ const agent = new Agent({
262
283
 
263
284
  For detailed information about index configuration options and performance tuning, see the [PgVector configuration guide](https://mastra.ai/reference/vectors/pg).
264
285
 
265
- ## Disabling
286
+ ## Disable semantic recall
266
287
 
267
- Semantic recall has a performance impact. New messages are converted into embeddings and used to query a vector database before new messages are sent to the LLM.
268
-
269
- Semantic recall is enabled by default but can be disabled when not needed:
270
-
271
- ```typescript
272
- const agent = new Agent({
273
- memory: new Memory({
274
- options: {
275
- semanticRecall: false,
276
- },
277
- }),
278
- })
279
- ```
288
+ Semantic recall is disabled by default (`semanticRecall: false`). Each call adds latency because new messages are converted into embeddings and used to query a vector database before the LLM receives them.
280
289
 
281
- You might want to disable semantic recall in scenarios like:
290
+ Keep semantic recall disabled when:
282
291
 
283
- - When message history provides sufficient context for the current conversation.
284
- - In performance-sensitive applications, like realtime two-way audio, where the added latency of creating embeddings and running vector queries is noticeable.
292
+ - Message history provides sufficient context for the current conversation.
293
+ - You're building performance-sensitive applications, like realtime two-way audio, where embedding and vector query latency is noticeable.
285
294
 
286
295
  ## Viewing recalled messages
287
296
 
@@ -14,7 +14,7 @@ export const mastra = new Mastra({
14
14
  })
15
15
  ```
16
16
 
17
- > **Sharing the database with Mastra Studio:** When running `mastra dev` alongside your application (e.g., Next.js), use an absolute path to ensure both processes access the same database:
17
+ > **Sharing the database with Studio:** When running `mastra dev` alongside your application (e.g., Next.js), use an absolute path to ensure both processes access the same database:
18
18
  >
19
19
  > ```typescript
20
20
  > url: 'file:/absolute/path/to/your/project/mastra.db'
@@ -129,7 +129,7 @@ Mastra organizes conversations using two identifiers:
129
129
 
130
130
  Both identifiers are required for agents to store information:
131
131
 
132
- **Generate**:
132
+ **.generate()**:
133
133
 
134
134
  ```typescript
135
135
  const response = await agent.generate('hello', {
@@ -140,7 +140,7 @@ const response = await agent.generate('hello', {
140
140
  })
141
141
  ```
142
142
 
143
- **Stream**:
143
+ **.stream()**:
144
144
 
145
145
  ```typescript
146
146
  const stream = await agent.stream('hello', {
@@ -151,7 +151,7 @@ const stream = await agent.stream('hello', {
151
151
  })
152
152
  ```
153
153
 
154
- > **Note:** [Studio](https://mastra.ai/docs/getting-started/studio) automatically generates a thread and resource ID for you. When calling `stream()` or `generate()` yourself, remember to provide these identifiers explicitly.
154
+ > **Note:** [Studio](https://mastra.ai/docs/studio/overview) automatically generates a thread and resource ID for you. When calling `stream()` or `generate()` yourself, remember to provide these identifiers explicitly.
155
155
 
156
156
  ### Thread title generation
157
157
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  The DynamoDB storage implementation provides a scalable and performant NoSQL database solution for Mastra, leveraging a single-table design pattern with [ElectroDB](https://electrodb.dev/).
4
4
 
5
- > **Observability Not Supported:** DynamoDB storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to DynamoDB, and Mastra Studio's observability features won't work with DynamoDB as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
5
+ > **Observability Not Supported:** DynamoDB storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to DynamoDB, and [Studio's](https://mastra.ai/docs/studio/overview) observability features won't work with DynamoDB as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
6
6
 
7
7
  > **Item Size Limit:** DynamoDB enforces a **400 KB maximum item size**. This limit can be exceeded when storing messages with base64-encoded attachments such as images. See [Handling large attachments](https://mastra.ai/docs/memory/storage) for workarounds including uploading attachments to external storage.
8
8
 
package/dist/index.cjs CHANGED
@@ -2993,6 +2993,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
2993
2993
  await this.#addColumnIfNotExists(storage.TABLE_DATASETS, "scorerIds", "TEXT");
2994
2994
  await this.#addColumnIfNotExists(storage.TABLE_DATASET_ITEMS, "requestContext", "TEXT");
2995
2995
  await this.#addColumnIfNotExists(storage.TABLE_DATASET_ITEMS, "source", "TEXT");
2996
+ await this.#addColumnIfNotExists(storage.TABLE_DATASET_ITEMS, "expectedTrajectory", "TEXT");
2996
2997
  await this.#client.execute({
2997
2998
  sql: `CREATE INDEX IF NOT EXISTS idx_dataset_items_dataset_validto ON "${storage.TABLE_DATASET_ITEMS}" ("datasetId", "validTo")`,
2998
2999
  args: []
@@ -3051,6 +3052,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
3051
3052
  datasetVersion: row.datasetVersion,
3052
3053
  input: storage.safelyParseJSON(row.input),
3053
3054
  groundTruth: row.groundTruth ? storage.safelyParseJSON(row.groundTruth) : void 0,
3055
+ expectedTrajectory: row.expectedTrajectory ? storage.safelyParseJSON(row.expectedTrajectory) : void 0,
3054
3056
  requestContext: row.requestContext ? storage.safelyParseJSON(row.requestContext) : void 0,
3055
3057
  metadata: row.metadata ? storage.safelyParseJSON(row.metadata) : void 0,
3056
3058
  source: row.source ? storage.safelyParseJSON(row.source) : void 0,
@@ -3067,6 +3069,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
3067
3069
  isDeleted: Boolean(row.isDeleted),
3068
3070
  input: storage.safelyParseJSON(row.input),
3069
3071
  groundTruth: row.groundTruth ? storage.safelyParseJSON(row.groundTruth) : void 0,
3072
+ expectedTrajectory: row.expectedTrajectory ? storage.safelyParseJSON(row.expectedTrajectory) : void 0,
3070
3073
  requestContext: row.requestContext ? storage.safelyParseJSON(row.requestContext) : void 0,
3071
3074
  metadata: row.metadata ? storage.safelyParseJSON(row.metadata) : void 0,
3072
3075
  source: row.source ? storage.safelyParseJSON(row.source) : void 0,
@@ -3326,13 +3329,14 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
3326
3329
  args: [args.datasetId]
3327
3330
  },
3328
3331
  {
3329
- sql: `INSERT INTO ${storage.TABLE_DATASET_ITEMS} (id, datasetId, datasetVersion, validTo, isDeleted, input, groundTruth, requestContext, metadata, source, createdAt, updatedAt) VALUES (?, ?, (SELECT version FROM ${storage.TABLE_DATASETS} WHERE id = ?), NULL, 0, jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), ?, ?)`,
3332
+ sql: `INSERT INTO ${storage.TABLE_DATASET_ITEMS} (id, datasetId, datasetVersion, validTo, isDeleted, input, groundTruth, expectedTrajectory, requestContext, metadata, source, createdAt, updatedAt) VALUES (?, ?, (SELECT version FROM ${storage.TABLE_DATASETS} WHERE id = ?), NULL, 0, jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), ?, ?)`,
3330
3333
  args: [
3331
3334
  id,
3332
3335
  args.datasetId,
3333
3336
  args.datasetId,
3334
3337
  jsonbArg(args.input),
3335
3338
  jsonbArg(args.groundTruth),
3339
+ jsonbArg(args.expectedTrajectory),
3336
3340
  jsonbArg(args.requestContext),
3337
3341
  jsonbArg(args.metadata),
3338
3342
  jsonbArg(args.source),
@@ -3354,6 +3358,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
3354
3358
  datasetVersion: newVersion,
3355
3359
  input: args.input,
3356
3360
  groundTruth: args.groundTruth,
3361
+ expectedTrajectory: args.expectedTrajectory,
3357
3362
  requestContext: args.requestContext,
3358
3363
  metadata: args.metadata,
3359
3364
  source: args.source,
@@ -3394,11 +3399,12 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
3394
3399
  const versionId = crypto.randomUUID();
3395
3400
  const now = /* @__PURE__ */ new Date();
3396
3401
  const nowIso = now.toISOString();
3397
- const mergedInput = args.input ?? existing.input;
3398
- const mergedGroundTruth = args.groundTruth ?? existing.groundTruth;
3399
- const mergedRequestContext = args.requestContext ?? existing.requestContext;
3400
- const mergedMetadata = args.metadata ?? existing.metadata;
3401
- const mergedSource = args.source ?? existing.source;
3402
+ const mergedInput = args.input !== void 0 ? args.input : existing.input;
3403
+ const mergedGroundTruth = args.groundTruth !== void 0 ? args.groundTruth : existing.groundTruth;
3404
+ const mergedExpectedTrajectory = args.expectedTrajectory !== void 0 ? args.expectedTrajectory : existing.expectedTrajectory;
3405
+ const mergedRequestContext = args.requestContext !== void 0 ? args.requestContext : existing.requestContext;
3406
+ const mergedMetadata = args.metadata !== void 0 ? args.metadata : existing.metadata;
3407
+ const mergedSource = args.source !== void 0 ? args.source : existing.source;
3402
3408
  const results = await this.#client.batch(
3403
3409
  [
3404
3410
  {
@@ -3410,13 +3416,14 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
3410
3416
  args: [args.datasetId, args.id]
3411
3417
  },
3412
3418
  {
3413
- sql: `INSERT INTO ${storage.TABLE_DATASET_ITEMS} (id, datasetId, datasetVersion, validTo, isDeleted, input, groundTruth, requestContext, metadata, source, createdAt, updatedAt) VALUES (?, ?, (SELECT version FROM ${storage.TABLE_DATASETS} WHERE id = ?), NULL, 0, jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), ?, ?)`,
3419
+ sql: `INSERT INTO ${storage.TABLE_DATASET_ITEMS} (id, datasetId, datasetVersion, validTo, isDeleted, input, groundTruth, expectedTrajectory, requestContext, metadata, source, createdAt, updatedAt) VALUES (?, ?, (SELECT version FROM ${storage.TABLE_DATASETS} WHERE id = ?), NULL, 0, jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), ?, ?)`,
3414
3420
  args: [
3415
3421
  args.id,
3416
3422
  args.datasetId,
3417
3423
  args.datasetId,
3418
3424
  jsonbArg(mergedInput),
3419
3425
  jsonbArg(mergedGroundTruth),
3426
+ jsonbArg(mergedExpectedTrajectory),
3420
3427
  jsonbArg(mergedRequestContext),
3421
3428
  jsonbArg(mergedMetadata),
3422
3429
  jsonbArg(mergedSource),
@@ -3437,6 +3444,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
3437
3444
  datasetVersion: newVersion,
3438
3445
  input: mergedInput,
3439
3446
  groundTruth: mergedGroundTruth,
3447
+ expectedTrajectory: mergedExpectedTrajectory,
3440
3448
  requestContext: mergedRequestContext,
3441
3449
  metadata: mergedMetadata,
3442
3450
  source: mergedSource,
@@ -3768,13 +3776,14 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
3768
3776
  const id = crypto.randomUUID();
3769
3777
  items.push({ id, input: itemInput });
3770
3778
  statements.push({
3771
- sql: `INSERT INTO ${storage.TABLE_DATASET_ITEMS} (id, datasetId, datasetVersion, validTo, isDeleted, input, groundTruth, requestContext, metadata, source, createdAt, updatedAt) VALUES (?, ?, (SELECT version FROM ${storage.TABLE_DATASETS} WHERE id = ?), NULL, 0, jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), ?, ?)`,
3779
+ sql: `INSERT INTO ${storage.TABLE_DATASET_ITEMS} (id, datasetId, datasetVersion, validTo, isDeleted, input, groundTruth, expectedTrajectory, requestContext, metadata, source, createdAt, updatedAt) VALUES (?, ?, (SELECT version FROM ${storage.TABLE_DATASETS} WHERE id = ?), NULL, 0, jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), ?, ?)`,
3772
3780
  args: [
3773
3781
  id,
3774
3782
  input.datasetId,
3775
3783
  input.datasetId,
3776
3784
  jsonbArg(itemInput.input),
3777
3785
  jsonbArg(itemInput.groundTruth),
3786
+ jsonbArg(itemInput.expectedTrajectory),
3778
3787
  jsonbArg(itemInput.requestContext),
3779
3788
  jsonbArg(itemInput.metadata),
3780
3789
  jsonbArg(itemInput.source),
@@ -3795,6 +3804,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
3795
3804
  datasetVersion: newVersion,
3796
3805
  input: itemInput.input,
3797
3806
  groundTruth: itemInput.groundTruth,
3807
+ expectedTrajectory: itemInput.expectedTrajectory,
3798
3808
  requestContext: itemInput.requestContext,
3799
3809
  metadata: itemInput.metadata,
3800
3810
  source: itemInput.source,
@@ -7063,7 +7073,8 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
7063
7073
  lastObservedAt: input.chunk.lastObservedAt,
7064
7074
  createdAt: /* @__PURE__ */ new Date(),
7065
7075
  suggestedContinuation: input.chunk.suggestedContinuation,
7066
- currentTask: input.chunk.currentTask
7076
+ currentTask: input.chunk.currentTask,
7077
+ threadTitle: input.chunk.threadTitle
7067
7078
  };
7068
7079
  const newChunks = [...existingChunks, newChunk];
7069
7080
  const lastBufferedAtTime = input.lastBufferedAtTime ? input.lastBufferedAtTime.toISOString() : null;