RyanCodrai/turbovec · error · NotImplementedError

TurboQuantVectorStore.get(text_id) cannot return the origina

Error message

TurboQuantVectorStore.get(text_id) cannot return the original embedding because turbovec quantizes vectors to 2-4 bits per dimension and discards full precision after encoding. Keep a parallel docstore if you need the raw embedding.

What it means

LlamaIndex's vector store protocol expects get(id) to return the original full-precision embedding, but turbovec quantizes vectors to 2-4 bits per dimension and discards full precision, so exact retrieval is impossible. The library raises NotImplementedError with an explanation rather than returning a lossy reconstruction.

Source

Thrown at turbovec-python/python/turbovec/llama_index.py:542

        The new index keeps the same ``bit_width`` so subsequent adds
        commit a new ``dim`` lazily.
        """
        with self._write_lock:
            bw = self._index.bit_width
            self._index = IdMapIndex(bit_width=bw)
            self._nodes = {}
            self._node_id_to_u64 = {}
            self._u64_to_node_id = {}
            self._next_u64 = 0

    def get(self, text_id: str) -> List[float]:
        """LlamaIndex's protocol expects this to return the full-precision
        embedding for a given node id. turbovec discards full-precision
        embeddings after quantization, so we raise loudly with an
        explanation rather than return a lossy reconstruction or zeroes.
        """
        raise NotImplementedError(
            "TurboQuantVectorStore.get(text_id) cannot return the original "
            "embedding because turbovec quantizes vectors to 2-4 bits per "
            "dimension and discards full precision after encoding. Keep a "
            "parallel docstore if you need the raw embedding."
        )

    def get_nodes(
        self,
        node_ids: Optional[List[str]] = None,
        filters: Optional[MetadataFilters] = None,
    ) -> List[BaseNode]:
        """Return the nodes matching ``node_ids`` and/or ``filters``. Both
        constraints intersect when supplied; missing node_ids are
        silently skipped. ``node_ids`` is the explicit selection here: an
        empty list selects nothing and returns ``[]``, unlike ``query``'s
        ``node_ids=[]``, which follows the retriever calling convention
        and restricts nothing.

View on GitHub (pinned to ccab9f325e)

Solutions

  1. Keep a parallel full-precision docstore (e.g. SimpleDocumentStore) alongside the quantized store
  2. If full-precision retrieval is required, use SimpleVectorStore or another lossless store instead
  3. Refactor the caller to not need get() — rely on query results only
Defensive patterns

Strategy: try-catch

Try / catch

try:
    emb = store.get(node_id)
except NotImplementedError:
    emb = full_precision_docstore.get_document(node_id).embedding

Prevention

When it happens

Trigger: Any call to TurboQuantVectorStore.get(text_id) — most often triggered internally by LlamaIndex flows (e.g. SyncedVectorStore reuse, IngestionPipeline docstore strategy, or code that syncs embeddings between stores).

Common situations: Using this store with features that assume retrievable full-precision vectors (upsert sync, MMR, backfill); porting code that worked with SimpleVectorStore.

Related errors


AI-assisted analysis of RyanCodrai/turbovec@ccab9f325e (2026-09-06). Data as JSON: /api/errors/ea1c2e5e3f8a6a2a. Report an issue: GitHub.