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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for llama_index_vector_stores_hnswlib-0.1.0.tar.gz
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | 68c3b9fee7a134bf3fd0577f7092abf8d27a346a9a89936e2b779969bae9f5fb |
|
| MD5 | a08a13812f60c90f0f2bd648b7baac0d |
|
| BLAKE2b-256 | fa404137f2249342ebca468f5b5a2b201846eafd1a1e4abb6336263bb2e14bfc |
Close
Hashes for llama_index_vector_stores_hnswlib-0.1.0-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | 55fbbce9038a5b81e309e62ebfdbd479d7e796c4e1b65531d8e0ecac2c6d9e0e |
|
| MD5 | bccb56218cd89ad208be0520c22b74fb |
|
| BLAKE2b-256 | 79ff605cad8f4539cc67ccb0432bdf27838eba135fe9bea6e148c7be2e9ee551 |