BVector by BangDBBVector
BVector

API Reference

BVector exposes a JSON REST API over HTTP. All endpoints require a Bearer token in the Authorization header.

Base URL

http://<your-instance>:18080/api/v1

Endpoints

GET/indexes
POST/indexes
GET/indexes/:name
DELETE/indexes/:name
POST/indexes/:name/vectors
GET/indexes/:name/vectors/:id
DELETE/indexes/:name/vectors/:id
POST/indexes/:name/query
GET/health

Create index

POST /api/v1/indexes
Authorization: Bearer <api-key>
Content-Type: application/json

{
  "name": "my-index",
  "dimension": 1536,
  "metric": "cosine"
}

// 201 Created
{
  "id": "idx_01HXYZ",
  "name": "my-index",
  "dimension": 1536,
  "metric": "cosine",
  "createdAt": "2024-01-15T10:30:00Z"
}

Upsert vectors

POST /api/v1/indexes/my-index/vectors
Authorization: Bearer <api-key>
Content-Type: application/json

{
  "vectors": [
    {
      "id": "doc-001",
      "values": [0.12, -0.45, 0.89, ...],
      "metadata": {
        "source": "wikipedia",
        "title": "Machine Learning"
      }
    }
  ]
}

// 200 OK
{ "upserted": 1 }

Query nearest neighbors

POST /api/v1/indexes/my-index/query
Authorization: Bearer <api-key>
Content-Type: application/json

{
  "vector": [0.12, -0.45, 0.89, ...],
  "topK": 5,
  "includeMetadata": true,
  "filter": { "source": "wikipedia" }
}

// 200 OK
{
  "matches": [
    {
      "id": "doc-001",
      "score": 0.9823,
      "metadata": { "source": "wikipedia", "title": "Machine Learning" }
    }
  ]
}

🍪 Cookie Notice

We use cookies to ensure that we give you the best experience on our website. Read cookies policies.