{"record":{"id":"1113afc8a7646432","repo":"RyanCodrai/turbovec","slug":"turboquantvectorstore-does-not-support-max-margina","errorCode":null,"errorMessage":"TurboQuantVectorStore does not support max-marginal-relevance search because the underlying quantized index discards full-precision vectors after compression. MMR requires the original embedding for every candidate to compute pairwise diversity. Use `similarity_search` / `similarity_search_with_score` instead, or maintain a parallel store with full-precision embeddings if you need MMR specifically.","messagePattern":"TurboQuantVectorStore does not support max-marginal-relevance search because the underlying quantized index discards full-precision vectors after compression\\. MMR requires the original embedding for every candidate to compute pairwise diversity\\. Use `similarity_search` / `similarity_search_with_score` instead, or maintain a parallel store with full-precision embeddings if you need MMR specifically\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"turbovec-python/python/turbovec/langchain.py","lineNumber":712,"sourceCode":"    _MMR_MSG = (\n        \"TurboQuantVectorStore does not support max-marginal-relevance \"\n        \"search because the underlying quantized index discards \"\n        \"full-precision vectors after compression. MMR requires the \"\n        \"original embedding for every candidate to compute pairwise \"\n        \"diversity. Use `similarity_search` / `similarity_search_with_score` \"\n        \"instead, or maintain a parallel store with full-precision \"\n        \"embeddings if you need MMR specifically.\"\n    )\n\n    def max_marginal_relevance_search(\n        self,\n        query: str,\n        k: int = 4,\n        fetch_k: int = 20,\n        lambda_mult: float = 0.5,\n        **kwargs: Any,\n    ) -> list[Document]:\n        raise NotImplementedError(self._MMR_MSG)\n\n    def max_marginal_relevance_search_by_vector(\n        self,\n        embedding: list[float],\n        k: int = 4,\n        fetch_k: int = 20,\n        lambda_mult: float = 0.5,\n        *,\n        filter: Callable[[Document], bool] | None = None,\n        **kwargs: Any,\n    ) -> list[Document]:\n        raise NotImplementedError(self._MMR_MSG)\n\n    async def amax_marginal_relevance_search(\n        self,\n        query: str,\n        k: int = 4,\n        fetch_k: int = 20,","sourceCodeStart":694,"sourceCodeEnd":730,"githubUrl":"https://github.com/RyanCodrai/turbovec/blob/ccab9f325e6ce2a270a87daf01ae4e443bcf2d49/turbovec-python/python/turbovec/langchain.py#L694-L730","documentation":"NotImplementedError raised by max_marginal_relevance_search (and its by-vector/async variants) unconditionally. MMR needs the full-precision vector of every candidate to compute pairwise diversity, but turbovec's quantized index discards full vectors after compression, so MMR is structurally unimplementable — raised loudly instead of the base class's bare NotImplementedError or, worse, a silent approximation.","triggerScenarios":"Thrown at turbovec-python/python/turbovec/langchain.py:712 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use similarity_search / similarity_search_with_score instead.","Maintain a parallel store with full-precision embeddings if MMR is specifically required.","Catch NotImplementedError in retrieval components to fall back to plain similarity search."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ccab9f325e6ce2a270a87daf01ae4e443bcf2d49","analyzedAt":"2026-09-06T08:39:18.516Z","contentChangedAt":"2026-09-06T08:39:18.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}