@mastra/libsql 1.22.5 → 1.23.0-alpha.2

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.
@@ -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.22.5"
6
+ version: "1.23.0-alpha.2"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.22.5",
2
+ "version": "1.23.0-alpha.2",
3
3
  "package": "@mastra/libsql",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -122,6 +122,8 @@ You can use this history in two ways:
122
122
  - **Automatic inclusion**: Mastra automatically includes recent messages in the context window. The default of 10 messages keeps agents grounded in the conversation. Adjust it with `lastMessages` when needed.
123
123
  - [**Manual querying**](#querying): For more control, query threads and messages directly with `recall()`. Use the results to choose which memories enter the context window or to render conversation history in your UI.
124
124
 
125
+ > **Note:** `lastMessages` counts every stored message, including tool calls, tool results, and [signals](https://mastra.ai/docs/harness/signals) of any kind, so a single turn can add several messages to the count. The window also slides forward on every request: once a thread grows past the limit, the oldest message leaves context on each turn, which changes the start of the prompt and invalidates the provider prompt cache. For long-running conversations, use [Observational Memory](https://mastra.ai/docs/memory/observational-memory), which keeps the prompt prefix stable.
126
+
125
127
  > **Tip:** When memory is enabled, [Studio](https://mastra.ai/docs/studio/overview) uses message history to display past conversations in the chat sidebar.
126
128
 
127
129
  ## Thread title generation
@@ -232,7 +234,7 @@ const thread = await memory.getThreadById({ threadId: 'thread-123' })
232
234
 
233
235
  Once you have a thread, use [`recall()`](https://mastra.ai/reference/memory/recall) to retrieve its messages. It supports pagination and [semantic search](https://mastra.ai/docs/memory/semantic-recall), with optional date filtering.
234
236
 
235
- Basic recall returns all messages from a thread:
237
+ Fetch a thread's history without pagination. Recall hides reminder signals by default; pass `hideSignals: false` to include them, `true` to hide all recognized signals, or an array to omit selected types. See [signal visibility and compatibility](https://mastra.ai/reference/memory/recall) for matching rules and precedence.
236
238
 
237
239
  ```typescript
238
240
  const { messages } = await memory.recall({
@@ -343,7 +345,9 @@ const { thread, clonedMessages } = await memory.cloneThread({
343
345
 
344
346
  You can filter cloned messages by count or date range and specify custom thread IDs. Utility methods are also available to inspect clone relationships.
345
347
 
346
- See [`cloneThread()`](https://mastra.ai/reference/memory/cloneThread) and [clone utilities](https://mastra.ai/reference/memory/clone-utilities) for the full API.
348
+ If you don't need the copied messages returned, for example when forking a long thread, use `copyThread()`. It never returns message payloads, and on LibSQL and PostgreSQL the rows are copied inside the database. When semantic recall is enabled, the copied messages are still read back in batches to generate embeddings.
349
+
350
+ See [`cloneThread()`](https://mastra.ai/reference/memory/cloneThread), [`copyThread()`](https://mastra.ai/reference/memory/copyThread), and [clone utilities](https://mastra.ai/reference/memory/clone-utilities) for the full API.
347
351
 
348
352
  ## Deleting messages
349
353
 
@@ -39,7 +39,7 @@ export const agent = new Agent({
39
39
 
40
40
  **options** (`MemoryConfig`): Memory configuration options.
41
41
 
42
- **options.lastMessages** (`number | false`): Number of most recent messages to include in context. Set to false to disable the message history feature entirely (messages are not loaded into context or saved). Use Number.MAX\_SAFE\_INTEGER to retrieve all messages with no limit. To load messages without saving new ones, use the readOnly option.
42
+ **options.lastMessages** (`number | false`): Number of most recent messages to include in context. Set to false to disable the message history feature entirely (messages are not loaded into context or saved). Use Number.MAX\_SAFE\_INTEGER to retrieve all messages with no limit. To load messages without saving new ones, use the readOnly option. The window slides forward on every request, so once a thread exceeds the limit, each turn invalidates the provider prompt cache. For long-running conversations, use Observational Memory instead.
43
43
 
44
44
  **options.readOnly** (`boolean`): When true, prevents memory from saving new messages and provides working memory as read-only context (without the updateWorkingMemory tool). Useful for read-only operations like previews, internal routing agents, or sub agents that should reference but not modify memory.
45
45
 
@@ -147,5 +147,6 @@ export const agent = new Agent({
147
147
  - [listThreads](https://mastra.ai/reference/memory/listThreads)
148
148
  - [deleteMessages](https://mastra.ai/reference/memory/deleteMessages)
149
149
  - [cloneThread](https://mastra.ai/reference/memory/cloneThread)
150
+ - [copyThread](https://mastra.ai/reference/memory/copyThread)
150
151
  - [settled](https://mastra.ai/reference/memory/settled)
151
152
  - [Clone Utility Methods](https://mastra.ai/reference/memory/clone-utilities)