Cloudflare AI Search can now index a D1 database directly
AI Search runs a read-only query against D1 and indexes each row as a document, with scheduled syncs keeping it current. The feature is in beta.
Cloudflare’s AI Search, its managed retrieval-augmented-generation platform, added D1 as a supported data source today. You give it a read-only SQL query; it indexes each row the query returns as a separate document, then re-runs that query on a schedule so new rows get indexed, changed rows get re-indexed, and unchanged rows are skipped.
The query is capped at 10,000 characters, must return between one and 100,000 rows, and can only be a SELECT or WITH statement. You create the instance from the dashboard, the REST API, or a Workers binding, authorised with a service token scoped to a new “AI Search Index Engine” permission. Each sync reads the full query result at least twice, which counts against your D1 rows-read quota.
Why it matters: if you are building search or a RAG pipeline on D1, you no longer need to write and run your own job to keep a vector index in sync with the database. The quota detail matters too: pointing this at a table with a frequently-changing column, such as a view counter, will trigger needless re-indexing and burn through reads faster than expected.
The caveat: the feature is in beta, and Cloudflare’s documentation gives no pricing specifics for the D1-backed indexing itself.