Skip to content
PluginStats

@zukhruf/retrieval weekly downloads statistics

By zukhruf (3 listings) · npm · AI SDKs

The query side of RAG: retrievers that search a passage table by meaning or keywords in SQLite, Postgres or SQL Server, fuse lists, rerank and post-process, and give the best passages first with a score that is higher for a better passage.

View on npm Fresh · Dec 6, 2026

@zukhruf/retrieval has 33,019 recorded weekly downloads on npm, a change of +29.2% over the past 7 days, ranking #900 of 3,247 tracked listings.

Weekly downloads
33,019
Official API · Dec 5, 2026
7-day growth
+29.2%
+7.5K weekly downloads
30-day growth
—
Insufficient history
90-day growth
—
Insufficient history
Rank
#900
▲ 45 in 7 days

About @zukhruf/retrieval

@zukhruf/retrieval

This package is the query side of retrieval-augmented generation (RAG). A query goes in. A retrieval result comes out: the best passages, best first, and the failures. An engine retriever, a fusion and a reranker give each passage a score, which is higher for a better passage; a host's source of order only, such as a web search, gives ranked passages with no score (ADR 0021). The package never cuts a document or writes a vector: elt writes the passages, their vectors with the model identity, and a keyword index (ADR 0001). A reranker may embed the text of the candidates of a query when that query runs, as a search embeds the query (ADR 0022).

The port of the package is Retriever. A query is a string, or a query bundle with a text for each kind of search (ADR 0013). The engine retrievers read that passage contract with the SQL of SQLite, Postgres or SQL Server. A host can implement Retriever over any other source, such as a web search. Composite retrievers fuse retrievers, rerank or rewrite the query, and postprocessors cut, diversify, group, reorder and widen the result.

The package has four entry points. @zukhruf/retrieval has the port, the composite retrievers, the fusions and their strategies, the postprocessors and the errors. @zukhruf/retrieval/sqlite, @zukhruf/retrieval/postgres and @zukhruf/retrieval/sqlserver each have the passage store and the engine retrievers of one engine.

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

Use it

npm install @zukhruf/retrieval @zukhruf/vectors ai zod

This program writes a small passage contract into an in-memory SQLite database and searches it by meaning. In production, elt writes the contract, and the model is an AI SDK embedding model. Here a stand-in model from ai/test counts three words, so the program runs offline.

import { DatabaseSync } from 'node:sqlite';

import { MockEmbeddingModelV4 } from 'ai/test';
import { z } from 'zod';

import {
  SqliteEmbeddingRetriever,
  SqlitePassageStore,
} from '@zukhruf/retrieval/sqlite';
import { Vector } from '@zukhruf/vectors';
import { install, toSql } from '@zukhruf/vectors/sqlite';

// A stand-in embedding model, so that the program runs offline: each vector
// counts three words. Give an AI SDK model in its place, such as
// openai.embedding('text-embedding-3-small').
const words = ['key', 'token', 'backup'];
const embedText = (text: string) =>
  words.map(
    (word) =>
      text
        .toLowerCase()
        .split(/\W+/)
        .filter((w) => w === word).length,
  );
const model = new MockEmbeddingModelV4({
  provider: 'toy',
  modelId: 'three-words',
  maxEmbeddingsPerCall: 100,
  doEmbed: async ({ values }) => ({
    embeddings: values.map(embedText),
    warnings: [],
  }),
});

// The passage contract. elt writes it; this program writes it by hand.
const database = new DatabaseSync(':memory:');
install(database); // registers vec_distance_cosine; or load sqlite-vec
database.exec(`
  CREATE TABLE docs_passages (id TEXT PRIMARY KEY, source TEXT NOT NULL, seq INTEGER NOT NULL, start INTEGER NOT NULL, "end" INTEGER NOT NULL, text TEXT NOT NULL, product TEXT, year INTEGER);
  CREATE TABLE docs_passage_vectors (id TEXT PRIMARY KEY, vector BLOB NOT NULL, model TEXT NOT NULL);
`);
const documents = [
  [
    'vault-guide',
    'vault',
    2025,
    [
      'Create a new key before you rotate the old key.',
      'Then move each token to the new key.',
      'Keep a backup of the old key for 30 days.',
    ],
  ],
  [
    'vault-faq',
    'vault',
    2024,
    [
      'A token expires after one hour.',
      'Revoke a token when a device is lost.',
    ],
  ],
  ['mail-guide', 'mail', 2025, ['Make a backup of each mailbox every night.']],
] as const;
const insertPassage = database.prepare(
  'INSERT INTO docs_passages VALUES (?, ?, ?, ?, ?, ?, ?, ?)',
);
const insertVector = database.prepare(
  'INSERT INTO docs_passage_vectors VALUES (?, ?, ?)',
);
for (const [source, product, year, sentences] of documents) {
  let start = 0; // offsets count code points
  for (const [seq, sentence] of sentences.entries()) {
    // The passages tile their source: each keeps the space before it.
    const text = seq === 0 ? sentence : ` ${sentence}`;
    const id = `${source}#${seq}`;
    const end = start + [...text].length;
    insertPassage.run(id, source, seq, start, end, text, product, year);
    insertVector.run(
      id,
      toSql(Vector.from(embedText(text))),
      'toy/three-words (3 dimensions)',
    );
    start = end;
  }
}

// The metadata of a passage: the columns of its row beside the passage's own.
const Doc = z.object({ product: z.string(), year: z.number() });
const store = new SqlitePassageStore({
  database,
  passages: 'docs_passages',
  metadata: Doc.parse,
});
const retriever = new SqliteEmbeddingRetriever({
  store,
  vectors: 'docs_passage_vectors',
  model,
});

const { passages } = await retriever.retrieve('How do I rotate a key?', {
  topK: 3,
});
for (const { passage, score } of passages) {
  console.log(score.toFixed(3), passage.id, passage.text);
}

Output:

1.000 vault-guide#0 Create a new key before you rotate the old key.
0.707 vault-guide#1  Then move each token to the new key.
0.707 vault-guide#2  Keep a backup of the old key for 30 days.
```…

Description from the npm listing.

  • retrieval
  • rag
  • retriever
  • vector-search
  • bm25
  • reciprocal-rank-fusion
  • rerank
  • ai-sdk
  • sqlite
  • postgres
  • 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/retrieval weekly downloads on npm, last 90 days: 33,019 weekly downloads as of Dec 5, 2026.@zukhruf/retrievalWeekly downloads on npm · Last 90 days33,019downloads / week010K20K30K40KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@zukhruf/retrieval weekly downloads on npm, last 90 days: 33,019 weekly downloads as of Dec 5, 2026.

7/30/90-day growth

@zukhruf/retrieval weekly downloads growth on npm: +29.2% over 7 days, 30-day growth unavailable, 90-day growth unavailable.@zukhruf/retrievalWeekly downloads growth on npm33,019downloads / week now7-day growth+7,468 weekly downloads+29.2%30-day growth+33,019 weekly downloadsInsufficient history90-day growth+33,019 weekly downloadsInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@zukhruf/retrieval weekly downloads growth on npm: +29.2% over 7 days, 30-day growth unavailable, 90-day growth unavailable.

Ranking history

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

Listing placement

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

Listing placement

AI SDKs378 listings · 19 pages · page 4, #4 (overall #64)
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/retrieval
Date (UTC)Weekly downloadsChange vs. previous
33,019-525
33,544-5.2K
38,754+122
38,632+3K
35,615+951
34,664+4.8K
29,841+4.3K
25,551+5.1K
20,407+8.5K
11,937+3.6K
8,370+3.3K
5,062+3.7K
1,383+1.4K
0—

Similar npm AI SDKs plugins

All 20 @zukhruf/retrieval 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/retrieval. First seen Nov 26, 2026; last successful collection Dec 6, 2026. See the methodology.