cloudflare-vectorize

jezweb/claude-skills · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/jezweb/claude-skills --skill cloudflare-vectorize
0 commentsdiscussion
summary

$22

skill.md

Cloudflare Vectorize

Complete implementation guide for Cloudflare Vectorize - a globally distributed vector database for building semantic search, RAG (Retrieval Augmented Generation), and AI-powered applications with Cloudflare Workers.

Status: Production Ready ✅ Last Updated: 2026-01-21 Dependencies: cloudflare-worker-base (for Worker setup), cloudflare-workers-ai (for embeddings) Latest Versions: [email protected], @cloudflare/[email protected] Token Savings: ~70% Errors Prevented: 14 Dev Time Saved: ~4 hours

What This Skill Provides

Core Capabilities

  • Index Management: Create, configure, and manage vector indexes
  • Vector Operations: Insert, upsert, query, delete, and list vectors (list-vectors added August 2025)
  • Metadata Filtering: Advanced filtering with 10 metadata indexes per index
  • Semantic Search: Find similar vectors using cosine, euclidean, or dot-product metrics
  • RAG Patterns: Complete retrieval-augmented generation workflows
  • Workers AI Integration: Native embedding generation with @cf/baai/bge-base-en-v1.5
  • OpenAI Integration: Support for text-embedding-3-small/large models
  • Document Processing: Text chunking and batch ingestion pipelines
  • Testing Setup: Vitest configuration with Vectorize bindings

Templates Included

  1. basic-search.ts - Simple vector search with Workers AI
  2. rag-chat.ts - Full RAG chatbot with context retrieval
  3. document-ingestion.ts - Document chunking and embedding pipeline
  4. metadata-filtering.ts - Advanced filtering patterns

⚠️ Vectorize V2 Breaking Changes (September 2024)

IMPORTANT: Vectorize V2 became GA in September 2024 with significant breaking changes.

What Changed in V2

Performance Improvements:

  • Index capacity: 200,000 → 5 million vectors per index
  • Query latency: 549ms → 31ms median (18× faster)
  • TopK limit: 20 → 100 results per query
  • Scale limits: 100 → 50,000 indexes per account
  • Namespace limits: 100 → 50,000 namespaces per index

Breaking API Changes:

  1. Async Mutations - All mutations now asynchronous:

    // V2: Returns mutationId
    const result = await env.VECTORIZE_INDEX.insert(vectors);
    console.log(result.mutationId); // "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    
    // Vector inserts/deletes may take a few seconds to be reflected
    
  2. returnMetadata Parameter - Boolean → String enum:

    // ❌ V1 (deprecated)
    { returnMetadata: true }
    
    // ✅ V2 (required)
    { returnMetadata: 'all' | 'indexed' | 'none' }
    
  3. Metadata Indexes Required Before Insert:

    • V2 requires metadata indexes created BEFORE vectors inserted
    • Vectors added before metadata index won't be indexed
    • Must re-upsert vectors after creating metadata index

V1 Deprecation Timeline:

  • December 2024: Can no longer create V1 indexes
  • Existing V1 indexes: Continue to work (other operations unaffected)
  • Migration: Use wrangler vectorize --deprecated-v1 flag for V1 operations

Wrangler Version Required:

Check Mutation Status

// Get index info to check last mutation processed
const info = await env.VECTORIZE_INDEX.describe();
console.log(info.mutationId); // Last mutation ID
console.log(info.processedUpToMutation); // Last processed timestamp

Critical Setup Rules

⚠️ MUST DO BEFORE INSERTING VECTORS

# 1. Create the index with FIXED dimensions and metric
npx wrangler vectorize create my-index \
  --dimensions=768 \
  --metric=cosine

# 2. Create metadata indexes IMMEDIATELY (before inserting vectors!)
npx wrangler vectorize create-metadata-index my-index \
  --property-name=category \
  --type=string

npx wrangler vectorize create-metadata-index my-index \
  --property-name=timestamp \
  --type=number

Why: Metadata indexes MUST exist before vectors are inserted. Vectors added before a metadata index was created won't be filterable on that property.

Index Configuration (Cannot Be Changed Later)

# Dimensions MUST match your embedding model output:
# - Workers AI @cf/baai/bge-base-en-v1.5: 768 dimensions
# - OpenAI text-embedding-3-small: 1536 dimensions
# - OpenAI text-embedding-3-large: 3072 dimensions

# Metrics determine similarity calculation:
# - cosine: Best for normalized embeddings (most common)
# - euclidean: Absolute distance between vectors
# - dot-product: For non-normalized vectors

Wrangler Configuration

wrangler.jsonc:

{
  "name": "my-vectorize-worker",
  "main": "src/index.ts",
  "compatibility_date": "2025-10-21",
  "vectorize": [
    {
      "binding": "VECTORIZE_INDEX",
      "index_name": "my-index"
    }
  ],
  "ai": {
    "binding": "AI"
  }
}

TypeScript Types

export interface Env {
  VECTORIZE_INDEX: VectorizeIndex;
  AI: Ai;
}

interface VectorizeVector {
  id: string;
  values: number[] | Float32Array | Float64Array;
  namespace?: string;
  metadata?: Record<string, string | number | boolean | string[]>;
}

interface VectorizeMatches {
  matches: Array<{
    id: string;
    score: number;
    values?: number[];
    metadata?: Record<string, any>;
    namespace?: string;
  }>;
  count: number;
}

Metadata Filter Operators (V2)

Vectorize V2 supports advanced metadata filtering with range queries:

// Equality (implicit $eq)
{ category: "docs" }

// Not equals
{ status: { $ne: "archived" } }

// In/Not in arrays
{ category: { $in: ["docs", "tutorials"] } }
{ category: { $nin: ["deprecated", "draft"] } }

// Range queries (numbers) - NEW in V2
{ timestamp: { $gte: 1704067200, $lt: 1735689600 } }

// Range queries (strings) - prefix searching
{ url: { $gte: "/docs/workers", $lt: "/docs/workersz" } }

// Nested metadata with dot notation
{ "author.id": "user123" }

// Multiple conditions (implicit AND)
{ category: "docs", language: "en", "metadata.published": true }

Metadata Best Practices

1. Cardinality Considerations

Low Cardinality (Good for $eq filters):

// Few unique values - efficient filtering
metadata: {
  category: "docs",        // ~10 categories
  language: "en",          // ~5 languages
  published: true          // 2 values (boolean)
}

High Cardinality (Avoid in range queries):

// Many unique values - avoid large range scans
metadata: {
  user_id: "uuid-v4...",         // Millions of unique values
  timestamp_ms: 1704067200123    // Use seconds instead
}

2. Metadata Limits

  • Max 10 metadata indexes per Vectorize index
  • Max 10 KiB metadata per vector
  • String indexes: First 64 bytes (UTF-8)
  • Number indexes: Float64 precision
  • Filter size: Max 2048 bytes (compact JSON)

3. Vector Dimension Limit

Current Limit: 1536 dimensions per vector Source: GitHub Issue #8729

Supported Embedding Models:

  • Workers AI @cf/baai/bge-base-en-v1.5: 768 dimensions ✅
  • OpenAI text-embedding-3-small: 1536 dimensions ✅
  • OpenAI text-embedding-3-large: 3072 dimensions ❌ (requires dimension reduction)

Unsupported Models (>1536 dimensions):

  • nomic-embed-code: 3584 dimensions
  • Qodo-Embed-1-7B: >1536 dimensions

Workaround: Use dimensionality reduction (e.g., PCA) to compress embeddings to 1536 or fewer dimensions, though this may reduce semantic quality.

Feature Request: Higher dimension support is under consideration. Use Limit Increase Request Form if this blocks your use case.

4. Key Restrictions

// ❌ INVALID metadata keys
metadata: {
  "": "value",              // Empty key
  
how to use cloudflare-vectorize

How to use cloudflare-vectorize on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add cloudflare-vectorize
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/jezweb/claude-skills --skill cloudflare-vectorize

The skills CLI fetches cloudflare-vectorize from GitHub repository jezweb/claude-skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/cloudflare-vectorize

Reload or restart Cursor to activate cloudflare-vectorize. Access the skill through slash commands (e.g., /cloudflare-vectorize) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.758 reviews
  • Min Agarwal· Dec 16, 2024

    Keeps context tight: cloudflare-vectorize is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Xiao Li· Dec 16, 2024

    Solid pick for teams standardizing on skills: cloudflare-vectorize is focused, and the summary matches what you get after install.

  • Henry Srinivasan· Dec 12, 2024

    Registry listing for cloudflare-vectorize matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Anaya Flores· Nov 27, 2024

    Keeps context tight: cloudflare-vectorize is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Xiao Kapoor· Nov 7, 2024

    cloudflare-vectorize has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Rahul Santra· Nov 3, 2024

    Keeps context tight: cloudflare-vectorize is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Nia Patel· Nov 3, 2024

    cloudflare-vectorize reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Mia Shah· Nov 3, 2024

    I recommend cloudflare-vectorize for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Xiao Sharma· Oct 26, 2024

    cloudflare-vectorize fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Pratham Ware· Oct 22, 2024

    I recommend cloudflare-vectorize for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

showing 1-10 of 58

1 / 6