admin_reindex_all
Backfill Cloudflare Vectorize embeddings for all existing contexts across every project in one call.
Overview
admin_reindex_all is a cross-project version of reindex_project. It iterates every context in D1 — regardless of project — and writes vector embeddings to Vectorize. Run it once after initial setup or after adding Vectorize to an existing deployment.
Added: v3.6.0
Layer: Infrastructure / Admin
Purpose: One-shot Vectorize backfill across all projects
Parameters
None. No arguments required.
Returns
A count of indexed contexts broken down by project:
Reindexed 47 contexts across all projects — semantic search now covers all historical snapshots.
By project:
- wake-intelligence: 12
- api-service: 23
- mobile-app: 8
- home-wake-test: 4If the Vectorize index is not configured or no contexts exist:
No contexts reindexed. Either no contexts exist or the vector index is not configured.When to Use
After Initial Deployment
The first time you connect Wake Intelligence to Vectorize, existing contexts have no embeddings. admin_reindex_all seeds the index in one call.
After a Vectorize Outage
If Cloudflare Vectorize was unavailable when contexts were saved, those contexts fell back to keyword-only search. Reindex to restore semantic coverage.
When Semantic Search Returns Nothing
If natural language queries consistently return no results, the Vectorize index is likely empty or sparse. Run this to restore full semantic search.
Example
admin_reindex_all()Reindexed 47 contexts across all projects — semantic search now covers all historical snapshots.
By project:
- my-project: 31
- side-project: 16How It Works
Internally, admin_reindex_all:
- Fetches all contexts from D1 (up to 2,000)
- For each context, generates a vector embedding from its AI-summarized text using
@cf/baai/bge-base-en-v1.5 - Upserts the vector into the
wake-context-embeddingsVectorize index with the project as metadata - Returns a count per project
Contexts that already have embeddings are overwritten with fresh ones (upsert is idempotent).
Performance
- Processes up to 2,000 contexts per call
- ~500ms per 10 contexts (embedding generation via Workers AI dominates)
- For large deployments, prefer running during low-traffic periods
vs. reindex_project
reindex_project | admin_reindex_all | |
|---|---|---|
| Scope | Single project | All projects |
| Arguments | project (required) | None |
| Use case | Targeted backfill | Initial setup, full reset |
See Also
- reindex_project — Single-project backfill
- search_context — Semantic search that benefits from reindexing
- get_memory_health — Check overall system health
