{"record":{"id":"ea1c2e5e3f8a6a2a","repo":"RyanCodrai/turbovec","slug":"turboquantvectorstore-get-text-id-cannot-return-t","errorCode":null,"errorMessage":"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.","messagePattern":"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\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"turbovec-python/python/turbovec/llama_index.py","lineNumber":542,"sourceCode":"\n        The new index keeps the same ``bit_width`` so subsequent adds\n        commit a new ``dim`` lazily.\n        \"\"\"\n        with self._write_lock:\n            bw = self._index.bit_width\n            self._index = IdMapIndex(bit_width=bw)\n            self._nodes = {}\n            self._node_id_to_u64 = {}\n            self._u64_to_node_id = {}\n            self._next_u64 = 0\n\n    def get(self, text_id: str) -> List[float]:\n        \"\"\"LlamaIndex's protocol expects this to return the full-precision\n        embedding for a given node id. turbovec discards full-precision\n        embeddings after quantization, so we raise loudly with an\n        explanation rather than return a lossy reconstruction or zeroes.\n        \"\"\"\n        raise NotImplementedError(\n            \"TurboQuantVectorStore.get(text_id) cannot return the original \"\n            \"embedding because turbovec quantizes vectors to 2-4 bits per \"\n            \"dimension and discards full precision after encoding. Keep a \"\n            \"parallel docstore if you need the raw embedding.\"\n        )\n\n    def get_nodes(\n        self,\n        node_ids: Optional[List[str]] = None,\n        filters: Optional[MetadataFilters] = None,\n    ) -> List[BaseNode]:\n        \"\"\"Return the nodes matching ``node_ids`` and/or ``filters``. Both\n        constraints intersect when supplied; missing node_ids are\n        silently skipped. ``node_ids`` is the explicit selection here: an\n        empty list selects nothing and returns ``[]``, unlike ``query``'s\n        ``node_ids=[]``, which follows the retriever calling convention\n        and restricts nothing.\n","sourceCodeStart":524,"sourceCodeEnd":560,"githubUrl":"https://github.com/RyanCodrai/turbovec/blob/ccab9f325e6ce2a270a87daf01ae4e443bcf2d49/turbovec-python/python/turbovec/llama_index.py#L524-L560","documentation":"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.","triggerScenarios":"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).","commonSituations":"Using this store with features that assume retrievable full-precision vectors (upsert sync, MMR, backfill); porting code that worked with SimpleVectorStore.","solutions":["Keep a parallel full-precision docstore (e.g. SimpleDocumentStore) alongside the quantized store","If full-precision retrieval is required, use SimpleVectorStore or another lossless store instead","Refactor the caller to not need get() — rely on query results only"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    emb = store.get(node_id)\nexcept NotImplementedError:\n    emb = full_precision_docstore.get_document(node_id).embedding","preventionTips":["Pair TurboQuantVectorStore with a full-precision docstore if sync flows need raw embeddings","Avoid LlamaIndex features that call store.get() (store sync, MMR)","Prefer a lossless store when full-precision retrieval is a hard requirement"],"tags":["python","llama-index","not-implemented","quantization"],"backgroundTag":"method-not-implemented","analyzedSha":"ccab9f325e6ce2a270a87daf01ae4e443bcf2d49","analyzedAt":"2026-09-06T08:39:18.516Z","contentChangedAt":"2026-09-06T08:39:18.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}