Elffuss BraidHub

kikocis/lancedb public

main · 1.2 KiBRenderedRawPermalink
1# LanceDB
2
3A JavaScript / Node.js library for [LanceDB](https://github.com/lancedb/lancedb).
4
5## Installation
6
7```bash
8npm install vectordb
9```
10
11This will download the appropriate native library for your platform. We currently
12support:
13
14* Linux (x86_64 and aarch64)
15* MacOS (Intel and ARM/M1/M2)
16* Windows (x86_64 only)
17
18We do not yet support musl-based Linux (such as Alpine Linux) or aarch64 Windows.
19
20## Usage
21
22### Basic Example
23
24```javascript
25const lancedb = require('vectordb');
26const db = await lancedb.connect('data/sample-lancedb');
27const table = await db.createTable("my_table",
28 [{ id: 1, vector: [0.1, 1.0], item: "foo", price: 10.0 },
29 { id: 2, vector: [3.9, 0.5], item: "bar", price: 20.0 }])
30const results = await table.search([0.1, 0.3]).limit(20).execute();
31console.log(results);
32```
33
34The [examples](./examples) folder contains complete examples.
35
36## Development
37
38To build everything fresh:
39
40```bash
41npm install
42npm run build
43```
44
45Then you should be able to run the tests with:
46
47```bash
48npm test
49```
50
51### Fix lints
52
53To run the linter and have it automatically fix all errors
54
55```bash
56npm run lint -- --fix
57```
58
59To build documentation
60
61```bash
62npx typedoc --plugin typedoc-plugin-markdown --out ../docs/src/javascript src/index.ts
63```