Skip to main content

llama-index vector_stores hnswlib integration

Project description

LlamaIndex Vector_Stores Integration: Hnswlib

A LlamaIndex vector store using Hnswlib, a header-only C++ HNSW implementation with python bindings.

Usage

Pre-requisite:

pip install llama-index-vector-stores-hnswlib
pip install hnswlib

A minimal example:

import hnswlib
from llama_index.vector_stores_hnswlib import HnswlibVectorStore

space = "ip"  # distance function
dim = 768  # embedding dimension
hnswlib_index = hnswlib.Index(space, dim)
hnswlib_index.init_index(max_elements=10)

hnsw_vector_store = HnswlibVectorStore(hnswlib_index=index)

More examples and references

A detailed usage guede can be found in this demo notebook in the LlamaIndex docs.

Hnswlib documentation and implementation can be found here.

Project details


Download files

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

Source Distribution

llama_index_vector_stores_hnswlib-0.4.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file llama_index_vector_stores_hnswlib-0.4.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_vector_stores_hnswlib-0.4.0.tar.gz
Algorithm Hash digest
SHA256 80c753e841d587572a56809a9020870326ce273a2479142cd33beedcd4139a3a
MD5 131d9e9310847d2ecce09f03f3fee873
BLAKE2b-256 bac13d5ed263dc97f40e28fe3074b89325ac39801684ca1b6f31bb0374752488

See more details on using hashes here.

File details

Details for the file llama_index_vector_stores_hnswlib-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_vector_stores_hnswlib-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b60afd1b48023597aed3dff988fa52898da4fd20f3c86386d68aa56afc3799f8
MD5 da723a7046a6a7536af815498da86570
BLAKE2b-256 ba272d3eb5d1435d6292fdef2c518c451b15fe7056b63985ea1c2c4870ea1052

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