ZBSearch

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 3.3.0, July 2026). The headline: ZBSearch is faster on almost every query path, with lower memory use and a smaller on-disk bundle. Full results are on the ZBSearch vs Orama page.

AreaZBSearch vs OramaHighlight
Full-text search11–58% fasterUp to 12,415 ops/s on long-text + complex filters vs 5,252
Facets28–56% fasterFaster across every facet scenario tested
Vector search (flat)16–52% faster6,889 ops/s strict similarity vs 4,532
Vector search (IVF)~350–1,270% faster30,530 ops/s vector search - Orama has no IVF equivalent
Geosearch~8,400% faster308,894 ops/s on 500m radius vs 3,649
Sorted indexes (AVL)12–54% faster54% faster on narrow range search; ~equal on comparisons
Memory footprint6–8% lower15.69 MB indexed heap delta vs 17.12 MB
Persistence4–7% smaller5.51 MB serialized JSON vs 5.72 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