feat: Enhance embedding generation and search capabilities

- Added pre-calculation of estimated chunk count for HNSW capacity in `generate_dense_embeddings_centralized` to optimize indexing performance.
- Implemented binary vector generation with memory-mapped storage for efficient cascade search, including metadata saving.
- Introduced SPLADE sparse index generation with improved handling and metadata storage.
- Updated `ChainSearchEngine` to prefer centralized binary searcher for improved performance and added fallback to legacy binary index.
- Deprecated `BinaryANNIndex` in favor of `BinarySearcher` for better memory management and performance.
- Enhanced `SpladeEncoder` with warmup functionality to reduce latency spikes during first-time inference.
- Improved `SpladeIndex` with cache size adjustments for better query performance.
- Added methods for managing binary vectors in `VectorMetadataStore`, including batch insertion and retrieval.
- Created a new `BinarySearcher` class for efficient binary vector search using Hamming distance, supporting both memory-mapped and database loading modes.
This commit is contained in:
catlog22
2026-01-02 23:57:55 +08:00
parent 96b44e1482
commit 54fd94547c
12 changed files with 945 additions and 167 deletions

View File

@@ -6,6 +6,7 @@ tree-sitter-python>=0.25
tree-sitter-javascript>=0.25
tree-sitter-typescript>=0.23
pathspec>=0.11
watchdog>=3.0
[encoding]
chardet>=5.0
@@ -13,6 +14,25 @@ chardet>=5.0
[full]
tiktoken>=0.5.0
[reranker]
optimum>=1.16
onnxruntime>=1.15
transformers>=4.36
[reranker-api]
httpx>=0.25
[reranker-legacy]
sentence-transformers>=2.2
[reranker-litellm]
ccw-litellm>=0.1
[reranker-onnx]
optimum>=1.16
onnxruntime>=1.15
transformers>=4.36
[semantic]
numpy>=1.24
fastembed>=0.2
@@ -29,3 +49,11 @@ numpy>=1.24
fastembed>=0.2
hnswlib>=0.8.0
onnxruntime-gpu>=1.15.0
[splade]
transformers>=4.36
optimum[onnxruntime]>=1.16
[splade-gpu]
transformers>=4.36
optimum[onnxruntime-gpu]>=1.16