Skip to content
PluginStats

@zukhruf/embedding-cache weekly downloads statistics

By zukhruf (3 listings) · npm · AI SDKs

An AI SDK embedding middleware that calls the model only for new text and gives back exactly the numbers it gave, kept in memory, SQLite or SQL Server. After .NET's CachingEmbeddingGenerator.

View on npm Fresh · Dec 6, 2026

@zukhruf/embedding-cache has 34,414 recorded weekly downloads on npm, a change of +7.0% over the past 7 days, ranking #889 of 3,247 tracked listings.

Weekly downloads
34,414
Official API · Dec 5, 2026
7-day growth
+7.0%
+2.2K weekly downloads
30-day growth
—
Insufficient history
90-day growth
—
Insufficient history
Rank
#889
▼ 14 in 7 days

About @zukhruf/embedding-cache

@zukhruf/embedding-cache

Ezz accepted each ADR on 2026-11-19.

A model call is the slow and paid part of an embedding. This package wraps an AI SDK embedding model so that each embed and embedMany call through it calls the model only for text that it did not embed before. A hit gives back exactly the numbers that the model gave the first time.

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

Use it

npm install @zukhruf/embedding-cache ai
import { embedMany, wrapEmbeddingModel } from 'ai';

import { embeddingCacheMiddleware } from '@zukhruf/embedding-cache';
import { SqliteEmbeddingCacheStore } from '@zukhruf/embedding-cache/sqlite';

SqliteEmbeddingCacheStore.declaration('embedding_cache').apply(database, {
  rows: 'keep',
});
const model = wrapEmbeddingModel({
  model: openai.embedding('text-embedding-3-small'),
  middleware: embeddingCacheMiddleware({
    store: new SqliteEmbeddingCacheStore({
      database,
      table: 'embedding_cache',
    }),
  }),
});

const { embeddings } = await embedMany({ model, values: texts });
// Only the texts that the store does not hold reach OpenAI.

A model with other prompts for documents and for queries is two wrapped models with two model ids; their keys never meet (ADR 0003).

Keep the cache in SQL Server
import { SqlServerEmbeddingCacheStore } from '@zukhruf/embedding-cache/sqlserver';
import type { SqlServerSession } from '@zukhruf/schema-drift/sqlserver';

// The session of schema-drift: queries on the pool, and a transaction of
// mssql.Transaction for apply. The store takes it too, and sends only queries.
const session: SqlServerSession = {
  async query(sql, parameters) {
    const request = pool.request();
    for (const [name, value] of Object.entries(parameters))
      request.input(name, value);
    return (await request.query(sql)).recordset ?? [];
  },
  async transaction(work) {
    const transaction = new mssql.Transaction(pool);
    await transaction.begin();
    try {
      const inner: SqlServerSession = {
        async query(sql, parameters) {
          const request = new mssql.Request(transaction);
          for (const [name, value] of Object.entries(parameters))
            request.input(name, value);
          return (await request.query(sql)).recordset ?? [];
        },
        transaction: async (nested) => nested(inner),
      };
      await work(inner);
      await transaction.commit();
    } catch (error) {
      await transaction.rollback();
      throw error;
    }
  },
};

await SqlServerEmbeddingCacheStore.declaration('dbo.embedding_cache').apply(
  session,
  { rows: 'keep' },
);
const store = await SqlServerEmbeddingCacheStore.open({
  session,
  table: 'dbo.embedding_cache',
});

The session is the one that @zukhruf/schema-drift takes, so apply has its transaction. The store takes the same object and sends only query. open takes a signal too, and gives it to each query of its check.

Apply the table before a store opens

Each SQL store keeps one table, and exports its declaration, a declaration of @zukhruf/schema-drift. The host applies it, at deploy, at start or from its own tool. The store only checks it when it opens, and runs no DDL (ADR 0006).

  • SqliteEmbeddingCacheStore.declaration(table) is a SqliteDeclaration. The table name is one identifier, with no schema.
  • SqlServerEmbeddingCacheStore.declaration(table) is a SqlServerDeclaration. The table name is a schema and a name, dbo.embedding_cache, and the ledger of schema-drift goes in that schema. The host makes the schema: the declaration does not declare it. Its schema-drift name holds the table, @zukhruf/embedding-cache/sqlserver:dbo.embedding_cache, so two caches in one schema own their tables apart, and the apply of one never drops the other's.
  • rows is the host's choice. Give 'keep': a vector is a paid model call, and a cache with no rows calls the model again for each text.
  • new SqliteEmbeddingCacheStore({ database, table }) and SqlServerEmbeddingCacheStore.open throw SchemaDriftError of @zukhruf/schema-drift when the table is missing or stale. Its objects names the table. The next step is the host's: apply the declaration.
  • A SQLite table that an earlier version of the store made fits the declaration. A SQL Server table that an earlier version made has no ledger row, so open names it as stale. Apply once with rows: 'keep': the vectors stay.

What a call does underneath…

Description from the npm listing.

  • embedding
  • cache
  • ai-sdk
  • middleware
  • sqlite
  • sql-server

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/embedding-cache weekly downloads on npm, last 90 days: 34,414 weekly downloads as of Dec 5, 2026.@zukhruf/embedding-cacheWeekly downloads on npm · Last 90 days34,414downloads / week010K20K30K40K50KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@zukhruf/embedding-cache weekly downloads on npm, last 90 days: 34,414 weekly downloads as of Dec 5, 2026.

7/30/90-day growth

@zukhruf/embedding-cache weekly downloads growth on npm: +7.0% over 7 days, 30-day growth unavailable, 90-day growth unavailable.@zukhruf/embedding-cacheWeekly downloads growth on npm34,414downloads / week now7-day growth+2,243 weekly downloads+7.0%30-day growth+34,414 weekly downloadsInsufficient history90-day growth+34,414 weekly downloadsInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@zukhruf/embedding-cache weekly downloads growth on npm: +7.0% over 7 days, 30-day growth unavailable, 90-day growth unavailable.

Ranking history

@zukhruf/embedding-cache npm ranking history: currently #889 (by weekly downloads).@zukhruf/embedding-cachenpm ranking · by weekly downloads · Last 90 days#889current rank#800#900#1000#1100#1200#1300#1400Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankNov 23, 2026 – Dec 6, 2026 · 14 observations · Updated Dec 5, 2026pluginstats.com
@zukhruf/embedding-cache npm ranking history: currently #889 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 45, #9 (overall #889)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs378 listings · 19 pages · page 3, #19 (overall #59)
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 (128)
Recent weekly downloads observations for @zukhruf/embedding-cache
Date (UTC)Weekly downloadsChange vs. previous
34,414-1.1K
35,521-6K
41,516-39
41,555+3K
38,601+448
38,153+4.6K
33,600+1.4K
32,171+4.8K
27,400+7.7K
19,702+2.7K
17,021+3.6K
13,437+4.3K
9,131+2.1K
6,997—

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/embedding-cache. First seen Nov 23, 2026; last successful collection Dec 6, 2026. See the methodology.