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. We benchmark both engines head-to-head in the benchmarks/ suite (Orama 3.1.18 vs ZBSearch 3.2.1, July 2026). The headline: ZBSearch is faster on almost every query path, with no trade-off in indexing speed or on-disk size. Full results are on the ZBSearch vs Orama page.

AreaZBSearch vs OramaHighlight
Full-text search14–61% fasterUp to 15,219 ops/s on long-text + complex filters vs 5,976
Facets30–59% fasterFaster across every facet scenario tested
Vector search (flat)12–56% faster7,558 ops/s strict similarity vs 4,864
Vector search (IVF)~225–508% faster19,301 ops/s with filters - Orama has no IVF equivalent
Geosearch~8,700% faster384,158 ops/s on 500m radius vs 4,359
Sorted indexes (AVL)10–107% faster107% faster on narrow range search; ~equal on comparisons
PersistenceIdenticalSame JSON and GZIP size for the same dataset

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