November 12, 2026 · Cloudflare
D1 - AI Search supports D1 databases as a data source (beta)
AI Search can now use a D1 database as a data source. AI Search runs a read-only query that you provide and indexes each returned row as a separate document. Scheduled syncs keep the index current as rows are added, changed, or removed.
Create D1-backed instances from the dashboard, the REST API, or the Workers binding.
curl -X POST "https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/ai-search/namespaces/default/instances" \
-H "Authorization: Bearer <API_TOKEN>" \
-H "Content-Type: application/json" \
--data '{
"id": "help-center",
"type": "d1",
"source": "<D1_DATABASE_ID>",
"token_id": "<SERVICE_TOKEN_ID>",
"source_params": {
"d1": {
"query": "SELECT article_id AS id, title, content, category AS meta_category\nFROM articles\nWHERE published = 1"
}
}
}'
Learn more in D1 data source.