npm / @mastra/libsql
@mastra/libsql
What changed in @mastra/libsql 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
9 breaking2 security37 new APIs and options6 performance5 behavior and defaults27 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@mastra/libsql 186 changes
Breaking changes 9
Text columns containing JSON-like values now read back as stored text rather than parsed objects, fixing the Studio Traces page error on LibSQL storage.
Search now matches pages containing any query word and ranks pages by the number of matching words, while whole-query name matches remain first.
Knowledge is stored as pages, notes, and pins instead of nodes and records. Startup drops the earlier experimental Knowledge node-store tables and creates the new tables; Memory and other tables are untouched.
libSQL stores reject writes from durable agent executions that lost their run during crash recovery. The claims tables are created on init; with disableInit: true, create them before upgrading. Durable agent runs require the tables to exist.
$or and $nor metadata filters now combine the keys of each condition with AND, preventing unintended matches and excess vector deletions.
Listings now honor the orderBy option instead of always returning a fixed order. This requires @mastra/core 1.68.0 or newer.
Factory storage adapter updates with unique-index conflicts now throw UniqueViolationError, matching inserts so callers can handle duplicate claims consistently.
Fixed the store package failing to load with @mastra/core older than 1.63.1 and corrected the minimum supported core version.
Paginated memory reads now re-throw backend failures as MastraError instead of returning empty results; callers can distinguish outages from genuinely empty results.
Security 2
Fixes concurrent dataset item writes so purged payloads cannot be restored during updates or deletes.
Scoped trace deletion now rejects unsupported tenant filters instead of deleting data without scope.
New APIs and options 37
Pass endAt with cron to stop a recurring schedule after a given time; declarative workflow schedules also accept it.
LibSQL observability storage reports whether persistence is local or remote, helping prevent local observability writes on Platform.
Pass runAt instead of cron to create a one-off schedule for an agent or workflow; declarative workflow schedules also accept it.
Workflows can opt into storage version 2, which stores runs as a header plus per-step entries and saves only changes. Existing runs remain usable; init() creates the required tables.
Knowledge storage adapters gain countChildPages({ parentIds, read }), which counts readable child pages under each parent in one query.
Run this once to index pages written before upgrading to the LibSQL Knowledge page link index.
The LibSQL Knowledge store creates and maintains a page link index table at startup, including in existing databases without a schema change. Existing pages need one reindexLinks() run after upgrading.
The pins table gains kind and depth columns, allowing one pin per page per kind. LibSQL rebuilds the table on first start, copying existing pins as page pins; no reset is needed.
Background task updates support the expectedSuspendedAt condition, rejecting a write for an earlier suspension instead of overwriting a newer suspension.
Background task storage adds the optional expiresAt field and filtering by expiresAt; existing tables and collections gain the field automatically when the store initializes.
Background task storage adds the optional metadata field; existing tables and collections gain the field automatically when the store initializes.
Added a method so MastraStorageExporter can end spans started by another process; spans that already ended aren't overwritten.
Added a datasetIds filter to fetch specific datasets by ID in one request; all matches come back on one page, up to 100 IDs.
A nullable supersededBy column is added to the observational memory table automatically at startup and existing rows are backfilled; users managing the schema themselves must add it before upgrading.
Set this option to prune memory run fences when calling storage.prune().
Set this option to prune workflow run ownership claims when calling storage.prune().
Filter observational memory history to records containing a group in active observations or persisted buffered chunks.
Read one history record by ID; it only matches records for the requested thread or resource.
Choose the generation ordering for observational memory history, including finding the earliest retained record.
Adapters advertise support for observational memory history search through this capability.
Background task ownership is persisted with ownerId and leaseExpiresAt, and updateTask() honors expectedOwnerId and expectedLeaseExpiresAt write conditions to fence recovery on the lease. Existing tables are migrated in place.
Copies a thread and its messages without returning message content, avoiding loading every message payload into the Node heap.
Adds an atomic, serialized implementation that moves a thread and all its messages to a new resourceId inside a single transaction.
Accepts tags to filter experiment results; a result matches only when all requested tags are present.
Adds item purging that redacts content from dataset history and linked experiment results while preserving version history and review status.
Knowledge nodes gain an optional bounded description field, written through a dedicated curator tool as part of an experimental memory feature.
Added syncUrl and syncInterval options to keep a local database file synced with a remote libSQL primary.
Added a reusable SQLite client contract for storage adapters using compatible SQLite drivers.
Adds an attempt column to experiment results, enabling retry-safe result writes keyed by experiment, item, and attempt.
Accepts an optional caller-supplied id and upserts on it, so retried experiment submissions replace previous score rows instead of accumulating duplicates.
Adds an optional scorerIds column to experiments for caller-driven experiment results.
Adds a nullable target to experiments, supporting caller-driven experiments with an optional target.
Adds retry-safe experiment result writes that converge on one row for the same experiment, item, and attempt.
Added a durable option to stored agents so agents created through the Agents API can run with durable execution without code deployment; defaults or loop settings can be supplied.
Added foundational support for an upcoming experimental memory capability across storage, runtime, and developer tooling.
LibSQL storage supports experiment grouping fields, which remain available for later grouping and filtering.
LibSQL storage supports experiment provenance fields, which remain available for later grouping and filtering.
Performance 6
Queries that scan rows without using the vector index are much faster because the query vector is parsed once per query instead of once per scanned row, with the same results.
Workflow run lists requested with summary: true now read only status and timestamp from each snapshot, reducing database transfer for large snapshots.
Thread lookups now filter the thread id embedded in suspended run snapshots inside SQLite instead of loading every suspended snapshot into the application.
Adds an idempotently created partial index on startedAt for root spans, improving observability trace listing without scanning the full spans table.
LibSQL overrides getVersions for agents and skills, fetching active versions in one WHERE id IN (...) query instead of one query per listed entity.
Added native application collection counts so totals no longer require loading matching rows.
Behavior and default changes 5
cron is now optional on schedule records and create/update inputs, so strict consumers must check that schedule.cron is defined before reading it.
Database-backed agents retain Editor changes to static model fallback lists across restarts, and existing LibSQL databases upgrade automatically.
Storage identifiers are generated with Web Crypto while synchronous storage interfaces remain unchanged.
Storage adapters declare support for partial thread updates, allowing newer memory versions to preserve existing titles and remain safe with older adapters.
title and metadata are independently optional; omitting either leaves that column untouched, preventing stale titles from overwriting generated ones.
Fixes and other changes 27
Fixed LibSQL vector stores leaving the vector index broken after truncateIndex, which caused later inserts to fail.
Cancellation status is checked in the same statement as a snapshot write, preventing a concurrent write from overwriting a run canceled by another process.
Remote database startup handles transient network errors with limited concurrency and backoff retries; a failed init() can now be retried.
The metadata filter in skills.list and skills.listResolved now matches every key/value pair against resolved version metadata, with correct total and pagination.
New tables get a (threadId, id) primary key, and existing tables are upgraded when storage initializes, preventing duplicate notification ids and enabling PostgreSQL updates and deletes in logical replication publications.
Late workflow result writes no longer recreate deleted runs.
Transactions on :memory: databases now commit or roll back like file databases, so partial writes are not left in place when a write fails.
Concurrent reflection, activation, buffering, and message saves no longer lose context or cause SQLITE_BUSY errors on a local file database.
With url plus syncUrl, observational memory writes sync the replica before retrying after a conflict or treating another instance's record as missing; this does not apply to a prebuilt client.
The experimental memory feature was rearchitected.
Reopens connections after a local database write is refused with SQLITE_BUSY, preventing later writes from failing while the connection is stuck.
When multiple LibSQL clients in one process use the same local database file, a write waits for another client's open transaction instead of blocking the process.
Memory writes retry with backoff when another process briefly holds the database lock, using the existing maxRetries and initialBackoffMs options.
Workflow step results can be recorded together with workflow state in a single write, helping evented workflows resume with the correct state after a restart.
Schedules with no future cron occurrence are stored as completed when their final firing is claimed, so that occurrence is delivered once instead of on every tick.
Fixed the LibSQL store so updating workflow state also updates the run's updatedAt, preventing updated runs from appearing stale in sorting and retention.
Fixes schedules failing with “no such column: owner_type” on databases created by older versions; existing schedules and trigger history are kept, and upgrades are safe when processes share a database.
LibSQL skills storage now includes visibility in the skill returned by create.
Omitted dataset descriptions now read back as undefined, matching their declared type.
LibSQL dataset writes now preserve JSON null in input, groundTruth, and expectedTrajectory across insertion, updates, and version history.
prune now uses one cutoff instant across all retained tables so rows near the retention boundary are handled consistently.
Fixes serialization so primitive background task results round-trip correctly through LibSQL storage.
Fixes double-encoding
tagson insert and backfills previously affected rows oninit()so they match the new filter.Fixes
url: ':memory:'losing tables after an interactive write transaction by queuing store calls behind open transactions, preventingTRANSACTION_ACTIVEfailures.Fixed local LibSQL vector corruption during concurrent writes.
The LibSQL vector filter's $size operator now binds through a standard ? placeholder, fixing invalid SQL caused by named references that did not match positional bindings.
Lookups now return the item visible in the requested dataset snapshot.