Skip to main content

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.

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.6.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.6.0.tar.gz.

File metadata

  • Download URL: llama_index_vector_stores_hnswlib-0.6.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_vector_stores_hnswlib-0.6.0.tar.gz
Algorithm Hash digest
SHA256 6de38ef8141a64a5fa9e1b1185b76ce6a5200e603e2e8d7a4c80a63b8eec249a
MD5 29577c10f99f42d08e8c625cc400aa88
BLAKE2b-256 5f52cc31b7160b8cd03f9945072c20cde87180de720a5148cb94542b9052b519

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llama_index_vector_stores_hnswlib-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_vector_stores_hnswlib-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 27ed3c4e44fc23f7a793dfcf5ce4fd5e8bf507c494f40d1eaabc0b67b2e9f30f
MD5 228c4f570fb30fd2e73fe0479ceb67dc
BLAKE2b-256 9ec5573bfcd8d970135c993622c69aae3fd03f10e9820b7dc76763edea8b0794

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page