chroma-core/chroma · error · ChromaValueError

Cannot embed string query for key '${key}': schema is not av

Error message

Cannot embed string query for key '${key}': schema is not available. Provide an embedded vector or configure an embedding function.

What it means

Error "Cannot embed string query for key '${key}': schema is not available. Provide an embedded vector or configure an embedding function." thrown in chroma-core/chroma.

Source

Thrown at clients/new-js/packages/chromadb/src/collection.ts:653

      return { ...knn };
    }

    const keyValue = knn.key as unknown;
    const key = typeof keyValue === "string" ? keyValue : EMBEDDING_KEY;

    if (key === EMBEDDING_KEY) {
      const embeddings = await this.embed([queryValue], true);
      if (!embeddings || embeddings.length !== 1) {
        throw new ChromaValueError(
          "Embedding function returned unexpected number of embeddings.",
        );
      }
      return { ...knn, query: embeddings[0] };
    }

    const schema = this._schema;
    if (!schema) {
      throw new ChromaValueError(
        `Cannot embed string query for key '${key}': schema is not available. Provide an embedded vector or configure an embedding function.`,
      );
    }

    const valueTypes = schema.keys[key];
    if (!valueTypes) {
      throw new ChromaValueError(
        `Cannot embed string query for key '${key}': key not found in schema. Provide an embedded vector or configure an embedding function.`,
      );
    }

    const sparseIndex = valueTypes.sparseVector?.sparseVectorIndex;
    if (sparseIndex?.enabled && sparseIndex.config.embeddingFunction) {
      const sparseEmbeddingFunction = sparseIndex.config.embeddingFunction;
      const sparseEmbeddings = await this.sparseEmbed(
        sparseEmbeddingFunction,
        [queryValue],
        true,

View on GitHub (pinned to aecdd12c8a)

When it happens

Trigger: Thrown at clients/new-js/packages/chromadb/src/collection.ts:653 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16). Data as JSON: /api/errors/433a6a00ec82b24f. Report an issue: GitHub.