LlamaIndex integration for ZeusDB vector database. Enterprise-grade RAG with high-performance vector search.
Project description
LlamaIndex ZeusDB Integration
ZeusDB vector database integration for LlamaIndex. Connect LlamaIndex's RAG framework with high-performance, enterprise-grade vector database.
Features
- Production Ready: Built for enterprise-scale RAG applications
- Persistence: Complete save/load functionality with cross-platform compatibility
- Advanced Filtering: Comprehensive metadata filtering with complex operators
- MMR Support: Maximal Marginal Relevance for diverse, non-redundant results
- Quantization: Product Quantization (PQ) for memory-efficient vector storage
- Async Support: Async wrappers for non-blocking operations (
aadd,aquery,adelete_nodes)
Installation
pip install llama-index-vector-stores-zeusdb
Quick Start
from llama_index.core import VectorStoreIndex, Document, StorageContext
from llama_index.vector_stores.zeusdb import ZeusDBVectorStore
from llama_index.embeddings.openai import OpenAIEmbedding
from llama_index.llms.openai import OpenAI
from llama_index.core import Settings
# Set up embedding model and LLM
Settings.embed_model = OpenAIEmbedding(model="text-embedding-3-small")
Settings.llm = OpenAI(model="gpt-5")
# Create ZeusDB vector store
vector_store = ZeusDBVectorStore(
dim=1536, # OpenAI embedding dimension
distance="cosine",
index_type="hnsw"
)
# Create storage context
storage_context = StorageContext.from_defaults(vector_store=vector_store)
# Create documents
documents = [
Document(text="ZeusDB is a high-performance vector database."),
Document(text="LlamaIndex provides RAG capabilities."),
Document(text="Vector search enables semantic similarity.")
]
# Create index and store documents
index = VectorStoreIndex.from_documents(
documents,
storage_context=storage_context
)
# Query the index
query_engine = index.as_query_engine()
response = query_engine.query("What is ZeusDB?")
print(response)
Advanced Features
Persistence
Save and load indexes with complete state preservation:
# Save index to disk
vector_store.save_index("my_index.zdb")
# Load index from disk
loaded_store = ZeusDBVectorStore.load_index("my_index.zdb")
MMR Search
Balance relevance and diversity for comprehensive results:
from llama_index.core.vector_stores.types import VectorStoreQuery
# Query with MMR for diverse results
query_embedding = embed_model.get_text_embedding("your query")
results = vector_store.query(
VectorStoreQuery(query_embedding=query_embedding, similarity_top_k=5),
mmr=True,
fetch_k=20,
mmr_lambda=0.7 # 0.0=max diversity, 1.0=pure relevance
)
# Note: MMR automatically enables return_vector=True for diversity calculation
# Results contain ids and similarities (nodes=None)
Quantization
Reduce memory usage with Product Quantization:
vector_store = ZeusDBVectorStore(
dim=1536,
distance="cosine",
quantization_config={
'type': 'pq',
'subvectors': 8,
'bits': 8,
'training_size': 1000,
'storage_mode': 'quantized_only'
}
)
Async Operations
Non-blocking operations for web servers and concurrent workflows:
import asyncio
# Async add
node_ids = await vector_store.aadd(nodes)
# Async query
results = await vector_store.aquery(query_obj)
# Async delete
await vector_store.adelete_nodes(node_ids=["id1", "id2"])
Metadata Filtering
Filter results by metadata:
from llama_index.core.vector_stores.types import (
MetadataFilters,
FilterOperator,
FilterCondition
)
# Create metadata filter
filters = MetadataFilters.from_dicts([
{"key": "category", "value": "tech", "operator": FilterOperator.EQ},
{"key": "year", "value": 2024, "operator": FilterOperator.GTE}
], condition=FilterCondition.AND)
# Query with filters
results = vector_store.query(
VectorStoreQuery(
query_embedding=query_embedding,
similarity_top_k=5,
filters=filters
)
)
Supported operators: EQ, NE, GT, GTE, LT, LTE, IN, NIN, ANY, ALL, CONTAINS, TEXT_MATCH, TEXT_MATCH_INSENSITIVE
Configuration
| Parameter | Description | Default |
|---|---|---|
dim |
Vector dimension | Required |
distance |
Distance metric (cosine, l2, l1) |
cosine |
index_type |
Index type (hnsw) |
hnsw |
m |
HNSW connectivity parameter | 16 |
ef_construction |
HNSW build-time search depth | 200 |
expected_size |
Expected number of vectors | 10000 |
quantization_config |
PQ quantization settings | None |
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_vector_stores_zeusdb-0.1.4.tar.gz.
File metadata
- Download URL: llama_index_vector_stores_zeusdb-0.1.4.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
358a58ad5b55c71e9c335b2221991d960e49c4e787e665b6058383ae11b96dce
|
|
| MD5 |
b86dcb1761ebab5debd9715a96426f83
|
|
| BLAKE2b-256 |
263e975ae3b33dc7d7065297530846d76ac8332153e61f6f0b034bbfd9d0dfad
|
Provenance
The following attestation bundles were made for llama_index_vector_stores_zeusdb-0.1.4.tar.gz:
Publisher:
publish-pypi.yml on ZeusDB/llama-index-vector-stores-zeusdb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llama_index_vector_stores_zeusdb-0.1.4.tar.gz -
Subject digest:
358a58ad5b55c71e9c335b2221991d960e49c4e787e665b6058383ae11b96dce - Sigstore transparency entry: 653529178
- Sigstore integration time:
-
Permalink:
ZeusDB/llama-index-vector-stores-zeusdb@bca4152e82a006da83fb1bfe663366135000f0e9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ZeusDB
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@bca4152e82a006da83fb1bfe663366135000f0e9 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file llama_index_vector_stores_zeusdb-0.1.4-py3-none-any.whl.
File metadata
- Download URL: llama_index_vector_stores_zeusdb-0.1.4-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8d53bcb2889f9db2e68693a0f99b2293571de8d67299eab2d43c72453ee1b5b
|
|
| MD5 |
c84e831e686dc35e918fa3d5cb917455
|
|
| BLAKE2b-256 |
a7f9a740f2b0404b711e6356c9bae08d10fa9c57e50d303b400555ffb6e27183
|
Provenance
The following attestation bundles were made for llama_index_vector_stores_zeusdb-0.1.4-py3-none-any.whl:
Publisher:
publish-pypi.yml on ZeusDB/llama-index-vector-stores-zeusdb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llama_index_vector_stores_zeusdb-0.1.4-py3-none-any.whl -
Subject digest:
d8d53bcb2889f9db2e68693a0f99b2293571de8d67299eab2d43c72453ee1b5b - Sigstore transparency entry: 653529180
- Sigstore integration time:
-
Permalink:
ZeusDB/llama-index-vector-stores-zeusdb@bca4152e82a006da83fb1bfe663366135000f0e9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ZeusDB
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@bca4152e82a006da83fb1bfe663366135000f0e9 -
Trigger Event:
workflow_dispatch
-
Statement type: