0
Fork 0
mirror of https://github.com/mastra-ai/mastra.git synced 2026-11-17 08:44:46 +00:00
mastra/packages/fastembed
History 2026-11-12 21:12:29 +00:00
..
src fix(memory): write one semantic recall row per message on every agent engine (#29826) 2026-11-10 00:03:33 -03:00
.gitignore chore(deps): update dependency fastembed to v2 (#10195) 2026-03-05 16:09:46 +01:00
CHANGELOG.md chore: version - exit prerelease mode 2026-11-12 21:12:29 +00:00
LICENSE-fastembed feat(fastembed): vendor fastembed-js source, remove abandoned upstream dep (#16772) 2026-05-19 19:45:00 +02:00
lint-staged.config.js chore: migrate repository formatting to oxfmt (#19807) 2026-07-24 16:18:33 +02:00
package.json chore: version - exit prerelease mode 2026-11-12 21:12:29 +00:00
README.md fix(fastembed): warn when inputs exceed the 512-token window (#27315) 2026-10-16 11:27:49 -07:00
tsconfig.build.json chore: fix go-to-definition using tsc declaration maps (#6089) 2025-07-30 15:41:00 -07:00
tsconfig.json fix(fastembed): download built-in models from Hugging Face instead of the legacy Qdrant GCS bucket (#25026) 2026-09-24 13:31:30 -07:00
tsdown.config.ts chore: migrate package builds to tsdown (#19829) 2026-07-28 12:32:21 +02:00
turbo.json chore: migrate package builds to tsdown (#19829) 2026-07-28 12:32:21 +02:00
vitest.config.ts feat(fastembed): vendor fastembed-js source, remove abandoned upstream dep (#16772) 2026-05-19 19:45:00 +02:00

@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.