Files
lancedb/nodejs
Xuanwo e185dc8646 perf: raise the default Blob V2 direct-read threshold to 32 MiB (#5248)
Enterprise SDKs use an inclusive 32 MiB default for eligible Blob V2
direct reads. The paired field comparison with the 10 MiB SDK default
measured higher direct-read latency at 10 and 16 MiB. At 32 MiB, the
interval for the latency difference spanned zero. [SDK version used in
the field comparison](https://github.com/lancedb/lancedb/pull/5247)

The earlier mixed-load test measured lower Plan Executor cache pressure
with direct reads enabled at the 10 MiB cutoff. That result covers the
tested size mix. With the 32 MiB cutoff, reads from 10 MiB up to (but
excluding) 32 MiB go through the proxy, so the impact on executor
traffic and cache pressure depends on the workload's size distribution.

The existing internal override still takes precedence. Direct reads keep
the 16 MiB part size. The Node binding test verifies proxy routing one
byte below the default and two contiguous object-store ranges with a
matching SHA-256 at exactly 32 MiB.
2026-11-28 03:21:37 +08:00
..
2025-01-29 08:27:07 -08:00

LanceDB JavaScript SDK

A JavaScript library for LanceDB.

Installation

npm install @lancedb/lancedb

This will download the appropriate native library for your platform. We currently support:

  • Linux (x86_64 and aarch64 on glibc and musl)
  • MacOS (Intel and ARM/M1/M2)
  • Windows (x86_64 and aarch64)

Usage

Basic Example

import * as lancedb from "@lancedb/lancedb";
const db = await lancedb.connect("data/sample-lancedb");
const table = await db.createTable("my_table", [
  { id: 1, vector: [0.1, 1.0], item: "foo", price: 10.0 },
  { id: 2, vector: [3.9, 0.5], item: "bar", price: 20.0 },
]);
const results = await table.vectorSearch([0.1, 0.3]).limit(20).toArray();
console.log(results);

The quickstart contains more complete examples.

Development

See CONTRIBUTING.md for information on how to contribute to LanceDB.