Garp Independent AI & technology journalism
Tuesday, June 23, 2026 Sign In · Join Subscribe
Latest Google Deepmind and A24 team up on AI filmmaking research

AI news, research, models, robotics, chips, startups, and infrastructure coverage.

Updated daily

Home  /  AI News  /  Perplexity Launches ‘Search as Code’ to Enable AI Models to Write Custom Search Pipelines

AI

Perplexity Launches ‘Search as Code’ to Enable AI Models to Write Custom Search Pipelines

Perplexity Launches ‘Search as Code’ to Enable AI Models to Write Custom…

Perplexity’s new “Search as Code” architecture dumps rigid search APIs and lets AI models write their own search routines in Python. By letting the agent handle its own filtering and deduplication inside a sandbox, the system beats OpenAI and Anthropic on key benchmarks, while cutting token costs by up to 85 percent.

This loop repeats, often many times in a row. Perplexity calls this a bottleneck in a new technical report. Today’s search engines were built for humans who want a neat list of blue links, but for an AI agent trying to run hundreds of searches in a few minutes, that setup is too rigid. The agent can only tweak the search term; everything else is a black box. “Search as Code” (SaC) changes that dynamic. Instead of calling the API, the model writes a custom Python script to run the search. The script runs in a secure sandbox, pulling from Perplexity’s search backend. Basic operations like retrieving, filtering, deduplicating, and reranking are packaged as simple SDK functions. The architecture breaks down into three layers. At the top sits the model, which understands the task and decides on a search strategy. In the middle is the sandbox where the code runs. At the bottom is the “Agentic Search SDK,” which breaks Perplexity’s search engine into individual, mix-and-match functions. Standard search APIs are still there for quick questions. But for tough research, the model can go much deeper. It can fire off parallel queries, filter out the noise programmatically, and pull only relevant hits into its context window.