isage-vdb 0.2.0.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- isage_vdb-0.2.0.10/.github/agents/sageVDB-agent.agent.md +51 -0
- isage_vdb-0.2.0.10/.github/copilot-instructions.md +79 -0
- isage_vdb-0.2.0.10/.github/workflows/ci-tests.yml +163 -0
- isage_vdb-0.2.0.10/.github/workflows/quick-test.yml +88 -0
- isage_vdb-0.2.0.10/.gitignore +24 -0
- isage_vdb-0.2.0.10/.pre-commit-config.yaml +89 -0
- isage_vdb-0.2.0.10/.vscode/settings.json +3 -0
- isage_vdb-0.2.0.10/CHANGELOG.md +38 -0
- isage_vdb-0.2.0.10/CMakeLists.txt +214 -0
- isage_vdb-0.2.0.10/LICENSE +21 -0
- isage_vdb-0.2.0.10/MANIFEST.in +12 -0
- isage_vdb-0.2.0.10/PKG-INFO +1048 -0
- isage_vdb-0.2.0.10/README.md +1007 -0
- isage_vdb-0.2.0.10/build.sh +116 -0
- isage_vdb-0.2.0.10/build_manylinux.sh +65 -0
- isage_vdb-0.2.0.10/cmake/FindBLASLAPACK.cmake +125 -0
- isage_vdb-0.2.0.10/cmake/gperftools.cmake +24 -0
- isage_vdb-0.2.0.10/cmake/pybind11_dependency.cmake +27 -0
- isage_vdb-0.2.0.10/docs/USAGE_MODES.md +194 -0
- isage_vdb-0.2.0.10/docs/adr/0001-fail-fast-for-unsupported-algorithm-capabilities.md +36 -0
- isage_vdb-0.2.0.10/docs/adr/0001-persistence-and-multimodal-contract-tests.md +43 -0
- isage_vdb-0.2.0.10/docs/adr/0001-vectorstore-annsregistry-boundary-convergence.md +30 -0
- isage_vdb-0.2.0.10/docs/guides/README_Multimodal.md +288 -0
- isage_vdb-0.2.0.10/docs/ops/CI_TEST.md +1 -0
- isage_vdb-0.2.0.10/docs/ops/DEPLOYMENT.md +194 -0
- isage_vdb-0.2.0.10/docs/ops/RELEASE.md +88 -0
- isage_vdb-0.2.0.10/docs/ops/SUBMODULE.md +99 -0
- isage_vdb-0.2.0.10/docs/ops/TEST_HOOK.md +57 -0
- isage_vdb-0.2.0.10/docs/sage-anns-integration-prompts.md +23 -0
- isage_vdb-0.2.0.10/docs/sage_anns_integration.md +191 -0
- isage_vdb-0.2.0.10/examples/python_persistence_example.py +212 -0
- isage_vdb-0.2.0.10/examples/sage_anns_integration_example.py +98 -0
- isage_vdb-0.2.0.10/hooks/post-commit +110 -0
- isage_vdb-0.2.0.10/hooks/pre-commit +91 -0
- isage_vdb-0.2.0.10/hooks/pre-push +299 -0
- isage_vdb-0.2.0.10/include/sage_vdb/anns/anns_interface.h +322 -0
- isage_vdb-0.2.0.10/include/sage_vdb/common.h +97 -0
- isage_vdb-0.2.0.10/include/sage_vdb/fusion_strategies.h +193 -0
- isage_vdb-0.2.0.10/include/sage_vdb/metadata_store.h +56 -0
- isage_vdb-0.2.0.10/include/sage_vdb/modality_processors.h +240 -0
- isage_vdb-0.2.0.10/include/sage_vdb/multimodal_fusion.h +170 -0
- isage_vdb-0.2.0.10/include/sage_vdb/multimodal_sage_vdb.h +70 -0
- isage_vdb-0.2.0.10/include/sage_vdb/query_engine.h +93 -0
- isage_vdb-0.2.0.10/include/sage_vdb/sage_vdb.h +95 -0
- isage_vdb-0.2.0.10/include/sage_vdb/vector_store.h +55 -0
- isage_vdb-0.2.0.10/pyproject.toml +106 -0
- isage_vdb-0.2.0.10/pytest.ini +49 -0
- isage_vdb-0.2.0.10/python/CMakeLists.txt +97 -0
- isage_vdb-0.2.0.10/python/bindings.cpp +358 -0
- isage_vdb-0.2.0.10/quickstart.sh +204 -0
- isage_vdb-0.2.0.10/sagevdb/__init__.py +197 -0
- isage_vdb-0.2.0.10/sagevdb/_vdb_backend.py +191 -0
- isage_vdb-0.2.0.10/sagevdb/sage_anns.py +297 -0
- isage_vdb-0.2.0.10/sagevdb.code-workspace +11 -0
- isage_vdb-0.2.0.10/src/anns/anns_interface.cpp +104 -0
- isage_vdb-0.2.0.10/src/anns/brute_force_plugin.cpp +352 -0
- isage_vdb-0.2.0.10/src/anns/brute_force_plugin.h +81 -0
- isage_vdb-0.2.0.10/src/anns/faiss_plugin.cpp +793 -0
- isage_vdb-0.2.0.10/src/anns/faiss_plugin.h +112 -0
- isage_vdb-0.2.0.10/src/anns/register_builtin_algorithms.cpp +31 -0
- isage_vdb-0.2.0.10/src/fusion_strategies.cpp +440 -0
- isage_vdb-0.2.0.10/src/metadata_store.cpp +252 -0
- isage_vdb-0.2.0.10/src/modality_manager.cpp +88 -0
- isage_vdb-0.2.0.10/src/modality_processors.cpp +940 -0
- isage_vdb-0.2.0.10/src/multimodal_sage_vdb.cpp +209 -0
- isage_vdb-0.2.0.10/src/query_engine.cpp +336 -0
- isage_vdb-0.2.0.10/src/sage_vdb.cpp +276 -0
- isage_vdb-0.2.0.10/src/vector_store.cpp +504 -0
- isage_vdb-0.2.0.10/tests/test_anns_registry.cpp +34 -0
- isage_vdb-0.2.0.10/tests/test_issue27_registry_boundary_cleanup.py +33 -0
- isage_vdb-0.2.0.10/tests/test_issue28_capability_failfast.py +25 -0
- isage_vdb-0.2.0.10/tests/test_issue29_persistence_contract.py +92 -0
- isage_vdb-0.2.0.10/tests/test_multimodal.cpp +338 -0
- isage_vdb-0.2.0.10/tests/test_persistence.py +262 -0
- isage_vdb-0.2.0.10/tests/test_sage_anns_backend.py +302 -0
- isage_vdb-0.2.0.10/tests/test_sage_anns_perf.py +87 -0
- isage_vdb-0.2.0.10/tests/test_sage_vdb.cpp +263 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'SageVDB development agent for FAISS-like vector database with pluggable ANNS algorithms'
|
|
3
|
+
tools: ['vscode', 'execute', 'read', 'agent', 'edit', 'search', 'web', 'todo', 'vscode.mermaid-chat-features/renderMermaidDiagram', 'github.vscode-pull-request-github/issue_fetch', 'github.vscode-pull-request-github/suggest-fix', 'github.vscode-pull-request-github/searchSyntax', 'github.vscode-pull-request-github/doSearch', 'github.vscode-pull-request-github/renderIssues', 'github.vscode-pull-request-github/activePullRequest', 'github.vscode-pull-request-github/openPullRequest', 'ms-azuretools.vscode-containers/containerToolsConfig', 'ms-python.python/getPythonEnvironmentInfo', 'ms-python.python/getPythonExecutableCommand', 'ms-python.python/installPythonPackage', 'ms-python.python/configurePythonEnvironment', 'ms-toolsai.jupyter/configureNotebook', 'ms-toolsai.jupyter/listNotebookPackages', 'ms-toolsai.jupyter/installNotebookPackages', 'ms-vscode.cpp-devtools/Build_CMakeTools', 'ms-vscode.cpp-devtools/RunCtest_CMakeTools', 'ms-vscode.cpp-devtools/ListBuildTargets_CMakeTools', 'ms-vscode.cpp-devtools/ListTests_CMakeTools']
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SageVDB Development Agent
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
This agent assists with developing, testing, and maintaining the SageVDB C++ vector database library. It understands the FAISS-compatible API design, pluggable ANNS architecture, and multimodal fusion capabilities.
|
|
10
|
+
|
|
11
|
+
## When to Use
|
|
12
|
+
- Adding or modifying ANNS algorithm plugins
|
|
13
|
+
- Working with vector operations, indexing, or search
|
|
14
|
+
- Implementing multimodal fusion strategies
|
|
15
|
+
- Debugging build/test issues
|
|
16
|
+
- Updating documentation for API changes
|
|
17
|
+
|
|
18
|
+
## Quick Context
|
|
19
|
+
- **Language**: C++20 core, optional CUDA/FAISS; Python bindings via pybind11
|
|
20
|
+
- **Entry points**: `SageVDB`/`VectorStore`/`QueryEngine` in include/sage_vdb; ANNS plugins under src/anns and registered via `REGISTER_ANNS_ALGORITHM`
|
|
21
|
+
- **Goal**: FAISS-like API surface with better modularity; new ANNS backends should be pluggable without changing public headers
|
|
22
|
+
|
|
23
|
+
## Ready-Made Commands
|
|
24
|
+
- Configure & build (Release): `cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON`
|
|
25
|
+
- Build helper script: `./build.sh`
|
|
26
|
+
- Run tests (from build): `ctest --verbose` or `./test_sage_vdb`, `./test_multimodal`
|
|
27
|
+
- Enable FAISS: supply `-DFAISS_ROOT=$CONDA_PREFIX` (matches CI) and build with `ENABLE_FAISS=ON` option if present
|
|
28
|
+
|
|
29
|
+
## When Editing
|
|
30
|
+
- Keep new ANNS algorithms under src/anns with public headers in include/sage_vdb/anns; register factories in .cpp files only
|
|
31
|
+
- Maintain FAISS-compatible knobs (k/nprobe/index type/metric) and thread params through `DatabaseConfig` and `SearchParams` instead of ad-hoc globals
|
|
32
|
+
- Preserve thread-safety in VectorStore (shared_mutex) and follow existing exception style (`SageVDBException`, runtime_error for unsupported ops)
|
|
33
|
+
- Do not create new local virtual environments (`venv`/`.venv`); use the existing configured Python environment.
|
|
34
|
+
- Update docs: core changes → README.md; multimodal → docs/guides/README_Multimodal.md, docs/USAGE_MODES.md
|
|
35
|
+
|
|
36
|
+
## Validation Checklist
|
|
37
|
+
- Build succeeds without FAISS; optional FAISS path guarded by ENABLE_FAISS
|
|
38
|
+
- Tests green (`test_sage_vdb`, `test_multimodal`)
|
|
39
|
+
- Public headers remain stable (API-compatible with FAISS-style usage)
|
|
40
|
+
|
|
41
|
+
## Output Style
|
|
42
|
+
- Provide concrete code examples for ANNS registration patterns
|
|
43
|
+
- Reference existing plugins (brute_force, faiss) as templates
|
|
44
|
+
- Always validate dimension compatibility in multimodal fusion
|
|
45
|
+
- Keep explanations concise with build/test commands ready to copy
|
|
46
|
+
|
|
47
|
+
## Polyrepo coordination rules
|
|
48
|
+
|
|
49
|
+
- Treat this repository as the only local source tree; do not assume sibling repositories exist.
|
|
50
|
+
- If a task spans multiple repositories, implement only this repo and explicitly list follow-up repo/version-bump actions.
|
|
51
|
+
- Do not create `venv`/`.venv`; always use the existing configured Python environment.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Copilot Instructions for SageVDB
|
|
2
|
+
|
|
3
|
+
These guardrails keep completions consistent with the repo goal: FAISS-style API with a modular, pluggable ANNS core and multimodal fusion.
|
|
4
|
+
|
|
5
|
+
## Design North Star
|
|
6
|
+
- Mirror FAISS user ergonomics: `IndexType`, `DistanceMetric`, `DatabaseConfig`, `train_index()`, `build_index()`, `search()`, and IVF/HNSW params match FAISS naming where possible.
|
|
7
|
+
- Everything runs through `VectorStore`/`QueryEngine` with algorithm lookup via `anns::ANNSRegistry`. New algorithms must register factories with `REGISTER_ANNS_ALGORITHM` and avoid leaking implementation headers.
|
|
8
|
+
- Multimodal stays additive: `MultimodalSageVDB` composes `ModalityManager` and `FusionEngine` (concat/weighted/attention/etc.) without coupling to specific embedders.
|
|
9
|
+
|
|
10
|
+
## Preferred APIs
|
|
11
|
+
- For vector DB entry points use `SageVDB` and `create_database()`; validate dimensions with `DatabaseConfig` rather than ad-hoc checks.
|
|
12
|
+
- Use `SearchParams` for k/nprobe/radius/metadata flags; use `anns::QueryConfig` for algorithm-specific knobs; keep `anns_build_params`/`anns_query_params` stringly-typed like FAISS CLI.
|
|
13
|
+
- Metadata flows through `MetadataStore` and `QueryResult.metadata`; keep it optional but stable.
|
|
14
|
+
- Persistence goes through `VectorStore::save/load` and mirrors FAISS index IO semantics; avoid one-off serializers.
|
|
15
|
+
|
|
16
|
+
## Implementation Rules
|
|
17
|
+
- Respect capabilities: if an algorithm cannot update/delete/range-search, throw `std::runtime_error` with the algorithm name (see `anns::ANNSAlgorithm` defaults).
|
|
18
|
+
- Keep thread safety: `VectorStore` uses shared_mutex for read-heavy paths; do not expose raw internals that bypass locking.
|
|
19
|
+
- Favor C++20 standard library; avoid introducing new deps unless aligned with cmake options (`ENABLE_FAISS`, `ENABLE_MULTIMODAL`, etc.).
|
|
20
|
+
- Do not create new local virtual environments (`venv`/`.venv`); use the existing configured Python environment.
|
|
21
|
+
- Keep code pluggable: new ANNS implementations live under `src/anns/` + public headers under `include/sage_vdb/anns/`; register via factory macro in a `.cpp` file only.
|
|
22
|
+
|
|
23
|
+
## Testing & Build
|
|
24
|
+
- Default build: `./build.sh`; CI builds with `cmake -B build ...` and optional `-DFAISS_ROOT` when FAISS is present.
|
|
25
|
+
- Tests: from `build/`, run `ctest --verbose` or `./test_sage_vdb`, `./test_multimodal`.
|
|
26
|
+
|
|
27
|
+
## Python Binding Notes
|
|
28
|
+
- `python/bindings.cpp` exposes the C++ core; keep interface names and docstrings aligned with the C++ API (FAISS-like naming, e.g., `search`, `add`, `train_index`).
|
|
29
|
+
- When adding params, thread them through `DatabaseConfig` -> `VectorStore` -> bindings; keep defaults backward compatible.
|
|
30
|
+
|
|
31
|
+
## Documentation Expectations
|
|
32
|
+
- Update `README.md` for core vector/ANNS changes; use `docs/guides/README_Multimodal.md` and `docs/USAGE_MODES.md` when changing multimodal flows.
|
|
33
|
+
- Keep option names and examples FAISS-compatible to ease user migration.
|
|
34
|
+
|
|
35
|
+
## Publishing
|
|
36
|
+
|
|
37
|
+
**⚠️ IMPORTANT: Publishing requires explicit version update and manual action**
|
|
38
|
+
|
|
39
|
+
### Publishing Workflow
|
|
40
|
+
1. **Update version** in `pyproject.toml` (current: 0.1.5)
|
|
41
|
+
- Bug fixes: increment patch (0.1.5 → 0.1.6)
|
|
42
|
+
- New features: increment minor (0.1.5 → 0.2.0)
|
|
43
|
+
- Breaking changes: increment major (0.1.5 → 1.0.0)
|
|
44
|
+
|
|
45
|
+
2. **Build and publish** using `sage-pypi-publisher`:
|
|
46
|
+
```bash
|
|
47
|
+
# One-command workflow (recommended)
|
|
48
|
+
cd /path/to/sageVDB
|
|
49
|
+
sage-pypi-publisher publish . -r testpypi --no-dry-run # Test first
|
|
50
|
+
sage-pypi-publisher publish . -r pypi --no-dry-run # Production
|
|
51
|
+
|
|
52
|
+
# publish command auto-detects C++ extension and builds manylinux wheels
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
3. **Git hook behavior**: The pre-push hook will:
|
|
56
|
+
- Warn if version wasn't updated
|
|
57
|
+
- Ask [u/y/n]: update now / continue / cancel
|
|
58
|
+
- Choosing 'y' pushes to GitHub but does NOT publish to PyPI
|
|
59
|
+
|
|
60
|
+
### Notes
|
|
61
|
+
- Use latest `isage-pypi-publisher` from PyPI
|
|
62
|
+
- PyPI token must be in `~/.pypirc`
|
|
63
|
+
- `publish` command auto-detects package type (no need for --force-manylinux)
|
|
64
|
+
- Push to GitHub and publish to PyPI are separate steps
|
|
65
|
+
- See `docs/ops/RELEASE.md` and `docs/ops/DEPLOYMENT.md` for details
|
|
66
|
+
|
|
67
|
+
## Polyrepo coordination (mandatory)
|
|
68
|
+
|
|
69
|
+
- This repository is an independent SAGE sub-repository and is developed/released independently.
|
|
70
|
+
- Do not assume sibling source directories exist locally in `intellistream/SAGE`.
|
|
71
|
+
- For cross-repo rollout, publish this repo/package first, then bump the version pin in `SAGE/packages/sage/pyproject.toml` when applicable.
|
|
72
|
+
- Do not add local editable installs of other SAGE sub-packages in setup scripts or docs.
|
|
73
|
+
|
|
74
|
+
## 🚫 NEVER_CREATE_DOT_VENV_MANDATORY
|
|
75
|
+
|
|
76
|
+
- 永远不要创建 `.venv` 或 `venv`(无任何例外)。
|
|
77
|
+
- NEVER create `.venv`/`venv` in this repository under any circumstance.
|
|
78
|
+
- 必须复用当前已配置的非-venv Python 环境(如现有 conda 环境)。
|
|
79
|
+
- If any script/task suggests creating a virtualenv, skip that step and continue with the existing environment.
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
name: CMake - Build and Test SageVDB
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [ main, main-dev ]
|
|
6
|
+
push:
|
|
7
|
+
branches: [ main, main-dev ]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: true
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
build-and-test:
|
|
16
|
+
name: ${{ matrix.os }} | CMake ${{ matrix.build_type }}
|
|
17
|
+
runs-on: ${{ matrix.os }}
|
|
18
|
+
env:
|
|
19
|
+
# Limit CI log level to avoid excessive DEBUG logs
|
|
20
|
+
sage_vdb_LOG_LEVEL: info
|
|
21
|
+
strategy:
|
|
22
|
+
fail-fast: false
|
|
23
|
+
matrix:
|
|
24
|
+
os: [ ubuntu-latest ]
|
|
25
|
+
build_type: [ Release, Debug ]
|
|
26
|
+
steps:
|
|
27
|
+
- name: Checkout repository
|
|
28
|
+
uses: actions/checkout@v4
|
|
29
|
+
|
|
30
|
+
# Setup conda environment for FAISS and other dependencies
|
|
31
|
+
- name: Setup Miniconda
|
|
32
|
+
uses: conda-incubator/setup-miniconda@v3
|
|
33
|
+
with:
|
|
34
|
+
auto-update-conda: true
|
|
35
|
+
python-version: 3.11
|
|
36
|
+
channels: conda-forge
|
|
37
|
+
|
|
38
|
+
- name: Install dependencies via conda
|
|
39
|
+
shell: bash -el {0}
|
|
40
|
+
run: |
|
|
41
|
+
conda install -y \
|
|
42
|
+
faiss-cpu \
|
|
43
|
+
openblas \
|
|
44
|
+
cmake \
|
|
45
|
+
make \
|
|
46
|
+
gcc_linux-64 \
|
|
47
|
+
gxx_linux-64 \
|
|
48
|
+
pkg-config
|
|
49
|
+
python -m pip install --upgrade pip
|
|
50
|
+
# Editable install ensures the built extension is available under ./sagevdb for pytest.
|
|
51
|
+
# Avoid CI fragility from unpublished optional integration dependencies.
|
|
52
|
+
python -m pip install pytest pytest-cov black isort
|
|
53
|
+
python -m pip install -e . --no-deps
|
|
54
|
+
|
|
55
|
+
# Install additional C++ toolchain (Ubuntu)
|
|
56
|
+
- name: Install C++ toolchain (Ubuntu)
|
|
57
|
+
if: runner.os == 'Linux'
|
|
58
|
+
run: |
|
|
59
|
+
sudo apt-get update
|
|
60
|
+
sudo apt-get install -y --no-install-recommends \
|
|
61
|
+
build-essential \
|
|
62
|
+
cmake \
|
|
63
|
+
pkg-config \
|
|
64
|
+
libblas-dev \
|
|
65
|
+
liblapack-dev
|
|
66
|
+
|
|
67
|
+
- name: Show compiler and dependency versions
|
|
68
|
+
shell: bash -el {0}
|
|
69
|
+
run: |
|
|
70
|
+
g++ --version || true
|
|
71
|
+
gcc --version || true
|
|
72
|
+
cmake --version || true
|
|
73
|
+
conda list | grep faiss || true
|
|
74
|
+
conda list | grep openblas || true
|
|
75
|
+
echo "Python packages:"
|
|
76
|
+
|
|
77
|
+
- name: Configure CMake
|
|
78
|
+
shell: bash -el {0}
|
|
79
|
+
run: |
|
|
80
|
+
cmake -S . -B build \
|
|
81
|
+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
|
82
|
+
-DBUILD_TESTS=ON \
|
|
83
|
+
-DBUILD_PYTHON_BINDINGS=OFF \
|
|
84
|
+
-DENABLE_MULTIMODAL=ON \
|
|
85
|
+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
|
86
|
+
-DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \
|
|
87
|
+
-DFAISS_ROOT="$CONDA_PREFIX"
|
|
88
|
+
|
|
89
|
+
- name: Build
|
|
90
|
+
shell: bash -el {0}
|
|
91
|
+
run: |
|
|
92
|
+
# Limit parallel jobs to avoid OOM on CI runners
|
|
93
|
+
cmake --build build --config ${{ matrix.build_type }} --parallel 2
|
|
94
|
+
|
|
95
|
+
- name: Verify build directory
|
|
96
|
+
shell: bash -el {0}
|
|
97
|
+
run: |
|
|
98
|
+
if [ ! -d build ]; then
|
|
99
|
+
echo "Error: build directory not found after build step."
|
|
100
|
+
exit 1
|
|
101
|
+
fi
|
|
102
|
+
echo "Build directory contents:"
|
|
103
|
+
ls -la build
|
|
104
|
+
|
|
105
|
+
- name: Set library path for tests
|
|
106
|
+
shell: bash -el {0}
|
|
107
|
+
run: |
|
|
108
|
+
echo "LD_LIBRARY_PATH=$PWD/build:$CONDA_PREFIX/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
|
|
109
|
+
|
|
110
|
+
- name: Run all tests
|
|
111
|
+
shell: bash -el {0}
|
|
112
|
+
run: |
|
|
113
|
+
if [ ! -d build ]; then
|
|
114
|
+
echo "Error: build directory not found before tests."
|
|
115
|
+
exit 1
|
|
116
|
+
fi
|
|
117
|
+
cd build
|
|
118
|
+
LD_LIBRARY_PATH=$PWD:$CONDA_PREFIX/lib ctest --output-on-failure --verbose
|
|
119
|
+
|
|
120
|
+
- name: Run Python tests
|
|
121
|
+
shell: bash -el {0}
|
|
122
|
+
run: |
|
|
123
|
+
python -m pytest -v tests
|
|
124
|
+
|
|
125
|
+
- name: Run direct test executables (fallback)
|
|
126
|
+
if: failure()
|
|
127
|
+
shell: bash -el {0}
|
|
128
|
+
run: |
|
|
129
|
+
echo "Running tests directly..."
|
|
130
|
+
if [ ! -d build ]; then
|
|
131
|
+
echo "Build directory not found; skip fallback executable tests."
|
|
132
|
+
exit 0
|
|
133
|
+
fi
|
|
134
|
+
cd build
|
|
135
|
+
if [ -f ./test_sage_vdb ]; then
|
|
136
|
+
echo "Running test_sage_vdb..."
|
|
137
|
+
LD_LIBRARY_PATH=$PWD:$CONDA_PREFIX/lib ./test_sage_vdb || true
|
|
138
|
+
fi
|
|
139
|
+
if [ -f ./test_multimodal ]; then
|
|
140
|
+
echo "Running test_multimodal..."
|
|
141
|
+
LD_LIBRARY_PATH=$PWD:$CONDA_PREFIX/lib ./test_multimodal || true
|
|
142
|
+
fi
|
|
143
|
+
|
|
144
|
+
- name: Upload test logs on failure
|
|
145
|
+
if: failure()
|
|
146
|
+
uses: actions/upload-artifact@v4
|
|
147
|
+
with:
|
|
148
|
+
name: sage-db-test-logs-${{ matrix.os }}-${{ matrix.build_type }}
|
|
149
|
+
path: |
|
|
150
|
+
build/Testing/**
|
|
151
|
+
build/*.log
|
|
152
|
+
build/**/compile_commands.json
|
|
153
|
+
build/test_sage_vdb
|
|
154
|
+
build/test_multimodal
|
|
155
|
+
|
|
156
|
+
- name: Upload built library
|
|
157
|
+
if: success()
|
|
158
|
+
uses: actions/upload-artifact@v4
|
|
159
|
+
with:
|
|
160
|
+
name: sage-db-library-${{ matrix.os }}-${{ matrix.build_type }}
|
|
161
|
+
path: |
|
|
162
|
+
build/libsage_vdb.so
|
|
163
|
+
build/_sage_vdb*.so
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
name: Quick Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [ main, main-dev ]
|
|
6
|
+
paths:
|
|
7
|
+
- 'src/**'
|
|
8
|
+
- 'include/**'
|
|
9
|
+
- 'tests/**'
|
|
10
|
+
- 'CMakeLists.txt'
|
|
11
|
+
- 'cmake/**'
|
|
12
|
+
workflow_dispatch:
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
16
|
+
cancel-in-progress: true
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
quick-test:
|
|
20
|
+
name: Quick Test (Ubuntu Release)
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
timeout-minutes: 15
|
|
23
|
+
steps:
|
|
24
|
+
- name: Checkout repository
|
|
25
|
+
uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
# Use cache for conda dependencies
|
|
28
|
+
- name: Cache conda dependencies
|
|
29
|
+
uses: actions/cache@v4
|
|
30
|
+
with:
|
|
31
|
+
path: ~/conda_pkgs_dir
|
|
32
|
+
key: ${{ runner.os }}-conda-${{ hashFiles('**/requirements*.txt') }}
|
|
33
|
+
restore-keys: |
|
|
34
|
+
${{ runner.os }}-conda-
|
|
35
|
+
|
|
36
|
+
- name: Setup Miniconda
|
|
37
|
+
uses: conda-incubator/setup-miniconda@v3
|
|
38
|
+
with:
|
|
39
|
+
auto-update-conda: true
|
|
40
|
+
python-version: 3.11
|
|
41
|
+
channels: conda-forge
|
|
42
|
+
use-only-tar-bz2: true
|
|
43
|
+
|
|
44
|
+
- name: Install dependencies
|
|
45
|
+
shell: bash -el {0}
|
|
46
|
+
run: |
|
|
47
|
+
conda install -y \
|
|
48
|
+
faiss-cpu \
|
|
49
|
+
openblas \
|
|
50
|
+
cmake \
|
|
51
|
+
make \
|
|
52
|
+
gcc_linux-64 \
|
|
53
|
+
gxx_linux-64
|
|
54
|
+
|
|
55
|
+
- name: Configure and Build
|
|
56
|
+
shell: bash -el {0}
|
|
57
|
+
run: |
|
|
58
|
+
cmake -S . -B build \
|
|
59
|
+
-DCMAKE_BUILD_TYPE=Release \
|
|
60
|
+
-DBUILD_TESTS=ON \
|
|
61
|
+
-DBUILD_PYTHON_BINDINGS=OFF \
|
|
62
|
+
-DENABLE_MULTIMODAL=ON \
|
|
63
|
+
-DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \
|
|
64
|
+
-DFAISS_ROOT="$CONDA_PREFIX"
|
|
65
|
+
|
|
66
|
+
cmake --build build --parallel
|
|
67
|
+
|
|
68
|
+
- name: Run Tests
|
|
69
|
+
shell: bash -el {0}
|
|
70
|
+
run: |
|
|
71
|
+
if [ ! -d build ]; then
|
|
72
|
+
echo "Error: build directory not found before tests."
|
|
73
|
+
exit 1
|
|
74
|
+
fi
|
|
75
|
+
cd build
|
|
76
|
+
LD_LIBRARY_PATH=$PWD:$CONDA_PREFIX/lib ctest --output-on-failure
|
|
77
|
+
|
|
78
|
+
- name: Test library loading
|
|
79
|
+
shell: bash -el {0}
|
|
80
|
+
run: |
|
|
81
|
+
echo "Testing library dependencies..."
|
|
82
|
+
if [ ! -d build ]; then
|
|
83
|
+
echo "Error: build directory not found before library checks."
|
|
84
|
+
exit 1
|
|
85
|
+
fi
|
|
86
|
+
cd build
|
|
87
|
+
ldd libsage_vdb.so || true
|
|
88
|
+
LD_LIBRARY_PATH=$PWD:$CONDA_PREFIX/lib ldd test_sage_vdb || true
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Build directories
|
|
2
|
+
build/
|
|
3
|
+
install/
|
|
4
|
+
_codeql_build_dir/
|
|
5
|
+
_codeql_detected_source_root
|
|
6
|
+
|
|
7
|
+
# Python cache
|
|
8
|
+
__pycache__/
|
|
9
|
+
*/__pycache__/
|
|
10
|
+
**/__pycache__/
|
|
11
|
+
*.pyc
|
|
12
|
+
|
|
13
|
+
# Compiled extensions
|
|
14
|
+
*.so
|
|
15
|
+
*.o
|
|
16
|
+
*.a
|
|
17
|
+
|
|
18
|
+
# Specific compiled files
|
|
19
|
+
python/_sage_vdb.cpython-*-linux-gnu.so
|
|
20
|
+
dist/*
|
|
21
|
+
wheelhouse/*
|
|
22
|
+
.env
|
|
23
|
+
.coverage
|
|
24
|
+
pytest.log
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Pre-commit hooks configuration for C++ submodule
|
|
2
|
+
# Installation:
|
|
3
|
+
# pip install pre-commit
|
|
4
|
+
# pre-commit install
|
|
5
|
+
#
|
|
6
|
+
# Usage:
|
|
7
|
+
# pre-commit run --all-files
|
|
8
|
+
# git commit --no-verify # Skip hooks temporarily
|
|
9
|
+
|
|
10
|
+
default_language_version:
|
|
11
|
+
python: python3.11
|
|
12
|
+
|
|
13
|
+
repos:
|
|
14
|
+
# General file checks
|
|
15
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
16
|
+
rev: v6.0.0
|
|
17
|
+
hooks:
|
|
18
|
+
- id: trailing-whitespace
|
|
19
|
+
- id: end-of-file-fixer
|
|
20
|
+
- id: check-yaml
|
|
21
|
+
args: [--unsafe]
|
|
22
|
+
- id: check-json
|
|
23
|
+
- id: check-toml
|
|
24
|
+
- id: check-added-large-files
|
|
25
|
+
args: ['--maxkb=1000']
|
|
26
|
+
- id: check-merge-conflict
|
|
27
|
+
- id: check-case-conflict
|
|
28
|
+
- id: mixed-line-ending
|
|
29
|
+
args: [--fix=lf]
|
|
30
|
+
- id: detect-private-key
|
|
31
|
+
|
|
32
|
+
# C++: clang-format (code formatting)
|
|
33
|
+
- repo: https://github.com/pre-commit/mirrors-clang-format
|
|
34
|
+
rev: v19.1.6
|
|
35
|
+
hooks:
|
|
36
|
+
- id: clang-format
|
|
37
|
+
types_or: [c++, c]
|
|
38
|
+
args: ['-i']
|
|
39
|
+
|
|
40
|
+
# CMake: cmake-format
|
|
41
|
+
- repo: https://github.com/cheshirekow/cmake-format-precommit
|
|
42
|
+
rev: v0.6.13
|
|
43
|
+
hooks:
|
|
44
|
+
- id: cmake-format
|
|
45
|
+
args: [--in-place]
|
|
46
|
+
- id: cmake-lint
|
|
47
|
+
args: [--disabled-codes=C0103,C0301]
|
|
48
|
+
|
|
49
|
+
# Python (for pybind11 bindings and test scripts)
|
|
50
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
51
|
+
rev: v0.14.2
|
|
52
|
+
hooks:
|
|
53
|
+
- id: ruff
|
|
54
|
+
args: [--fix]
|
|
55
|
+
types_or: [python, pyi]
|
|
56
|
+
- id: ruff-format
|
|
57
|
+
types_or: [python, pyi]
|
|
58
|
+
|
|
59
|
+
# Shell scripts
|
|
60
|
+
- repo: https://github.com/shellcheck-py/shellcheck-py
|
|
61
|
+
rev: v0.10.0.1
|
|
62
|
+
hooks:
|
|
63
|
+
- id: shellcheck
|
|
64
|
+
args: [--severity=warning]
|
|
65
|
+
|
|
66
|
+
# YAML formatting
|
|
67
|
+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
|
|
68
|
+
rev: v2.15.0
|
|
69
|
+
hooks:
|
|
70
|
+
- id: pretty-format-yaml
|
|
71
|
+
args: [--autofix, --indent, '2']
|
|
72
|
+
|
|
73
|
+
# Markdown formatting
|
|
74
|
+
- repo: https://github.com/executablebooks/mdformat
|
|
75
|
+
rev: 0.7.21
|
|
76
|
+
hooks:
|
|
77
|
+
- id: mdformat
|
|
78
|
+
args: [--wrap, '100']
|
|
79
|
+
additional_dependencies:
|
|
80
|
+
- mdformat-gfm
|
|
81
|
+
- mdformat-black
|
|
82
|
+
|
|
83
|
+
# Secret detection
|
|
84
|
+
- repo: https://github.com/Yelp/detect-secrets
|
|
85
|
+
rev: v1.5.0
|
|
86
|
+
hooks:
|
|
87
|
+
- id: detect-secrets
|
|
88
|
+
args: ['--baseline', '.secrets.baseline']
|
|
89
|
+
exclude: package.lock.json
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to isage-vdb will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.2.0.10] - 2026-05-27
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Preserved sage-anns adapter metadata and local ID state across `save()` / `load()` using an adapter sidecar file
|
|
12
|
+
- Restored adapter state safely by validating dimension, metric, and algorithm before loading external ANN indexes
|
|
13
|
+
- Normalized sage-anns adapter metadata keys and values to strings before writing through `MetadataStore`
|
|
14
|
+
- Corrected the sage-anns integration example so it reports inserted vector count instead of reusing `dimension`
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- Installed Python adapter sources into built wheel/sdist artifacts so `sagevdb.sage_anns` ships with published packages
|
|
18
|
+
- Moved `isage-anns` to an explicit optional `sage-anns` extra and aligned the minimum version with `isage-anns>=0.2.0`
|
|
19
|
+
- Clarified documentation around the native C++ ANNS registry boundary versus the optional Python `backend="sage-anns"` adapter path
|
|
20
|
+
|
|
21
|
+
## [0.1.10] - 2026-02-14
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
- **CRITICAL**: Added `faiss-cpu>=1.7.0` to core dependencies in pyproject.toml
|
|
25
|
+
- libsage_vdb.so is compiled with FAISS support and requires libfaiss.so at runtime
|
|
26
|
+
- Previously faiss-cpu was optional, causing OSError when importing sagevdb
|
|
27
|
+
- Improved error message when libfaiss.so is missing during module import
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- Removed redundant `faiss` from optional dependencies (now in core)
|
|
31
|
+
|
|
32
|
+
## [0.1.9] - 2026-02-13
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
- Initial release with FAISS-compatible API
|
|
36
|
+
- Support for multiple index types (FLAT, IVF, HNSW)
|
|
37
|
+
- Metadata filtering and hybrid search
|
|
38
|
+
- Persistent storage (save/load)
|