rig-vectorize 0.1.0

Cloudflare Vectorize vector store implementation for the Rig framework
Documentation

rig-vectorize

Vector store integration for Cloudflare Vectorize. This integration supports vector similarity search and document insertion using Rig's embedding providers.

You can find end-to-end examples here.

For Vectorize-specific questions, ask in the Cloudflare Developers Discord.

Running Integration Tests

Integration tests require a real Cloudflare Vectorize index.

1. Create a Vectorize index

npx wrangler vectorize create rig-integration-test --dimensions=1536 --metric=cosine

2. Set environment variables and run tests

export CLOUDFLARE_ACCOUNT_ID="your-account-id"
export CLOUDFLARE_API_TOKEN="your-api-token"
export VECTORIZE_INDEX_NAME="rig-integration-test"
cargo test --package rig-vectorize --test integration_tests -- --test-threads=1

Tests run sequentially (--test-threads=1) to avoid conflicts since they clear the index before each test.

Note: Vectorize has eventual consistency. Tests wait 5 seconds after inserting documents before querying (configured via EVENTUAL_CONSISTENCY_DELAY constant).

3. (Optional) Enable filter tests

Filter tests require metadata indexes. Without them, filter tests will be skipped:

npx wrangler vectorize create-metadata-index rig-integration-test --property-name=category --type=string
npx wrangler vectorize create-metadata-index rig-integration-test --property-name=id --type=string