Repository navigation
Description
Background
Today LSM_VECTOR only accepts ARRAY_OF_FLOATS for ingest. Modern embedding providers (Cohere embed-english-v3.0 int8 endpoints, OpenAI text-embedding-3-large with reduced precision, self-hosted Sentence Transformers) emit pre-quantized int8 directly. Users currently round-trip int8 → float32 → ArcadeDB, where the engine then quantizes back to int8 for the index. Wasted bandwidth and a precision-losing rescale on the way through.
The comparison matrix in docs/arcadedb-vs-leading-vector-dbms.md flags this as a P2 gap (Milvus has first-class FLOAT16/BFLOAT16/INT8 ingest types; Qdrant accepts uint8). See section 3.3 "Pre-quantized ingest types".
Prior art
#3162 covered a broader scope (codes-first ingest + drop-raw-floats) and was paused by the previous attempt because the dual-storage / drop-raw-floats path got too fragile. Quote from the close comment:
"Keeping both raw vectors and codes in the bucket didn't pan out, and the build/test path for quantized storage got too fragile (engine test-jar deps, graph vs. inline payloads, etc.). I'm pausing this effort; no code change needed."
This issue intentionally narrows the scope: INT8 ingest only, raw-float drop NOT in scope, PQ codebook ingest NOT in scope. The narrower scope avoids the dual-storage trap that derailed #3162.
Concrete numbers (1024-dim, 1M docs)
| Encoding | Per-doc | Corpus | HTTP payload |
|---|---|---|---|
| float32 (today) | 4 KiB | 4 GiB | 4× |
| INT8 (this issue) | 1 KiB | 1 GiB | 1× |
Wins: 4x bandwidth on ingest, 4x storage on the document property column, no float32 ↔ int8 round-trip precision loss.
Scope (this issue)
- New
vectorEncodingfield onLSMVectorIndexMetadata(FLOAT32default,INT8opt-in). LSMVectorIndex.put(record)readsbyte[]directly whenvectorEncoding=INT8and the indexed property isARRAY_OF_BYTES. Skip the internal float32→int8 quantization; JVector accepts INT8 vectors natively viaVectorEncoding.BYTE.vector.neighbors(...)accepts abyte[]query when the index encoding is INT8. Reject cross-encoding queries at parse time with a clear error.- SQL syntax:
CREATE INDEX ON Doc (embedding) LSM_VECTOR METADATA { encoding: 'INT8' }. Existingquantization: 'INT8'continues to work for the float32-input + internal-quantize case. - Tests: parity test against the same corpus stored as float32 with internal
quantization: INT8; recall@10 within tolerance. Reject path tests for cross-encoding queries.
Out of scope (followups)
- Binary vector ingest (1-bit packed) → separate issue, separate PR.
- Float16 / BFloat16 ingest → separate issue.
- Drop-raw-floats /
storeRawVectors=false→ defer; Support code-first vector storage (drop raw floats / ingest pre-quantized codes) forLSM_VECTOR#3162's lessons say this needs a clean storage redesign first. - PQ codebook ingest → separate issue.
Tradeoffs / pitfalls
- Schema migration: existing float32 indexes don't auto-migrate. Encoding is opt-in at index creation. Documented limitation.
- Quantization calibration: skipping the engine's quantization step puts per-block
weight_min/weight_maxcalibration on the user (or the embedding model). For OpenAI/Cohere this is fine - their int8 output is calibrated. - JVector dependency: confirm
jvector-4.0.0-rc.8(the current pinned version) exposesVectorEncoding.BYTEfor HNSW build + search. If a JVector bump is needed, surface in the PR description.
Effort estimate
~1-1.5 weeks. Breakdown:
- Metadata + builders + JSON serialization: 2 days
- Ingest path + JVector wiring: 2 days
vector.neighborsquery path + error handling: 1 day- Tests (parity + reject path): 2 days
- Docs + matrix update: 1 day
Activity
HTTP: route int8 query vectors to byte[] via $bytes/$int8 markers (#4… (
lvca commentedon May 8, 2026
Closed by #4133 (merged in ae224e9).
LSM_VECTORnow accepts pre-quantized INT8 ingest viaencoding: 'INT8'index metadata, with byte[] put / byte[] query support and rebuild-path fixes. End-to-end HTTP wire path completed by #4136 / #4135.HTTP: route int8 query vectors to byte[] via $bytes/$int8 markers (#4… (
HTTP: route int8 query vectors to byte[] via $bytes/$int8 markers (#4… (
chore(deps): bump com.google.api.grpc:proto-google-common-protos from…
HTTP: route int8 query vectors to byte[] via $bytes/$int8 markers (#4… (