Skip to content
← Back to Dashboard

AdaptHex Technology

AdaptHex is Adaptensor's proprietary vector compression technology that stores embeddings at 4-8x smaller size while preserving 99.6% search accuracy.


The Problem

Traditional vector databases like Pinecone and Weaviate store embeddings as 32-bit floating point numbers (float32). For a typical 384-dimension embedding:

Standard float32: 384 dimensions × 4 bytes = 1,536 bytes per vector

When you have millions of documents with thousands of chunks each, storage costs explode:

Documents Chunks Float32 Storage
1,000 50,000 73 MB
10,000 500,000 732 MB
100,000 5,000,000 7.3 GB

The AdaptHex Solution

AdaptHex compresses vectors by quantizing float32 values into 8-bit hexadecimal encoding:

AdaptHex hex8: 384 dimensions × 1 byte = 384 bytes per vector

That's a 4x reduction with virtually no loss in search quality.

How It Works

  1. Normalize: Scale all values to 0-255 range
  2. Quantize: Convert to 8-bit integers
  3. Encode: Store as hexadecimal string (2 characters per dimension)
# Original float32 vector
[0.0234, -0.1456, 0.0891, 0.2341, -0.0523, ...]

# After AdaptHex (hex8)
"80827E7C74807C7F82807B7F7F7C747F75847F..."

Compression Modes

Mode Compression Bytes/Vector Accuracy Use Case
float32 1x 1,536 100% Baseline
hex8 4x 384 99.6% Recommended
hex4 8x 192 95.8% Budget/High-volume
binary 32x 48 ~85% Experimental

Accuracy Benchmarks

We tested AdaptHex on real-world document search tasks:

Cosine Similarity Preservation

Original query: "aluminum alloy heat treatment"

Float32 top result score: 0.7456
Hex8 top result score:    0.7442

Difference: 0.19%

Ranking Preservation

In our tests with 3,508 document chunks:

  • 99.2% of top-5 results identical to float32
  • 99.8% of top-10 results identical to float32
  • 100% of relevant documents found

Storage Comparison

Real-world example with FAA aviation maintenance documents:

Metric Float32 AdaptHex (hex8) Savings
Chunks 3,508 3,508 -
Vector Storage 5.4 MB 1.35 MB 75%
Query Time 142ms 136ms 4% faster
Accuracy 100% 99.6% Negligible

Technical Deep Dive

Quantization Algorithm

def quantize_to_hex8(vector: List[float]) -> str:
    """
    Convert float32 vector to hex8 encoding.

    1. Normalize to [0, 1] range using min-max scaling
    2. Scale to [0, 255] for 8-bit representation
    3. Convert each value to 2-character hex string
    """
    # Find range
    v_min, v_max = min(vector), max(vector)
    v_range = v_max - v_min

    # Normalize and quantize
    hex_chars = []
    for val in vector:
        # Normalize to 0-1
        normalized = (val - v_min) / v_range if v_range > 0 else 0.5
        # Scale to 0-255
        quantized = int(normalized * 255)
        # Convert to hex
        hex_chars.append(f"{quantized:02x}")

    return "".join(hex_chars)

Similarity Computation

AdaptHex vectors can be compared directly without decompression:

def hex_cosine_similarity(hex_a: str, hex_b: str) -> float:
    """
    Compute cosine similarity between two hex-encoded vectors.
    """
    # Decode hex to integers
    vec_a = [int(hex_a[i:i+2], 16) for i in range(0, len(hex_a), 2)]
    vec_b = [int(hex_b[i:i+2], 16) for i in range(0, len(hex_b), 2)]

    # Compute cosine similarity
    dot = sum(a * b for a, b in zip(vec_a, vec_b))
    norm_a = sum(a * a for a in vec_a) ** 0.5
    norm_b = sum(b * b for b in vec_b) ** 0.5

    return dot / (norm_a * norm_b)

When to Use Each Mode

  • Use for: Most production workloads
  • Accuracy: 99.6%
  • Compression: 4x
  • Best when: You need reliable search quality with significant storage savings

hex4 (Budget)

  • Use for: Very large document collections, cost-sensitive applications
  • Accuracy: 95.8%
  • Compression: 8x
  • Best when: You can tolerate slightly lower precision for 2x more savings

binary (Experimental)

  • Use for: Research, prototyping, massive-scale applications
  • Accuracy: ~85%
  • Compression: 32x
  • Best when: You need extreme compression and can accept accuracy tradeoffs

Competitive Advantage

Neither Pinecone nor Weaviate offer built-in vector compression:

Feature Pinecone Weaviate Adaptensor
Vector Storage float32 only float32 only AdaptHex (4-8x)
Storage Cost $$$ $$$ $
Search Quality 100% 100% 99.6%
Built-in Compression

Using AdaptHex

In the Python SDK

from adaptensor import Adaptensor

client = Adaptensor()

# Embed with compression (default)
result = client.embed("your text here")
print(f"Hex: {result.hex_embedding[:50]}...")

# Choose compression mode
result = client.embed("your text", mode="hex4")  # 8x compression

Via API

curl -X POST "https://api.adaptensor.com/embed_and_quantize" \
  -H "Content-Type: application/json" \
  -d '{"text": "your text here", "mode": "hex8"}'

Configuration

Set default compression mode for your account:

# In project settings
{
  "hex_mode": "hex8",  # or "hex4", "binary"
  "auto_compress": true
}

FAQ

Does compression affect search results?

Minimally. With hex8, 99.6% of cosine similarity is preserved. In practice, the same documents are found and rankings are nearly identical.

Can I decompress vectors later?

Yes, but there's some information loss. The original float32 values cannot be perfectly reconstructed. However, for search purposes, this doesn't matter — the relative similarities are preserved.

Why hexadecimal encoding?

Hex strings are: - Compact (2 characters per byte) - Human-readable for debugging - Easy to store in any database - Fast to parse

Is AdaptHex patentable?

We're exploring patent protection for our specific quantization and similarity algorithms. This represents a sustainable competitive advantage.


Next Steps