Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
760 changes: 760 additions & 0 deletions docs/examples/vector_stores/ZeusDBIndexDemo.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ as the storage backend for `VectorStoreIndex`.
- Weaviate (`WeaviateVectorStore`). [Installation](https://weaviate.io/developers/weaviate/installation). [Python Client](https://weaviate.io/developers/weaviate/client-libraries/python).
- WordLift (`WordliftVectorStore`). [Quickstart](https://docs.wordlift.io/llm-connectors/wordlift-vector-store/). [Python Client](https://pypi.org/project/wordlift-client/).
- Zep (`ZepVectorStore`). [Installation](https://docs.getzep.com/deployment/quickstart/). [Python Client](https://docs.getzep.com/sdk/).
- ZeusDB (`ZeusDBVectorStore`). [Installation/Quickstart](https://docs.zeusdb.com/en/latest/vector_database/getting_started.html)
- Zilliz (`MilvusVectorStore`). [Quickstart](https://zilliz.com/doc/quick_start)

A detailed API reference is [found here](/python/framework-api-reference/storage/vector_store).
Expand Down Expand Up @@ -958,6 +959,47 @@ retriever = index.as_retriever(filters=filters)
result = retriever.retrieve("What is inception about?")
```

**ZeusDB**

```python
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)
```

**Zilliz**

- Zilliz Cloud (hosted version of Milvus) uses the Milvus Index with some extra arguments.
Expand Down Expand Up @@ -1200,3 +1242,4 @@ documents = reader.load_data(
- [Weaviate Hybrid Search](/python/examples/vector_stores/weaviateindexdemo-hybrid)
- [WordLift](/python/examples/vector_stores/wordliftdemo)
- [Zep](/python/examples/vector_stores/zepindexdemo)
- [ZeusDB](/python/examples/vector_stores/zeusdbindexdemo)
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ We are actively adding more integrations and improving feature coverage for each
| Vertex AI Vector Search | cloud | ✓ | | ✓ | ✓ | |
| Weaviate | self-hosted / cloud | ✓ | ✓ | ✓ | ✓ | |
| WordLift | cloud | ✓ | ✓ | ✓ | ✓ | ✓ |
| ZeusDB | self-hosted / cloud | ✓ | ✓ | ✓ | ✓ | ✓ |

For more details, see [Vector Store Integrations](/python/framework/community/integrations/vector_stores).

Expand Down Expand Up @@ -130,3 +131,4 @@ For more details, see [Vector Store Integrations](/python/framework/community/in
- [Weaviate Hybrid Search](/python/examples/vector_stores/weaviateindexdemo-hybrid)
- [WordLift](/python/examples/vector_stores/wordliftdemo)
- [Zep](/python/examples/vector_stores/zepindexdemo)
- [ZeusDB](/python/examples/vector_stores/zeusdbindexdemo)
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
llama_index/_static
.DS_Store
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
bin/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
etc/
include/
lib/
lib64/
parts/
sdist/
share/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
.ruff_cache

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints
notebooks/

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
pyvenv.cfg

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Jetbrains
.idea
modules/
*.swp

# VsCode
.vscode

# pipenv
Pipfile
Pipfile.lock

# pyright
pyrightconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python_sources()
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<!-- markdownlint-disable MD024 -->

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

---

## [0.1.3] - 2025-10-28

### Added

- Added `.venv` to the `mypy` exclude list to improve compatibility with local development environments.

### Changed

- Bumped `llama-index-core` to `>=0.14.6` to match the latest LlamaIndex release (Oct 26, 2025).
- Updated `llama-index-llms-openai` development dependency to `>=0.6.6`.
- Updated `pyproject.toml` build includes for proper source distribution packaging (relative paths under `[tool.hatch.build.targets.sdist]`).

---

## [0.1.2] - 2025-10-16

### Changed

- **Async API naming**: Renamed `add()` to `async_add()` to align with LlamaIndex standard async method naming conventions. The adapter now uses the official LlamaIndex async API (`async_add`, `aquery`, `adelete`, `adelete_nodes`, `aclear`) for consistency across the ecosystem.
- Updated async examples to use standard LlamaIndex async method names instead of custom aliases.
- Updated documentation strings to reference `async_add()` instead of `add()`.

---

## [0.1.1] - 2025-10-14

### Added

- Delete examples - Added `examples/delete_examples.py` demonstrating supported deletion operations and workarounds.
- Test coverage - Added tests for ID-based deletion and proper error handling for unsupported operations.
- Added Product **Quantization (PQ) support** - Full support for memory-efficient vector compression with automatic training
- **Persistence Support**: Complete save/load functionality for ZeusDB indexes
- Save indexes to disk with `save_index(path)`
- Load indexes from disk with `load_index(path)`
- Preserves vectors, metadata, HNSW graph structure, and quantization configuration
- Directory-based format (.zdb) with JSON metadata and binary data files
- Cross-platform compatibility for sharing indexes between systems
- Added comprehensive persistence examples (`examples/persistence_examples.py`)
- **Async Support**: Full asynchronous operation support for non-blocking workflows
- `add()` - Add nodes asynchronously
- `aquery()` - Query asynchronously
- `adelete_nodes()` - Delete nodes by IDs asynchronously
- Thread-offloaded async wrappers using `asyncio.to_thread()`
- **MMR (Maximal Marginal Relevance) Search**: Diversity-focused retrieval for comprehensive results
- Balance relevance and diversity with `mmr_lambda` parameter (0.0-1.0)
- Control candidate pool size with `fetch_k` parameter
- Prevents redundant/similar results in search responses
- Perfect for RAG applications, research, and multi-perspective retrieval
- Added comprehensive async examples (`examples/async_examples.py`)
- Added MMR examples (`examples/mmr_examples.py`)

### Changed

- Filter format alignment — Updated \_filters_to_zeusdb() to produce a flat dictionary with implicit AND (e.g., { "key": value, "other": { "op": value } }) instead of a nested {"and": [...]} structure, matching the Rust implementation.
- Test infrastructure — Updated \_match_filter() in the test fake from the nested format to the flat format to reflect production behavior.

### Fixed

- Filter translation for metadata queries - \_filters_to_zeusdb() now emits the flat format expected by the ZeusDB backend. Single filters and AND combinations are handled correctly. The previous nested format could cause filtered queries to return zero results.
- Deletion behavior - Correctly implemented ID-based deletion using `remove_point()`. Delete operations now properly remove vectors from the index and update vector counts.

---

## [0.1.0] - 2025-09-19

### Added

- Initial release of ZeusDB vector database integration for LlamaIndex.
- Support for connecting LlamaIndex’s RAG framework with ZeusDB for high-performance retrieval.
- Trusted Publishing workflow for PyPI releases via GitHub Actions.
- Build validation workflow to check distributions without publishing.
- Documentation updates including project description and setup instructions.

---

## [Unreleased]

### Added

<!-- Add new features here -->

### Changed

<!-- Add changed behavior here -->

### Fixed

<!-- Add bug fixes here -->

### Removed

<!-- Add removals/deprecations here -->

---
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 ZeusDB

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
GIT_ROOT ?= $(shell git rev-parse --show-toplevel)

help: ## Show all Makefile targets.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[33m%-30s\033[0m %s\n", $$1, $$2}'

format: ## Run code autoformatters (black).
pre-commit install
git ls-files | xargs pre-commit run black --files

lint: ## Run linters: pre-commit (black, ruff, codespell) and mypy
pre-commit install && git ls-files | xargs pre-commit run --show-diff-on-failure --files

test: ## Run tests via pytest.
pytest tests

watch-docs: ## Build and watch documentation.
sphinx-autobuild docs/ docs/_build/html --open-browser --watch $(GIT_ROOT)/llama_index/
Loading