Cloudflare AI Search Bundles Full RAG Pipeline in One CLI Command
In this article
Cloudflare has launched AI Search, a managed retrieval service that collapses an entire search pipeline — crawling, parsing, embedding, vector storage, and ranking — into a single orchestrated layer running on top of existing Cloudflare primitives. For developers building agentic systems, standing up a searchable index over custom enterprise data no longer requires stitching together discrete infrastructure components. As agent control layer design becomes increasingly consequential for production systems, a platform-native retrieval service that handles the retrieval half of RAG without bespoke glue code represents a meaningful reduction in integration surface area.
Pipeline Consolidation and Underlying Primitives
Cloudflare's existing platform already supplied the component parts: Workers AI for model inference, AI Gateway for request management, Vectorize as the vector database, R2 for object storage, and Browser Rendering for headless page capture. AI Search wraps these into a unified abstraction rather than introducing a separate infrastructure stack. Cloudflare's stated goal is to give agents their own dedicated search engine capable of finding data to improve answers for both autonomous agents and human users.
End-to-end provisioning is exposed as a single wrangler CLI command. A concrete example from Cloudflare's documentation creates an index over the Cloudflare community forum:
npx wrangler ai-search create cloudflare-community \
--namespace dev-stack \
--source https://community.cloudflare.com \
--type web-crawler \
--parse-type discover
That invocation triggers crawling, ingestion, embedding generation, and retrieval index construction. The --parse-type discover flag enables AI Search to automatically enumerate pages on a target domain without a published sitemap — removing a prerequisite that previously blocked indexing of many internal or legacy web properties.
API Surface and Agent Integration
AI Search exposes two integration paths. The Cloudflare-recommended path routes queries through a Worker, allowing developers to apply authentication, rate limiting, and context injection before hitting the retrieval layer. The second path exposes public /search and /mcp endpoints requiring no authentication or deployment step — appropriate for shared tooling or rapid prototyping, with the expected access-control tradeoffs of any unauthenticated endpoint.
The MCP endpoint is the more architecturally significant for agentic use cases, since it allows an AI agent to call into the retrieval service using the Model Context Protocol without a bespoke integration layer. A single query can span multiple indexed instances simultaneously, so an agent can search across Cloudflare's API documentation, developer docs, and community forums as a unified corpus rather than issuing separate retrieval calls to each source. Cloudflare has already indexed several of its own and third-party services into AI Search, including Astro, Vite, Hono, and Replicate, demonstrating multi-source federation in production. For teams using the open-source CMS EmDash, a dedicated plugin provides direct integration without any Worker code.
Pricing Structure and Availability
Cloudflare has structured AI Search pricing around the computational weight of individual pipeline stages rather than a flat per-query fee, with direct implications for cost modeling at scale.
| Pipeline Stage | Billing Model | Condition |
|---|---|---|
| Embedding generation | Free | Default models or select Workers AI catalog models |
| Re-ranking | Free | Default models or select Workers AI catalog models |
| Answer generation | Billed by model usage | All configurations |
| Query rewriting | Billed by model usage | All configurations |
| Full service (beta period) | Free | Until general availability |
Making embedding and re-ranking free for default-model configurations eliminates two of the most common variable costs in retrieval pipelines, concentrating billing on the generative stages that consume the most compute. This mirrors a broader pattern where pipeline architecture choices rather than raw model capability drive real cost and quality outcomes in production AI systems. Pricing takes effect at general availability; the service is entirely free during the current beta.
Broader Signal
Bundling retrieval infrastructure as a first-class platform service — rather than leaving developers to assemble Workers AI, Vectorize, and R2 independently — reflects increasing pressure to make agentic data retrieval patterns accessible without deep infrastructure expertise. The unauthenticated public endpoints and single-command provisioning deliberately lower the floor for agent-accessible search, which accelerates adoption but requires teams to think carefully about what data they expose through those public surfaces. If the federated multi-corpus query capability matures as described, the architectural center of gravity for enterprise RAG could shift from developer-assembled pipelines toward managed platform services that abstract the retrieval layer entirely.