Skip to content

feat: Quantization support for elastic search#355

Open
vanitabhagwat wants to merge 6 commits intofeature/vector-storefrom
feature/int8-quantization-es
Open

feat: Quantization support for elastic search#355
vanitabhagwat wants to merge 6 commits intofeature/vector-storefrom
feature/int8-quantization-es

Conversation

@vanitabhagwat
Copy link
Copy Markdown
Collaborator

@vanitabhagwat vanitabhagwat commented Apr 7, 2026

What this PR does / why we need it:

  1. Quantization strategy - The PR implements memory-efficient vector compression (int4/int8/BBQ) which trades some accuracy for 4-8x memory reduction.
  2. Query path duality - Maintains backward-compatible exact search (script_score) while adding approximate nearest neighbor search (native knn).
  3. Validation on parameters

Which issue(s) this PR fixes:

Misc

- Add config fields: vector_index_type, hnsw_m, hnsw_ef_construction, rescore_oversample
- Add use_native_knn toggle (default: false for backward compatibility)
- Add knn_num_candidates_multiplier for query tuning
- Comprehensive Pydantic validation for all config constraints
- Support for int8, int4, bbq quantization with HNSW and flat indices
- Dimension validation (int4 requires even dims, bbq requires >=64)
- Dual query path: script_score (exact) vs native knn (approximate)
- 17 unit tests covering config validation and index creation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@vanitabhagwat vanitabhagwat force-pushed the feature/int8-quantization-es branch from b91534a to d1ebd93 Compare April 9, 2026 01:07
@vanitabhagwat vanitabhagwat changed the title Added quantization support fix: Quantization support Apr 9, 2026
@vanitabhagwat vanitabhagwat changed the title fix: Quantization support fix: Quantization support for elastic search Apr 9, 2026
vanitabhagwat added 5 commits April 8, 2026 18:22
- Fix mypy error: Argument 1 to b64decode has incompatible type
- Add None check before decoding feature_value
- Ensures type safety without changing behavior
- Remove unused patch import
- Fix import ordering in test methods
- No functional changes, all tests passing
- Auto-format with ruff for consistent code style
- No functional changes, all tests passing
@vanitabhagwat vanitabhagwat changed the title fix: Quantization support for elastic search feat: Quantization support for elastic search Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant