Sulat.com / Writing on AISaturday, November 14, 2026
Databases/13 November 2026

Cloudflare AI Search can now index D1 database rows, with billing from 1 December

Cloudflare says AI Search runs a read-only SQL query on a D1 database and indexes each returned row as a document. The data source is in beta, and AI Search billing starts on 1 December 2026.

3D Cloudflare logo floating above a glass database stack as glowing document cards rise into it

At a glance

  • Cloudflare says AI Search can now use a D1 database as a data source: it runs a read-only query you provide and indexes each returned row as a separate document, in beta.
  • You can create a D1-backed instance from the dashboard, the REST API or the Workers binding, and the query has to return a unique id column and at most 100,000 rows.
  • Cloudflare's docs say scheduled syncs add new rows, re-index changed rows and delete rows the query no longer returns, and the default sync interval is 24 hours.
  • AI Search billing begins on 1 December 2026, with 5 million ingestion tokens and 1,000 semantic queries included each month, and every D1 sync counts toward D1 rows read.

Cloudflare’s AI Search can now index the rows of a D1 database, according to a changelog post dated 12 November 2026. The D1 data source is in beta, and AI Search billing begins on 1 December 2026.

The @CloudflareDev account announced it on X on 13 November, pitching agents that run RAG (retrieval-augmented generation, where a model answers from documents it looks up) over app data, support bots grounded in a help centre, and semantic search over product catalogues.

How rows become documents

AI Search is Cloudflare’s hosted retrieval service: you give it data, and applications or agents search that data in natural language. Cloudflare’s docs list built-in storage uploads, websites and R2 buckets as the existing data sources. D1, Cloudflare’s SQL database, is an optional extra that sits alongside built-in storage.

You supply a read-only SQL query, and AI Search indexes each row it returns as a separate document. A column named title becomes the document heading and content becomes the body. Columns prefixed meta_ become metadata fields you can filter results on, up to five of them. Four templates (Labelled, Content only, Key-value and JSON) set how a row is written out as a document.

Three steps: write a read-only query on a D1 table, each row becomes a document, then ask in plain language and AI Search retrieves matches.
A SQL query turns each D1 row into a document you can search in plain language.

You can create a D1-backed instance from the dashboard, the REST API or the Workers binding. The database has to be in the same account, and the query has to return a unique id column. The API and binding routes also need the token_id of a service API token; Cloudflare says the AI Search Index Engine permission on that token includes D1 Read. In the dashboard, a Test query button runs the query on one row before you create the instance.

What each sync does

D1-backed instances sync on the instance’s schedule. New rows are indexed, changed rows are re-indexed, and rows the query no longer returns are deleted, but only after AI Search has read the full result. If the query fails or returns no rows, the sync ends with an error and the items already indexed stay. The default sync interval is 24 hours, which Cloudflare changed from six hours in a 2 November changelog post.

New rows are indexed, changed rows are re-indexed and removed rows are deleted on each sync, which runs every 24 hours by default.
Each sync adds new rows, refreshes changed ones and drops removed ones.

Every sync reads the full query result at least twice with your service token, once to check the id values and then page by page. Cloudflare’s docs say that counts toward your D1 rows read, which D1 bills under its own pricing.

Query rules and limits

The query has to be a single SELECT or WITH statement. It can’t contain semicolons, SQL comments or bound parameters, and it can’t use ORDER BY or LIMIT, because AI Search reads the result in pages ordered by id. The check for write keywords also runs inside string literals, so the replace() function is rejected too.

LimitValue
Rows returned by the query100,000
Query length10,000 characters
Rendered document per row64 KiB
meta_ columns5
Metadata per row, including the id8,000 bytes as JSON
D1 data source limits, from Cloudflare’s D1 data source docs.

The regular AI Search limit on files per instance also applies, and the lower of the two caps wins. That limit is 100,000 on Workers Free and 1 million on Workers Paid, or 500,000 on Paid with hybrid search.

What it costs

Cloudflare postponed AI Search billing by a month, so it now begins on 1 December 2026 instead of 1 November. Each account gets 5 million ingestion tokens, 10 GB-month of storage, 1,000 semantic queries and 1,000 full-text queries a month. Usage beyond that is billed at these rates.

UsagePrice
Base ingestionUS$0.75 per million tokens
Image processingExtra US$0.50 per million tokens
StorageUS$2.00 per GB-month
Semantic, vector and hybrid queriesUS$0.75 per 1,000 queries
Full-text queriesUS$0.10 per 1,000 queries
AI Search overage rates from 1 December 2026, from Cloudflare’s limits and pricing page.

Cloudflare says Workers AI embedding and reranking calls made by AI Search are included in that pricing. Ingestion tokens are counted on the final indexed chunks, so overlapping text between neighbouring chunks is counted each time it appears.

Neither the changelog post nor the docs give a date for the D1 data source to leave beta, and neither gives performance figures for large tables. AI Search itself became generally available on 1 October 2026.


Discover more from Sulat AI & Tech News

Subscribe to get the latest posts sent to your email.