You'd be better using workers for platforms and dynamically binding a db
You'd be better using workers for platforms and dynamically binding a db


--experimental-vectorize-bind-to-prod flag get stable, it fails 4/5 times resulting in 10000 Auth errorID can only be part of a single namespace .."embedding_values = [32.4, 74.1, 3.2, ...];
//sampleVectors_1 : (Same embedding value, same namespace, only Vector-ID differ)
const sampleVectors_1: Array<VectorizeVector> = [
{ id: "1", values: embedding_values, namespace: "text", },
{ id: "2", values: embedding_values, namespace: "text", },
]
vitest-pool-workers to test my app in Github Action, and running into the following error with VectorizeIndex.query():VECTOR_QUERY_ERROR: STATUS + 500 error other than this message and this thread

VectorizeIndex looks like the old types for me. For example, upsert is typed to return Promise<VectorizeVectorMutation> which doesn't include the mutationIddeleteByIds, is there a way to delete all vectors that match a namespace?deleteByIds?deleteById seems the way, but will the empty namespace still count against the 5K quota?embedding_values = [32.4, 74.1, 3.2, ...];
//sampleVectors_1 : (Same embedding value, same namespace, only Vector-ID differ)
const sampleVectors_1: Array<VectorizeVector> = [
{ id: "1", values: embedding_values, namespace: "text", },
{ id: "2", values: embedding_values, namespace: "text", },
]workerd/io/worker.c++:2169: info: uncaught exception; source = Uncaught (in promise); stack = Error: VECTOR_QUERY_ERROR: Status + 500
at VectorizeIndexImpl._send (cloudflare-internal:vectorize-api:185:23)
at VectorizeIndexImpl.queryImplV2 (cloudflare-internal:vectorize-api:205:21)
at VectorizeIndexImpl.query (cloudflare-internal:vectorize-api:45:20)export const search = base
.route({ method: 'POST', path: '/ai/vectors/search' })
.input(
z.object({
embeddings: z.array(z.number()),
topK: z.number().optional().default(10),
filter: z.record(z.string(), z.any()).optional(),
})
)
.output(vectorizeMatchesSchema)
.handler(async ({ input, context }) => {
const options: VectorizeQueryOptions = {
returnMetadata: true,
topK: input.topK,
};
if (input.filter) {
options.filter = input.filter;
}
const results = await context.env.VECTORIZE.query(input.embeddings, options);
return vectorizeMatchesSchema.parse(results);
}); return await client.ai.vectors.search({
embeddings: embeddings.data[0] ?? [],
topK,
filter: {
userId: {
$eq: userId,
},
},
});
}deleteByIdsdeleteByIdsdeleteById