New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@mastra/fastembed

Package Overview
Dependencies
Maintainers
7
Versions
202
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.1.3
View campaign page

@mastra/fastembed

Source
npmnpm
Version
1.3.5
Version published
Weekly downloads
36K
107.9%
Maintainers
7
Weekly downloads
 
Created
Source

@mastra/fastembed

Local embedding model integration for Mastra, powered by ONNX Runtime.

This package is a maintained fork of fastembed-js (now archived). The upstream source has been vendored directly into this package so that @mastra/fastembed no longer depends on the unmaintained fastembed npm package.

Installation

npm install @mastra/fastembed

Usage

Default (AI SDK v3)

import { Memory } from '@mastra/memory';
import { fastembed } from '@mastra/fastembed';

const memory = new Memory({
  // ... other memory options
  embedder: fastembed,
});

Input length

FastEmbed models embed at most 512 tokens per input (roughly 2,000 to 2,500 characters of English text). Longer inputs are truncated: text past the limit doesn't affect the embedding. The AI SDK v3 models return a warning when this happens. Chunk long documents to fit the window, for example with maxSize: 1500 in MDocument.chunk().

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 28 Oct 2026

Related posts