chroma-core/chroma · error · ChromaValueError
At least one search payload must be provided.
Error message
At least one search payload must be provided.
What it means
Raised by Collection.search when the searches argument normalizes to an empty list — e.g. an empty array was passed directly, or a batch search call contains zero search payloads. The search API requires at least one query (query embeddings, texts, or ids) to execute.
Solutions
- Pass at least one search payload object (knn, filter, etc.).
- Check that the variable holding searches is populated before calling search().
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at clients/new-js/packages/chromadb/src/collection.ts:1034 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/f5e1321bb3900298.
Report an issue: GitHub.
Appendix: source
Thrown at clients/new-js/packages/chromadb/src/collection.ts:1034
documents: data.documents ?? [],
embeddings: data.embeddings ?? [],
ids: data.ids ?? [],
include: data.include,
metadatas: deserializedMetadatas as (TMeta | null)[][],
uris: data.uris ?? [],
});
}
public async search(
searches: SearchLike | SearchLike[],
options?: {
readLevel?: ReadLevel;
},
): Promise<SearchResult> {
const items = Array.isArray(searches) ? searches : [searches];
if (items.length === 0) {
throw new ChromaValueError(
"At least one search payload must be provided.",
);
}
const payloads = await Promise.all(
items.map(async (search) => {
const payload = toSearch(search).toPayload();
return this.embedSearchPayload(payload);
}),
);
const { data } = await RecordService.collectionSearch({
client: this.apiClient,
path: await this.path(),
body: {
searches: payloads,
read_level: options?.readLevel,
},View on GitHub (pinned to aecdd12c8a)