INTEGRITY Cloudflare Docs

List vectors

The list-vectors operation allows you to enumerate all vector identifiers in a Vectorize index using paginated requests. This guide covers best practices for efficiently using this operation.

When to use list-vectors

Use list-vectors for:

Pagination behavior

The list-vectors operation uses cursor-based pagination with important consistency guarantees:

Snapshot consistency

Vector identifiers returned belong to the index snapshot captured at the time of the first list-vectors request. This ensures consistent pagination even when the index is being modified during iteration:

Starting a new iteration

To see recently added or removed vectors, you must start a new list-vectors request sequence (without a cursor). This captures a fresh snapshot of the index.

Response structure

Each response includes:

Cursor expiration

Cursors have an expiration timestamp. If a cursor expires, you'll need to start a new list-vectors request sequence to continue pagination.

Performance considerations

Take care to have sufficient gap between consecutive requests to avoid hitting rate-limits.

Example workflow

Here's a typical pattern for processing all vectors in an index:

# Start iteration
wrangler vectorize list-vectors my-index --count=1000

# Continue with cursor from response
wrangler vectorize list-vectors my-index --count=1000 --cursor="<cursor-from-response>"

# Repeat until no more results