SDKs Overview

brinicle provides official SDK clients for communicating with the brinicle HTTP server. Each SDK wraps the REST API and binary protocols into a clean, idiomatic interface for its respective language.

Available SDKs

LanguagePackageRegistryInstall
PHPbicardinal/brinicle-phpComposercomposer require bicardinal/brinicle-php
Laravelbicardinal/brinicle-laravelComposercomposer require bicardinal/brinicle-laravel
TypeScript@bicardinal/briniclenpmnpm install @bicardinal/brinicle
Pythonbrinicle-clientPyPIpip install brinicle-client
Gogithub.com/bicardinal/brinicle-goGo Modulesgo get github.com/bicardinal/brinicle-go

Common Pattern

All SDKs follow the same general pattern, mirroring the HTTP API:
  1. Create a client — Connect to the brinicle server
  2. Create an index — Set up a new vector index with dimensions and parameters
  3. Initialize an ingest session — Start building, inserting, or upserting
  4. Ingest data — Add vectors one at a time or in batches
  5. Finalize — Complete the ingest and build the HNSW graph
  6. Search — Query the index for nearest neighbors
  7. Maintain — Delete, rebuild, and optimize as needed

Binary Protocols

The batch ingest and search operations use binary protocols for maximum performance:
  • Batch ingest: Each row is a 32-byte null-padded ASCII ID followed by dim * 4 bytes of float32 little-endian vector data
  • Search: The query vector is sent as dim * 4 bytes of float32 little-endian data
All SDKs handle the binary encoding internally, so you don’t need to worry about byte-level details.

Connection Configuration

All SDKs allow you to configure the server URL and connection timeout:
SDKDefault URLDefault Timeout
PHPhttp://localhost:198430s
Laravelvia config/envvia config/env
TypeScripthttp://localhost:198430s
Pythonhttp://localhost:198430s
Gohttp://localhost:198430s

Error Handling

All SDKs provide a consistent error hierarchy:
Error TypeHTTP StatusDescription
Connection ErrorCould not connect to the server
Validation Error400Invalid request parameters
Not Found Error404Index not found
Conflict Error409Index already exists
Server Error5xxInternal server error

Quick Comparison

Create Index

use Bicardinal\Brinicle\BrinicleClient;

$client = new BrinicleClient('http://localhost:1984');
$client->createIndex('my_index', dim: 128);
$results = $client->search('my_index', [0.1, 0.2, 0.3], k: 5);