npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gungorbasa/retrievalkit

v0.1.0

Published

Local-first exact, BM25, and hybrid retrieval for Node.js on macOS arm64

Readme

RetrievalKit Node base package

@gungorbasa/retrievalkit is the approved retrieval-only package name. The package remains private in the source workspace until release assembly removes that safety gate. The initial supported runtime is Node.js LTS on macOS arm64.

import {
  RetrievalDatabaseBuilder,
  timestampMillis
} from "@gungorbasa/retrievalkit";

const builder = new RetrievalDatabaseBuilder({
  corpusId: "notes",
  metric: "cosine"
});
await builder.add([
  {
    id: "welcome",
    text: "Private local retrieval",
    embedding: new Float32Array([0.1, 0.2, 0.3]),
    metadata: { updatedAt: timestampMillis(1_700_000_000_000n) }
  }
]);

const database = await builder.build();
try {
  const results = await database.search({
    mode: "hybrid",
    text: "local search",
    embedding: new Float32Array([0.1, 0.2, 0.3]),
    alpha: 0.6,
    limit: 5
  });
} finally {
  await database.close();
}

search() is the single retrieval family:

  • { mode: "vector", embedding } performs exact vector search.
  • { mode: "text", text } performs BM25-only search (alpha = 0).
  • { mode: "hybrid", text, embedding?, alpha } uses Rust-owned candidate generation and fusion. At alpha = 0, the embedding may be omitted.

The first document embedding fixes the dimension in Rust. Add documents in bulk before build(). Embeddings always remain caller-provided Float32Arrays. Results expose documentId; internal chunk IDs and chunk keys are not part of the common API.

All native operations return promises. Await close() in finally on every supported Node.js version. Node.js 24 callers may use await using instead. Operations after close reject with RetrievalKitLifecycleError. Persistence uses save, load, and read-only validate; loaded indexes stay resident during search.

Metadata supports strings, booleans, integer bigints, floating-point values, and timestampMillis. Plain safe integral numbers become integers; use floatingPoint(7) when an integral-looking value must retain float type.

Do not load this package together with @gungorbasa/retrievalkit-graph in one process. The loader rejects the second aggregate.