Skip to content
PluginStats

@zukhruf/embeddings weekly downloads statistics

By zukhruf · npm · AI SDKs

Document embeddings in SQLite. Embeds only new or changed text through an AI SDK model. Finds the nearest documents of a document by exact cosine similarity in a publish-date window, and the similarity of a query vector to each document of a date range.

View on npm Fresh · Nov 3, 2026

@zukhruf/embeddings has 5,067 recorded weekly downloads on npm, ranking #1378 of 2,762 tracked listings.

Weekly downloads
5,067
Official API · Nov 1, 2026
7-day growth
—
Insufficient history
30-day growth
—
Insufficient history
90-day growth
—
Insufficient history
Rank
#1378
Among tracked npm listings

About @zukhruf/embeddings

@zukhruf/embeddings

A program that compares texts by meaning needs a vector for each text, and the model call that makes the vector is slow. This package keeps the vectors of documents in a SQLite database. An upsert calls the model only for new or changed text. A search gives the nearest documents of a document, by exact cosine similarity, from the documents published near it. A query gives the similarity of a vector of another text, for example a search sentence, to each document, or to each document of a date range. This kind of package is also known as a vector store.

The words in these documents have one meaning each. See the glossary in CONTEXT.md.

Use it

This project is an experiment. It uses node:sqlite and an embedding model of the AI SDK. The package does not start a model or a server. Give it a model that is ready.

npm install @zukhruf/embeddings ai
import { DatabaseSync } from 'node:sqlite';

import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
import { embed } from 'ai';

import { Collection } from '@zukhruf/embeddings';

const local = createOpenAICompatible({
  name: 'llama.cpp',
  baseURL: 'http://127.0.0.1:8080/v1',
});
using database = new DatabaseSync('embeddings.sqlite');
const collection = new Collection({
  database,
  model: local.embeddingModel('embeddinggemma'),
});

await collection.upsert([
  {
    id: 'a',
    text: 'Storm closes the port',
    publishedAt: new Date('2026-10-20'),
  },
  {
    id: 'b',
    text: 'Port shut as storm hits',
    publishedAt: new Date('2026-10-21'),
  },
  { id: 'c', text: 'Port opens again', publishedAt: new Date('2026-11-30') },
]);

collection.nearest('a', { k: 10, withinDays: 7 }); // [{ id: 'b', similarity: … }]
collection.similarity('a', 'c');

// Compare a text that is not a document with the documents of October.
const { embedding } = await embed({
  model: local.embeddingModel('embeddinggemma'),
  value: 'task: search result | query: ports closed by weather',
});
collection.query(embedding, {
  from: new Date('2026-10-01'),
  to: new Date('2026-10-31'),
}); // [{ id: 'a', similarity: … }, { id: 'b', similarity: … }]

collection.fetch(['a']); // Map { 'a' => Float32Array [ … ] }
collection.delete(['c']);
collection.count(); // 2
Search a vector table of your own

Another program can write the vectors into its own table. A VectorSearch searches that table with the same rules as a collection. The table or view must have the columns id (text) and vector. Each vector must be a unit vector, as a BLOB of float32 values in the byte order of the platform (ADR 0005). Each call except a query without a date range also reads the column published_at (milliseconds since the Unix epoch). Thus a table of documents with no publish date supports a query without a date range (ADR 0007).

import { DatabaseSync } from 'node:sqlite';

import { VectorSearch } from '@zukhruf/embeddings';

using database = new DatabaseSync('listings.sqlite');
const search = new VectorSearch({ database, table: 'listing_vectors' });

search.nearest('listing-42', { k: 10, withinDays: 30 });

To search a table with other column names, make a view that renames the columns, and give the name of the view.

API

  • new Collection({ database, model }). The caller opens and closes database. The collection makes its table embedding_document in it. model is an AI SDK embedding model object.
  • upsert(documents) stores each document. It calls the model, through embedMany, only for a document whose text or model changed. It stores the new publish date of each document.
  • nearest(id, { k, withinDays }) gives at most k neighbours of the document, with the highest similarity first. A neighbour has a publish date at most withinDays days before or after the publish date of the document. Equal similarities sort by id.
  • neighbourGraph({ from, to, k, withinDays }) gives an iterator of [id, neighbours] entries, one for each document published from from to to, in the order of the publish dates and then of the ids. The neighbours of each entry are equal to the result of nearest(id, { k, withinDays }). A document outside the range has no entry, but it can be a neighbour of a document in the range. The call reads and decodes each vector one time (ADR 0004). Use it when you need the neighbours of many documents.
  • similarity(a, b) gives the cosine similarity of two stored documents.
  • query(vector, range?) gives the similarity of a vector of the caller to each document, as { id, similarity } entries. With a date range { from, to }, it gives only the documents published from from to to. The highest similarity is first, and equal similarities sort by id. The call makes the vector a unit vector first. The vector must come from the model of the stored vectors (ADR 0006, ADR 0007).
  • fetch(ids) gives a Map from each id to a copy of its stored unit vector, as a Float32Array, in the order of the ids.
  • delete(ids) removes the documents. An id that the collection does not store is not an error, so you can delete the same ids again.
  • count() gives the number of stored documents.
  • new VectorSearch({ database, table }). The caller opens and closes database. table is the name of a table or a view in it, with the columns id and vector, and published_at for each call except a query without a date range. The vector search only reads it. Each call reads the table again, so the table can change between two calls.
  • VectorSearch gives nearest, neighbourGraph,…

Description from the npm listing.

  • embeddings
  • vector-search
  • nearest-neighbour
  • cosine-similarity
  • sqlite
  • node-sqlite
  • ai-sdk

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

@zukhruf/embeddings weekly downloads on npm, last 90 days: 5,067 weekly downloads as of Nov 1, 2026.@zukhruf/embeddingsWeekly downloads on npm · Last 90 days5,067downloads / week4.4K4.6K4.8K5K5.2K5.4K5.6KAug 3Aug 18Sep 2Sep 17Oct 2Oct 17Nov 1downloads / weekNov 1, 2026 – Nov 1, 2026 · 1 observations · Updated Nov 1, 2026pluginstats.com
@zukhruf/embeddings weekly downloads on npm, last 90 days: 5,067 weekly downloads as of Nov 1, 2026.

7/30/90-day growth

@zukhruf/embeddings weekly downloads growth on npm: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.@zukhruf/embeddingsWeekly downloads growth on npm5,067downloads / week now7-day growthinsufficient historyInsufficient history30-day growthinsufficient historyInsufficient history90-day growthinsufficient historyInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Nov 1, 2026pluginstats.com
@zukhruf/embeddings weekly downloads growth on npm: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.

Ranking history

@zukhruf/embeddings npm ranking history: currently #1378 (by weekly downloads).@zukhruf/embeddingsnpm ranking · by weekly downloads · Last 90 days#1378current rank#1376#1377#1378#1379#1380Aug 5Aug 20Sep 4Sep 19Oct 4Oct 19Nov 3rankNov 3, 2026 – Nov 3, 2026 · 1 observations · Updated Nov 1, 2026pluginstats.com
@zukhruf/embeddings npm ranking history: currently #1378 (by weekly downloads).

Listing placement

All npm2,762 listings · 139 pages · 1,382 shown · page 69, #19 (overall #1,379)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs310 listings · 16 pages · page 5, #20 (overall #100)
AI SDKs: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (1)
Recent weekly downloads observations for @zukhruf/embeddings
Date (UTC)Weekly downloadsChange vs. previous
5,067—

Similar npm AI SDKs plugins

All 20 @zukhruf/embeddings alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/@zukhruf/embeddings. First seen Nov 3, 2026; last successful collection Nov 3, 2026. See the methodology.