MemPalace/mempalace · error · ValueError

milvus requires explicit embeddings

Error message

milvus requires explicit embeddings

What it means

Error "milvus requires explicit embeddings" thrown in MemPalace/mempalace.

Source

Thrown at mempalace/backends/milvus.py:532

            document_bytes = _utf8_len(document)
            if document_bytes > DOCUMENT_MAX_LENGTH:
                raise ValueError(
                    f"row {idx}: document byte length {document_bytes} exceeds "
                    f"Milvus VARCHAR limit {DOCUMENT_MAX_LENGTH}; chunk before storing"
                )
            row = {
                FIELD_ID: doc_id,
                FIELD_DOCUMENT: document,
                FIELD_METADATA: _jsonable_metadata(metadata),
                FIELD_VECTOR: vector,
            }
            row.update(row[FIELD_METADATA])
            rows.append(row)
        return rows, dimension

    def add(self, *, documents, ids, metadatas=None, embeddings=None):
        if embeddings is None:
            raise ValueError("milvus requires explicit embeddings")
        if len(set(ids)) != len(ids):
            raise ValueError("add ids must be unique")
        rows, dimension = self._prepare_rows(
            documents=documents,
            ids=ids,
            metadatas=metadatas,
            embeddings=embeddings,
        )
        if not rows:
            return
        if self._remote_exists():
            existing = self.get(ids=list(ids), include=[])
            if existing.ids:
                raise ValueError(f"ids already exist in milvus collection: {existing.ids}")
        self._ensure_remote_collection(dimension)
        self._client.insert(collection_name=self._remote_collection, data=rows)
        self._backend._write_marker(self._palace, self._config)

View on GitHub (pinned to 06cb6987f0)

Solutions

  1. Compute embeddings explicitly and pass them to add/upsert; the milvus backend does not embed on your behalf

When it happens

Trigger: Thrown at mempalace/backends/milvus.py:532 when the library encounters an invalid state.

Common situations: Caller relied on server-side embedding which the milvus backend does not provide.


AI-assisted analysis of MemPalace/mempalace@06cb6987f0 (2026-08-15). Data as JSON: /api/errors/5f8b31ae58b0ae2d. Report an issue: GitHub.