New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@mastra/libsql

Package Overview
Dependencies
Maintainers
7
Versions
831
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
This package has malicious versions linked to the ongoing "Mastra AI framework compromise" supply chain attack.

Affected versions:

1.13.1
View campaign page

@mastra/libsql

Libsql provider for Mastra - includes both vector and db storage capabilities

alpha
Source
npmnpm
Version
1.23.0-alpha.2
Version published
Weekly downloads
293K
23.64%
Maintainers
7
Weekly downloads
 
Created
Source

@mastra/libsql

SQLite implementation for Mastra, providing both vector similarity search and general storage capabilities with connection pooling and transaction support.

Installation

npm install @mastra/libsql

Usage

Vector Store

import { LibSQLVector } from '@mastra/libsql';

const vectorStore = new LibSQLVector({
  url: 'file:./my-db.db',
});

// Create a new table with vector support
await vectorStore.createIndex({
  indexName: 'my_vectors',
  dimension: 3,
  metric: 'cosine',
});

// Add vectors
const ids = await vectorStore.upsert({
  indexName: 'my_vectors',
  vectors: [
    [0.1, 0.2, 0.3],
    [0.3, 0.4, 0.5],
  ],
  metadata: [{ text: 'doc1' }, { text: 'doc2' }],
});

// Query vectors
const results = await vectorStore.query({
  indexName: 'my_vectors',
  queryVector: [0.1, 0.2, 0.3],
  topK: 10, // topK
  filter: { text: 'doc1' }, // filter
  includeVector: false, // includeVector
  minScore: 0.5, // minScore
});

Documentation

  • @mastra/libsql documentation

Changelog

See the package changelog for version history and release notes.

Support

We have an open community Discord. Come and say hello and let us know if you have any questions or need any help getting things running.

FAQs

Package last updated on 12 Sep 2026

Related posts