Introduction

A complete search engine and RAG pipeline in your browser, server or edge network with support for full-text, vector, and hybrid search in less than 2kb.

ZBSearch (zee bee search) is a zero-bs fork of Orama maintained by the original Orama team. After Michele's departure, the entire engineering team left Orama and reassembled to maintain this popular project with no external influence. No VC, no business incentives, no bs. Just open source software.

ZBSearch is an open source, high performance full-text and vector search engine entirely written in TypeScript, with zero dependencies.

Performance vs Orama

ZBSearch is a drop-in fork of Orama with the same API and persistence format, but with heavily optimized internals - including explicit postings lists for the full-text inverted index. We benchmark both engines head-to-head in the benchmarks/ suite (Orama 3.1.18 vs ZBSearch 4.0.0, August 2026). The headline: ZBSearch wins 18 of 20 head-to-head metrics - faster on every query path, with better ranking quality, lower memory use, and a smaller on-disk bundle. Full results are on the ZBSearch vs Orama page.

AreaZBSearch vs OramaHighlight
Indexing~42–43% faster26.1 ops/s full-dataset insert vs 15.2
Full-text search7–56% faster73,090 ops/s plain search vs 31,928
Search quality (BEIR)2× macro nDCG@100.453 vs 0.222, at 3× lower query latency
Facets27–57% fasterFaster across every facet scenario tested
Vector search (flat)13–33% faster6,128 ops/s strict similarity vs 4,133
Vector search (IVF)3.2–5.3× faster11,810 ops/s vector search - Orama has no IVF equivalent
Geosearchup to ~75× faster275,793 ops/s on 500m radius vs 3,702
Sorted indexes (AVL)2–54% fasterFaster on every AVL operation, including removes
Memory footprint20–41% lower11.68 MB indexed heap delta vs 14.69 MB
Persistence42% smaller3.03 MB serialized JSON vs 5.23 MB

Requirements

A JavaScript runtime is the only requirement. ZBSearch has been designed to work on any JS runtime and has no dependencies.

Installation

You can install ZBSearch using any JavaScript package manager of your choice.

npm i zbsearch

Or import it directly in a browser module:

<html>
  <body>
    <script type="module">
      import {
        create,
        search,
        insert,
      } from "https://cdn.jsdelivr.net/npm/zbsearch@latest/+esm";

      // ...
    </script>
  </body>
</html>

Basic usage

import { create, search, insert } from "zbsearch";

// Create a new ZBSearch instance
const db = create({
  schema: {
    name: "string",
    description: "string",
    price: "number",
    meta: {
      rating: "number",
    },
  },
});

// Insert documents into the database
insert(db, {
  name: "Wireless Headphones",
  description: "Experience immersive sound quality with these noise-cancelling wireless headphones.",
  price: 99.99,
  meta: {
    rating: 4.5,
  },
});

// Search for documents
const searchResult = search(db, {
  term: "headphones",
});

console.log(searchResult.hits.map((hit) => hit.document));

For more information, check out the Usage section.

CommonJS Imports

ZBSearch ships ESM modules by default. This allows us to move faster when providing new features and bug fixes, as well as using the "exports" field in package.json to provide a better developer experience.

CommonJS imports are still supported, but we suggest you to migrate to ESM.

TypeScript

Set moduleResolution in the compilerOptions in your tsconfig.json to be either Node16 or NodeNext.

When importing types, always refer to the standard zbsearch import:

import type { Language } from "zbsearch";

On this page