Vectorize
Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:9998
A Vectorize Vector Search Index for querying vectors/embeddings.
Mutations in this version are async, returning a mutation id.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Vectorize():
Vectorize
Returns
Section titled “Returns”Vectorize
Methods
Section titled “Methods”deleteByIds()
Section titled “deleteByIds()”deleteByIds(
ids):Promise<VectorizeAsyncMutation>
Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:10041
Delete a list of vectors with a matching id.
Parameters
Section titled “Parameters”string[]
List of vector ids that should be deleted.
Returns
Section titled “Returns”Promise<VectorizeAsyncMutation>
A promise that resolves with a unique identifier of a mutation containing the delete changeset.
describe()
Section titled “describe()”describe():
Promise<VectorizeIndexInfo>
Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:10003
Get information about the currently bound index.
Returns
Section titled “Returns”Promise<VectorizeIndexInfo>
A promise that resolves with information about the current index.
getByIds()
Section titled “getByIds()”getByIds(
ids):Promise<VectorizeVector[]>
Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:10047
Get a list of vectors with a matching id.
Parameters
Section titled “Parameters”string[]
List of vector ids that should be returned.
Returns
Section titled “Returns”Promise<VectorizeVector[]>
A promise that resolves with the raw unscored vectors matching the id set.
insert()
Section titled “insert()”insert(
vectors):Promise<VectorizeAsyncMutation>
Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:10029
Insert a list of vectors into the index dataset. If a provided id exists, an error will be thrown.
Parameters
Section titled “Parameters”vectors
Section titled “vectors”List of vectors that will be inserted.
Returns
Section titled “Returns”Promise<VectorizeAsyncMutation>
A promise that resolves with a unique identifier of a mutation containing the insert changeset.
query()
Section titled “query()”query(
vector,options?):Promise<VectorizeMatches>
Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:10010
Use the provided vector to perform a similarity search across the index.
Parameters
Section titled “Parameters”vector
Section titled “vector”Input vector that will be used to drive the similarity search.
number[] | VectorFloatArray
options?
Section titled “options?”Configuration options to massage the returned data.
Returns
Section titled “Returns”Promise<VectorizeMatches>
A promise that resolves with matched and scored vectors.
queryById()
Section titled “queryById()”queryById(
vectorId,options?):Promise<VectorizeMatches>
Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:10020
Use the provided vector-id to perform a similarity search across the index.
Parameters
Section titled “Parameters”vectorId
Section titled “vectorId”string
Id for a vector in the index against which the index should be queried.
options?
Section titled “options?”Configuration options to massage the returned data.
Returns
Section titled “Returns”Promise<VectorizeMatches>
A promise that resolves with matched and scored vectors.
upsert()
Section titled “upsert()”upsert(
vectors):Promise<VectorizeAsyncMutation>
Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:10035
Upsert a list of vectors into the index dataset. If a provided id exists, it will be replaced with the new values.
Parameters
Section titled “Parameters”vectors
Section titled “vectors”List of vectors that will be upserted.
Returns
Section titled “Returns”Promise<VectorizeAsyncMutation>
A promise that resolves with a unique identifier of a mutation containing the upsert changeset.