{"record":{"id":"f22df8b8b9637c17","repo":"MemPalace/mempalace","slug":"qdrant-requires-query-embeddings-use-palace-get-c","errorCode":null,"errorMessage":"qdrant requires query_embeddings; use palace.get_collection wrapper","messagePattern":"qdrant requires query_embeddings; use palace\\.get_collection wrapper","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mempalace/backends/qdrant.py","lineNumber":956,"sourceCode":"            ids=outer_ids,\n            documents=outer_docs,\n            metadatas=outer_metas,\n            distances=outer_dists,\n            embeddings=outer_embeds if spec.embeddings else None,\n        )\n\n    def query(\n        self,\n        *,\n        query_texts=None,\n        query_embeddings=None,\n        n_results=10,\n        where=None,\n        where_document=None,\n        include=None,\n    ) -> QueryResult:\n        if query_texts is not None:\n            raise ValueError(\"qdrant requires query_embeddings; use palace.get_collection wrapper\")\n        if query_embeddings is None:\n            raise ValueError(\"query requires query_embeddings\")\n        if not query_embeddings:\n            raise ValueError(\"query input must be a non-empty list\")\n        _validate_where(where)\n        _validate_where(where_document)\n        if _requires_local_filter(where, where_document):\n            return self._query_local_exact(\n                query_embeddings=query_embeddings,\n                n_results=n_results,\n                where=where,\n                where_document=where_document,\n                include=include,\n            )\n        if not self._remote_exists():\n            if self._marker_exists():\n                raise CollectionNotInitializedError(self._collection_name)\n            return QueryResult.empty(","sourceCodeStart":938,"sourceCodeEnd":974,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/backends/qdrant.py#L938-L974","documentation":"Raised by QdrantCollection.query() when query_texts is passed. This backend cannot embed text server-side or internally; it accepts only precomputed query_embeddings. The message directs callers to the palace.get_collection wrapper, which embeds query_texts with the configured local model before delegating.","triggerScenarios":"Calling raw collection.query(query_texts=[\"hello\"], ...) — the natural call shape for Chroma users. Also a search wrapper forwarding user text straight to the backend collection without embedding it first.","commonSituations":"Porting search code from the default Chroma backend; using a handle from backend.get_collection() rather than palace.get_collection(); a query layer that conditionally passes texts or embeddings but never embeds the texts branch.","solutions":["Use the palace wrapper collection (palace.get_collection) which accepts query_texts and embeds them","Or embed first: query(query_embeddings=[embedder.embed(\"hello\")])","Keep a single search entry point in your code that always goes through the wrapper","Confirm the embedder runtime is up so wrapper-based text queries work"],"exampleFix":"# before\ncollection.query(query_texts=[\"hello\"], n_results=5)  # ValueError\n// after\nres = collection.query(query_embeddings=[embedder.embed(\"hello\")], n_results=5)\n# or simply: wrapped = palace.get_collection(\"notes\"); wrapped.query(query_texts=[\"hello\"], n_results=5)","handlingStrategy":"validation","validationCode":"if query_texts is not None:\n    query_embeddings = [embedder.embed(t) for t in query_texts]\n    query_texts = None","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Search through the palace wrapper, which accepts query_texts","Keep one search function in the codebase; never call raw backend query with text"],"tags":["api-misuse","search","qdrant","wrapper"],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}