Skip to main content

brinicle is a C++ vector index engine (ANN library) optimized for disk-first, low-RAM similarity search.

Project description

brinicle

brinicle is a C++ vector index engine (ANN library) optimized for disk-first, low-RAM similarity search. It provides fast build + query, supports inserts/upserts/deletes, and targets predictable latency at high recall with minimal memory overhead on constrained environments.

Install

You can either download via pip:

pip install brinicle

Or compile the code:

git clone https://github.com/bicardinal/brinicle.git
cd brinicle
bash build.sh

Usage

import numpy as np
import brinicle

D = 2
n = 5
X = np.random.randn(n, D).astype(np.float32)
Q = np.random.randn(D).astype(np.float32)

engine = brinicle.VectorEngine("test_index", dim=D, delta_ratio=0.1)

engine.init(mode="build")
for eid in range(n):
    engine.ingest(str(eid), X[eid])
engine.finalize()

print(engine.search(Q, k=10)) # returns a list of ids

To insert:

Y = np.random.randn(5, D).astype(np.float32)
engine.init(mode="insert")
for eid in range(5):
    engine.ingest(str(eid) + "x", Y[eid])
engine.finalize()
print(engine.search(Q, k=10))

To upsert:

Y = np.random.randn(5, D).astype(np.float32)
engine.init(mode="upsert")
for eid in range(5):
    engine.ingest(str(eid), Y[eid])
engine.finalize()
print(engine.search(Q, k=10))

To delete:

engine.delete_items(["1", "4"])
print(engine.search(Q, k=10))

To re-build:

engine.optimize_graph()
print(engine.search(Q, k=10))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

brinicle-0.0.4-cp314-cp314t-musllinux_1_2_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

brinicle-0.0.4-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (366.7 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

brinicle-0.0.4-cp314-cp314-musllinux_1_2_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

brinicle-0.0.4-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (364.4 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

brinicle-0.0.4-cp313-cp313-musllinux_1_2_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

brinicle-0.0.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (364.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

brinicle-0.0.4-cp312-cp312-musllinux_1_2_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

brinicle-0.0.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (363.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

brinicle-0.0.4-cp311-cp311-musllinux_1_2_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

brinicle-0.0.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (360.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

brinicle-0.0.4-cp310-cp310-musllinux_1_2_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

brinicle-0.0.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (359.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file brinicle-0.0.4-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for brinicle-0.0.4-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 67dff9947a1479442bdb024cb70431e335260a361d304bf101090ec3e0dec437
MD5 d873dc3928b49e86b8514a0c96bda702
BLAKE2b-256 007c91da5ac1596d6cf7348b9c8aec50543c506b0cd0796076299c639ffd9a36

See more details on using hashes here.

File details

Details for the file brinicle-0.0.4-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for brinicle-0.0.4-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bab95a10d57ad06d41518658a6de42ffe4c6c235803c7e1452f1a3f417b6480d
MD5 b0b36c699a976f2c044d845ab3cffdd2
BLAKE2b-256 0017c42220f48a0ffa967b98ab72c4f55c393263b9929e1456762bf69d566352

See more details on using hashes here.

File details

Details for the file brinicle-0.0.4-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for brinicle-0.0.4-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 da97a574aab81ba3f27f6e24b92d33b0fe3f099b6371a9ff1f47ff5e0e66d11a
MD5 50f56853df4bd61d6400b7f7e6508f8e
BLAKE2b-256 23281cd8a67226bb51cc8ee7e6f8c3fa894b0709bfae2bd881b4e5761339cd55

See more details on using hashes here.

File details

Details for the file brinicle-0.0.4-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for brinicle-0.0.4-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bd19c1b7041b077b790526f574cfec132a01c39ff7ed3da636f7fe32c47eeb8c
MD5 cb609f755a611e7495c0550c8fdeddee
BLAKE2b-256 5f9942f6e0f9e4992eacc450b03aef5c7137799a98ada618aee4f2c01f92e353

See more details on using hashes here.

File details

Details for the file brinicle-0.0.4-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for brinicle-0.0.4-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4818fff24edff50472e2303e75222cb54e24644b1c749090116b794cd0aea279
MD5 55300df3e3d8ae540f41728ddb724731
BLAKE2b-256 82b1586ba4fce6db0880f1f6178cefc2a6352daa348f844404e62d98627c89d1

See more details on using hashes here.

File details

Details for the file brinicle-0.0.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for brinicle-0.0.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 977cee9b94135614682563c28a8be094dc5f8588a1a4db8076a3f5a6b64a783a
MD5 1a9af3ecc3913b649cf51b1e4a40aa83
BLAKE2b-256 c0e9420e924276656b68662e84377ead570cba5a589c80a86445125653915974

See more details on using hashes here.

File details

Details for the file brinicle-0.0.4-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for brinicle-0.0.4-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 683aab80713e54ee013664ede3a4d3050a241c6f3c2358921abd03e12153cfb6
MD5 753b161baef70d7e7f759938c408ab46
BLAKE2b-256 e95e91d94ad19d406e6c59d372a92dcb83752d5905b894b8bf52830f7676047e

See more details on using hashes here.

File details

Details for the file brinicle-0.0.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for brinicle-0.0.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d9703547f60b509dc10b64ea1fcda6c559da8de287558d16266af30fb9d67c48
MD5 520aec8dc65a5f658ec0a4c5b7cf1947
BLAKE2b-256 eb6026243a54180f1f72d3069c68dca211037fd7f3ad2b7ad2968cd256a639d0

See more details on using hashes here.

File details

Details for the file brinicle-0.0.4-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for brinicle-0.0.4-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3306021f4a0a2f09740d4bc51e27394e2d08ccf4ec42081cff6227949d23422e
MD5 ec46095974e4b4629eb953656c367c9e
BLAKE2b-256 d8b651cd51b061e86444b455c2402972021ed05850ed00d0f500c8a886162c7b

See more details on using hashes here.

File details

Details for the file brinicle-0.0.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for brinicle-0.0.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0a1175f2af05ebc726d82b3bc6cd015c398bf1d966d083e0bc87db335c970cce
MD5 3ccc10c077cf3087545a74b0fb6d9fad
BLAKE2b-256 b45abcda021f301b36ed5cddc7a430940136520490ae9a57363a113a827465ee

See more details on using hashes here.

File details

Details for the file brinicle-0.0.4-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for brinicle-0.0.4-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 966ba9164de725970b8415009b18c1d85b3e7e326ef0175a08cc6885145b960f
MD5 9ae390c1942a4df1e02367f210281d18
BLAKE2b-256 9409e3eabea42dd6a9676d3b93ce45dad80ec88165c5146e58f2ab131f73fc69

See more details on using hashes here.

File details

Details for the file brinicle-0.0.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for brinicle-0.0.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 487c4066dcb3eddd22564abda3aa984bc894b5118e48d7b23973a8ec1fd86a2f
MD5 8cdcb497a22ee120dbf67bf2edb46890
BLAKE2b-256 0383b8ad08a4696e0aa08aab881650543d9c10e86aaecbc7f2bea4b2a12ad951

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page