Skip to content

feat(vector): pre-quantized INT8 ingest for LSM_VECTOR (Tier 4 follow-up) #4132

Closed

Description

@lvca

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)

  1. New vectorEncoding field on LSMVectorIndexMetadata (FLOAT32 default, INT8 opt-in).
  2. LSMVectorIndex.put(record) reads byte[] directly when vectorEncoding=INT8 and the indexed property is ARRAY_OF_BYTES. Skip the internal float32→int8 quantization; JVector accepts INT8 vectors natively via VectorEncoding.BYTE.
  3. vector.neighbors(...) accepts a byte[] query when the index encoding is INT8. Reject cross-encoding queries at parse time with a clear error.
  4. SQL syntax: CREATE INDEX ON Doc (embedding) LSM_VECTOR METADATA { encoding: 'INT8' }. Existing quantization: 'INT8' continues to work for the float32-input + internal-quantize case.
  5. 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)

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_max calibration 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) exposes VectorEncoding.BYTE for 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.neighbors query path + error handling: 1 day
  • Tests (parity + reject path): 2 days
  • Docs + matrix update: 1 day

Activity

  1. self-assigned this
    on May 7, 2026
  2. added this to the 26.5.1 milestone on May 7, 2026
  3. added theissue type on May 7, 2026
  4. lvca commented on May 8, 2026

    @lvca
    MemberAuthor

    Closed by #4133 (merged in ae224e9). LSM_VECTOR now accepts pre-quantized INT8 ingest via encoding: 'INT8' index metadata, with byte[] put / byte[] query support and rebuild-path fixes. End-to-end HTTP wire path completed by #4136 / #4135.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions