AI news story

Perplexity's "Search as Code" lets AI models write their own search pipelines instead of calling fixed APIs

Perplexity's new "Search as Code" architecture dumps rigid search APIs and lets AI models write their own search routines in…

  • LLMs
  • Source: The Decoder
  • Published: 2026-06-07

Editor's take

Perplexity has introduced a novel approach to AI-powered information retrieval, enabling its models to dynamically generate Python code for custom search operations rather than relying on pre-defined API calls. This departure from fixed interfaces allows the AI agent to intelligently construct its own filtering, deduplication, and data synthesis logic within a secure sandbox environment, reportedly surpassing the performance of established players like OpenAI and Anthropic in certain benchmarks.

This development is significant because it represents a move towards more flexible and autonomous AI agents that can adapt their information-gathering strategies on the fly. By granting models the ability to "code" their search, Perplexity is pushing the boundaries of how LLMs interact with external data, potentially leading to more nuanced and efficient answer generation. The impact is felt by users seeking higher quality, more contextually relevant search results, and by developers building AI systems that require sophisticated data processing.

Future developments to monitor include the scalability of this "Search as Code" paradigm across diverse and complex information landscapes, and the security implications of granting AI models the ability to write and execute code. It will also be crucial to observe whether competitors adopt similar dynamic search generation techniques, and how this impacts the overall development of AI-powered search and knowledge discovery platforms.