{"id":376,"date":"2026-04-16T12:00:00","date_gmt":"2026-04-16T12:00:00","guid":{"rendered":"https:\/\/wordpress.securinsight.ca\/index.php\/2026\/04\/16\/ai-search-ai-search-instances-now-include-built-in-storage-and-namespace-workers-bindings\/"},"modified":"2026-04-16T12:00:00","modified_gmt":"2026-04-16T12:00:00","slug":"ai-search-ai-search-instances-now-include-built-in-storage-and-namespace-workers-bindings","status":"publish","type":"post","link":"https:\/\/wordpress.securinsight.ca\/index.php\/2026\/04\/16\/ai-search-ai-search-instances-now-include-built-in-storage-and-namespace-workers-bindings\/","title":{"rendered":"AI Search &#8211; AI Search instances now include built-in storage and namespace Workers Bindings"},"content":{"rendered":"<p>New <a href=\"https:\/\/developers.cloudflare.com\/ai-search\/\">AI Search<\/a> instances created after today will work differently. New instances come with built-in storage and a vector index, so you can upload a file, have it indexed immediately, and search it right away.<\/p>\n<p>Additionally new Workers Bindings are now available to use with AI Search. The new namespace binding lets you create and manage instances at runtime, and cross-instance search API lets you query across multiple instances in one call.<\/p>\n<h4>Built-in storage and vector index<\/h4>\n<p>All new instances now comes with built-in storage which allows you to upload files directly to it using the <a href=\"https:\/\/developers.cloudflare.com\/ai-search\/api\/items\/workers-binding\/\">Items API<\/a> or the dashboard. No R2 buckets to set up, no external data sources to connect first.<\/p>\n<div>\n<figure>\n<pre data-language=\"ts\"><code class=\"language-ts\"><div><div><span>const<\/span><span> <\/span><span>instance<\/span><span> <\/span><span>=<\/span><span> <\/span><span>env<\/span><span>.<\/span><span>AI_SEARCH<\/span><span>.<\/span><span>get<\/span><span>(<\/span><span>\"my-instance\"<\/span><span>)<\/span><span>;<\/span><\/div><\/div><div><div>\n<\/div><\/div><div><div><span>\/\/ upload and wait for indexing to complete<\/span><\/div><\/div><div><div><span>const<\/span><span> <\/span><span>item<\/span><span> <\/span><span>=<\/span><span> <\/span><span>await<\/span><span> <\/span><span>instance<\/span><span>.<\/span><span>items<\/span><span>.<\/span><span>uploadAndPoll<\/span><span>(<\/span><span>\"faq.md\"<\/span><span>,<\/span><span> <\/span><span>content<\/span><span>)<\/span><span>;<\/span><\/div><\/div><div><div>\n<\/div><\/div><div><div><span>\/\/ search immediately after indexing<\/span><\/div><\/div><div><div><span>const<\/span><span> <\/span><span>results<\/span><span> <\/span><span>=<\/span><span> <\/span><span>await<\/span><span> <\/span><span>instance<\/span><span>.<\/span><span>search<\/span><span>(<\/span><span>{<\/span><\/div><\/div><div><div><span><span>  <\/span><\/span><span>messages<\/span><span>:<\/span><span> [<\/span><span>{<\/span><span> role<\/span><span>:<\/span><span> <\/span><span>\"user\"<\/span><span>,<\/span><span> content<\/span><span>:<\/span><span> <\/span><span>\"onboarding guide\"<\/span><span> <\/span><span>}<\/span><span>]<\/span><span>,<\/span><\/div><\/div><div><div><span>}<\/span><span>)<\/span><span>;<\/span><\/div><\/div><\/code><\/pre>\n<div>\n<div><\/div>\n<\/div>\n<\/figure>\n<\/div>\n<h4>Namespace binding<\/h4>\n<p>The new <code>ai_search_namespaces<\/code> binding replaces the previous <code>env.AI.autorag()<\/code> API provided through the <code>AI<\/code> binding. It gives your Worker access to all instances within a <a href=\"https:\/\/developers.cloudflare.com\/ai-search\/concepts\/namespaces\/\">namespace<\/a> and lets you create, update, and delete instances at runtime without redeploying.<\/p>\n<div>\n<figure>\n<pre data-language=\"jsonc\"><code class=\"language-jsonc\"><div><div><span>\/\/ wrangler.jsonc<\/span><\/div><\/div><div><div><span>{<\/span><\/div><\/div><div><div><span>  <\/span><span>\"<\/span><span>ai_search_namespaces<\/span><span>\"<\/span><span>:<\/span><span> <\/span><span>[<\/span><\/div><\/div><div><div><span>    <\/span><span>{<\/span><\/div><\/div><div><div><span>      <\/span><span>\"<\/span><span>binding<\/span><span>\"<\/span><span>:<\/span><span> <\/span><span>\"AI_SEARCH\"<\/span><span>,<\/span><\/div><\/div><div><div><span>      <\/span><span>\"<\/span><span>namespace<\/span><span>\"<\/span><span>:<\/span><span> <\/span><span>\"default\"<\/span><span>,<\/span><\/div><\/div><div><div><span>    <\/span><span>},<\/span><\/div><\/div><div><div><span>  <\/span><span>],<\/span><\/div><\/div><div><div><span>}<\/span><\/div><\/div><\/code><\/pre>\n<div>\n<div><\/div>\n<\/div>\n<\/figure>\n<\/div>\n<div>\n<figure>\n<pre data-language=\"ts\"><code class=\"language-ts\"><div><div><span>\/\/ create an instance at runtime<\/span><\/div><\/div><div><div><span>const<\/span><span> <\/span><span>instance<\/span><span> <\/span><span>=<\/span><span> <\/span><span>await<\/span><span> <\/span><span>env<\/span><span>.<\/span><span>AI_SEARCH<\/span><span>.<\/span><span>create<\/span><span>(<\/span><span>{<\/span><\/div><\/div><div><div><span><span>  <\/span><\/span><span>id<\/span><span>:<\/span><span> <\/span><span>\"my-instance\"<\/span><span>,<\/span><\/div><\/div><div><div><span>}<\/span><span>)<\/span><span>;<\/span><\/div><\/div><\/code><\/pre>\n<div>\n<div><\/div>\n<\/div>\n<\/figure>\n<\/div>\n<p>For migration details, refer to <a href=\"https:\/\/developers.cloudflare.com\/ai-search\/api\/migration\/workers-binding\/\">Workers binding migration<\/a>. For more on namespaces, refer to <a href=\"https:\/\/developers.cloudflare.com\/ai-search\/concepts\/namespaces\/\">Namespaces<\/a>.<\/p>\n<h4>Cross-instance search<\/h4>\n<p>Within the new AI Search binding, you now have access to a Search and Chat API on the namespace level. Pass an array of instance IDs and get one ranked list of results back.<\/p>\n<div>\n<figure>\n<pre data-language=\"ts\"><code class=\"language-ts\"><div><div><span>const<\/span><span> <\/span><span>results<\/span><span> <\/span><span>=<\/span><span> <\/span><span>await<\/span><span> <\/span><span>env<\/span><span>.<\/span><span>AI_SEARCH<\/span><span>.<\/span><span>search<\/span><span>(<\/span><span>{<\/span><\/div><\/div><div><div><span><span>  <\/span><\/span><span>messages<\/span><span>:<\/span><span> [<\/span><span>{<\/span><span> role<\/span><span>:<\/span><span> <\/span><span>\"user\"<\/span><span>,<\/span><span> content<\/span><span>:<\/span><span> <\/span><span>\"What is Cloudflare?\"<\/span><span> <\/span><span>}<\/span><span>]<\/span><span>,<\/span><\/div><\/div><div><div><span><span>  <\/span><\/span><span>ai_search_options<\/span><span>:<\/span><span> <\/span><span>{<\/span><\/div><\/div><div><div><span><span>    <\/span><\/span><span>instance_ids<\/span><span>:<\/span><span> [<\/span><span>\"product-docs\"<\/span><span>,<\/span><span> <\/span><span>\"customer-abc123\"<\/span><span>]<\/span><span>,<\/span><\/div><\/div><div><div><span>  <\/span><span>},<\/span><\/div><\/div><div><div><span>}<\/span><span>)<\/span><span>;<\/span><\/div><\/div><\/code><\/pre>\n<div>\n<div><\/div>\n<\/div>\n<\/figure>\n<\/div>\n<p>Refer to <a href=\"https:\/\/developers.cloudflare.com\/ai-search\/api\/search\/workers-binding\/#namespace-level\">Namespace-level search<\/a> for details.<\/p>","protected":false},"excerpt":{"rendered":"<p>New AI Search instances created after today will work differently. New instances come with built-in storage and a vector index, so you can upload a file, have it indexed immediately, and search it right away. Additionally new Workers Bindings are now available to use with AI Search. The new namespace binding lets you create and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-376","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/comments?post=376"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/376\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/media?parent=376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/categories?post=376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/tags?post=376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}