Compare commits

...

6 Commits

Author SHA1 Message Date
GitHub Actions
cf2ef48967 chore: release v0.1.11 2025-07-26 00:12:37 +00:00
yichuan520030910320
0692bbf7a2 change workflow 2025-07-25 17:11:56 -07:00
GitHub Actions
52584a171f chore: release v0.1.10 2025-07-25 23:12:16 +00:00
Andy Lee
efd6b5324b fix: add protobuf as a dependency for DiskANN backend
- Fixes 'No module named google' error when starting DiskANN embedding server
- Prevents users from having to manually install protobuf
2025-07-25 16:10:25 -07:00
Andy Lee
2baaa4549b fix: handle relative paths in HNSW embedding server metadata
- Convert relative paths to absolute paths based on metadata file location
- Fixes FileNotFoundError when starting embedding server
- Resolves issue with passages file not found in different working directories
2025-07-25 16:09:53 -07:00
Andy Lee
35310ddd52 fix: pure Python packages not building due to ubuntu-latest check
The build workflow was checking for matrix.os == 'ubuntu-latest',
but we changed the matrix to use 'ubuntu-22.04', causing the
pure Python packages (leann-core and leann) to never be built.

Changed to use pattern matching [[ == ubuntu-* ]] to match any
Ubuntu version.

This explains why v0.1.9 only published the C++ backend packages
but not the pure Python packages.
2025-07-25 15:14:21 -07:00
9 changed files with 33 additions and 15 deletions

View File

@@ -82,7 +82,7 @@ jobs:
- name: Build packages - name: Build packages
run: | run: |
# Build core (platform independent) # Build core (platform independent)
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then if [[ "${{ matrix.os }}" == ubuntu-* ]]; then
cd packages/leann-core cd packages/leann-core
uv build uv build
cd ../.. cd ../..
@@ -107,7 +107,7 @@ jobs:
cd ../.. cd ../..
# Build meta package (platform independent) # Build meta package (platform independent)
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then if [[ "${{ matrix.os }}" == ubuntu-* ]]; then
cd packages/leann cd packages/leann
uv build uv build
cd ../.. cd ../..

View File

@@ -57,7 +57,7 @@ jobs:
needs: update-version needs: update-version
uses: ./.github/workflows/build-reusable.yml uses: ./.github/workflows/build-reusable.yml
with: with:
ref: ${{ needs.update-version.outputs.commit-sha }} ref: 'main'
publish: publish:
name: Publish and Release name: Publish and Release
@@ -70,7 +70,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
ref: ${{ needs.update-version.outputs.commit-sha }} ref: 'main'
- name: Download all artifacts - name: Download all artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4

View File

@@ -195,7 +195,7 @@ Once the index is built, you can ask questions like:
- "Show me emails about travel expenses" - "Show me emails about travel expenses"
</details> </details>
### 🔍 Time Machine for the Web: RAG Your Entire Google Browser History! ### 🔍 Time Machine for the Web: RAG Your Entire Chrome Browser History!
<p align="center"> <p align="center">
<img src="videos/google_clear.gif" alt="LEANN Browser History Search Demo" width="600"> <img src="videos/google_clear.gif" alt="LEANN Browser History Search Demo" width="600">

View File

@@ -4,8 +4,8 @@ build-backend = "scikit_build_core.build"
[project] [project]
name = "leann-backend-diskann" name = "leann-backend-diskann"
version = "0.1.9" version = "0.1.11"
dependencies = ["leann-core==0.1.9", "numpy"] dependencies = ["leann-core==0.1.11", "numpy", "protobuf>=3.19.0"]
[tool.scikit-build] [tool.scikit-build]
# Key: simplified CMake path # Key: simplified CMake path

View File

@@ -48,6 +48,10 @@ class HNSWBuilder(LeannBackendBuilderInterface):
self.efConstruction = self.build_params.setdefault("efConstruction", 200) self.efConstruction = self.build_params.setdefault("efConstruction", 200)
self.distance_metric = self.build_params.setdefault("distance_metric", "mips") self.distance_metric = self.build_params.setdefault("distance_metric", "mips")
self.dimensions = self.build_params.get("dimensions") self.dimensions = self.build_params.get("dimensions")
if not self.is_recompute:
if self.is_compact:
# TODO: support this case @andy
raise ValueError("is_recompute is False, but is_compact is True. This is not compatible now. change is compact to False and you can use the original HNSW index.")
def build(self, data: np.ndarray, ids: List[str], index_path: str, **kwargs): def build(self, data: np.ndarray, ids: List[str], index_path: str, **kwargs):
from . import faiss # type: ignore from . import faiss # type: ignore

View File

@@ -81,7 +81,21 @@ def create_hnsw_embedding_server(
with open(passages_file, "r") as f: with open(passages_file, "r") as f:
meta = json.load(f) meta = json.load(f)
passages = PassageManager(meta["passage_sources"]) # Convert relative paths to absolute paths based on metadata file location
metadata_dir = Path(
passages_file
).parent.parent # Go up one level from the metadata file
passage_sources = []
for source in meta["passage_sources"]:
source_copy = source.copy()
# Convert relative paths to absolute paths
if not Path(source_copy["path"]).is_absolute():
source_copy["path"] = str(metadata_dir / source_copy["path"])
if not Path(source_copy["index_path"]).is_absolute():
source_copy["index_path"] = str(metadata_dir / source_copy["index_path"])
passage_sources.append(source_copy)
passages = PassageManager(passage_sources)
logger.info( logger.info(
f"Loaded PassageManager with {len(passages.global_offset_map)} passages from metadata" f"Loaded PassageManager with {len(passages.global_offset_map)} passages from metadata"
) )
@@ -270,15 +284,15 @@ def create_hnsw_embedding_server(
if __name__ == "__main__": if __name__ == "__main__":
import signal import signal
import sys import sys
def signal_handler(sig, frame): def signal_handler(sig, frame):
logger.info(f"Received signal {sig}, shutting down gracefully...") logger.info(f"Received signal {sig}, shutting down gracefully...")
sys.exit(0) sys.exit(0)
# Register signal handlers for graceful shutdown # Register signal handlers for graceful shutdown
signal.signal(signal.SIGTERM, signal_handler) signal.signal(signal.SIGTERM, signal_handler)
signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGINT, signal_handler)
parser = argparse.ArgumentParser(description="HNSW Embedding service") parser = argparse.ArgumentParser(description="HNSW Embedding service")
parser.add_argument("--zmq-port", type=int, default=5555, help="ZMQ port to run on") parser.add_argument("--zmq-port", type=int, default=5555, help="ZMQ port to run on")
parser.add_argument( parser.add_argument(

View File

@@ -6,10 +6,10 @@ build-backend = "scikit_build_core.build"
[project] [project]
name = "leann-backend-hnsw" name = "leann-backend-hnsw"
version = "0.1.9" version = "0.1.11"
description = "Custom-built HNSW (Faiss) backend for the Leann toolkit." description = "Custom-built HNSW (Faiss) backend for the Leann toolkit."
dependencies = [ dependencies = [
"leann-core==0.1.9", "leann-core==0.1.11",
"numpy", "numpy",
"pyzmq>=23.0.0", "pyzmq>=23.0.0",
"msgpack>=1.0.0", "msgpack>=1.0.0",

View File

@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "leann-core" name = "leann-core"
version = "0.1.9" version = "0.1.11"
description = "Core API and plugin system for LEANN" description = "Core API and plugin system for LEANN"
readme = "README.md" readme = "README.md"
requires-python = ">=3.9" requires-python = ">=3.9"

View File

@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "leann" name = "leann"
version = "0.1.9" version = "0.1.11"
description = "LEANN - The smallest vector index in the world. RAG Everything with LEANN!" description = "LEANN - The smallest vector index in the world. RAG Everything with LEANN!"
readme = "README.md" readme = "README.md"
requires-python = ">=3.9" requires-python = ">=3.9"