Get started with BVector

Developer quickstart

Install BangDB Client

First, install the Node.js SDK:

npm install bangdb-client
Initialize Client

Setup and initialize your client:

import { BvectorClient } from "bangdb-client";

const client = new BvectorClient({
  apiKey: "****************",
  baseUrl: "vector.bangdb.com",
  port: 18080, // Default 18080
  ssl: true
});
Create Index

Then create an index that is integrated with an embedding model.

const vectorName = "test_vector";
const d = 256;
const M = 16;
const ef_construction = 50;
const distance_method = "cosine";

// Note: Supported distance methods are "cosine", "euclidean" and "hybrid"
  
const response = await client.createIndex({
  name: vectorName,
  dimension: d,
  M,
  distance_method,
  efc: ef_construction,
});