{"record":{"id":"5f8b31ae58b0ae2d","repo":"MemPalace/mempalace","slug":"milvus-requires-explicit-embeddings","errorCode":null,"errorMessage":"milvus requires explicit embeddings","messagePattern":"milvus requires explicit embeddings","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mempalace/backends/milvus.py","lineNumber":532,"sourceCode":"            document_bytes = _utf8_len(document)\n            if document_bytes > DOCUMENT_MAX_LENGTH:\n                raise ValueError(\n                    f\"row {idx}: document byte length {document_bytes} exceeds \"\n                    f\"Milvus VARCHAR limit {DOCUMENT_MAX_LENGTH}; chunk before storing\"\n                )\n            row = {\n                FIELD_ID: doc_id,\n                FIELD_DOCUMENT: document,\n                FIELD_METADATA: _jsonable_metadata(metadata),\n                FIELD_VECTOR: vector,\n            }\n            row.update(row[FIELD_METADATA])\n            rows.append(row)\n        return rows, dimension\n\n    def add(self, *, documents, ids, metadatas=None, embeddings=None):\n        if embeddings is None:\n            raise ValueError(\"milvus requires explicit embeddings\")\n        if len(set(ids)) != len(ids):\n            raise ValueError(\"add ids must be unique\")\n        rows, dimension = self._prepare_rows(\n            documents=documents,\n            ids=ids,\n            metadatas=metadatas,\n            embeddings=embeddings,\n        )\n        if not rows:\n            return\n        if self._remote_exists():\n            existing = self.get(ids=list(ids), include=[])\n            if existing.ids:\n                raise ValueError(f\"ids already exist in milvus collection: {existing.ids}\")\n        self._ensure_remote_collection(dimension)\n        self._client.insert(collection_name=self._remote_collection, data=rows)\n        self._backend._write_marker(self._palace, self._config)\n","sourceCodeStart":514,"sourceCodeEnd":550,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/backends/milvus.py#L514-L550","documentation":"Error \"milvus requires explicit embeddings\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/backends/milvus.py:532 when the library encounters an invalid state.","commonSituations":"Caller relied on server-side embedding which the milvus backend does not provide.","solutions":["Compute embeddings explicitly and pass them to add/upsert; the milvus backend does not embed on your behalf"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}