chroma-core/chroma · error · ChromaValueError
Cannot embed string query for key '${key}': key not found in
Error message
Cannot embed string query for key '${key}': key not found in schema. Provide an embedded vector or configure an embedding function. What it means
Error "Cannot embed string query for key '${key}': key not found in schema. 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:660
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,
);
if (!sparseEmbeddings || sparseEmbeddings.length !== 1) {
throw new ChromaValueError(
"Sparse embedding function returned unexpected number of embeddings.",
);
}
return { ...knn, query: sparseEmbeddings[0] };View on GitHub (pinned to aecdd12c8a)
When it happens
Trigger: Thrown at clients/new-js/packages/chromadb/src/collection.ts:660 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/2a628cce0abd1f24.
Report an issue: GitHub.