-
Notifications
You must be signed in to change notification settings - Fork 10k
[Vectorize] Add documentation for the Vectorize list-vectors operation #24680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
pedrosousa
merged 2 commits into
cloudflare:production
from
garvit-gupta:garvit/VS-449/list-vectors
Aug 26, 2025
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
src/content/docs/vectorize/best-practices/list-vectors.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| --- | ||
| title: List vectors | ||
| pcx_content_type: concept | ||
| sidebar: | ||
| order: 5 | ||
|
|
||
| --- | ||
|
|
||
| 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: | ||
|
|
||
| - **Bulk operations**: When you need to process all vectors in an index | ||
| - **Auditing**: To verify the contents of your index or generate reports | ||
| - **Data migration**: When moving vectors between indexes or systems | ||
| - **Cleanup operations**: To identify and remove outdated vectors | ||
|
|
||
| ## 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: | ||
|
|
||
| - **New vectors**: Vectors inserted after the initial request will not appear in subsequent paginated results | ||
| - **Deleted vectors**: Vectors deleted after the initial request will continue to appear in the remaining responses until pagination is complete | ||
|
|
||
| ### 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: | ||
| - `count`: Number of vectors returned in this response | ||
| - `totalCount`: Total number of vectors in the index | ||
| - `isTruncated`: Whether there are more vectors available | ||
| - `nextCursor`: Cursor for the next page (null if no more results) | ||
| - `cursorExpirationTimestamp`: When the cursor expires | ||
Oxyjun marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - `vectors`: Array of vector identifiers | ||
|
|
||
| ### 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: | ||
|
|
||
| ```sh | ||
| # 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 | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.