📊 Full opportunity report: Search as Code: Perplexity Is Right About the Future — Just Not First to It on ThorstenMeyerAI.com — validation score, market gap, and execution plan.
TL;DR
Perplexity has announced a new approach called Search as Code, allowing AI systems to dynamically assemble retrieval pipelines. This innovation aims to improve performance in complex, multi-step tasks, though it builds on existing ideas and faces some validation challenges.
Perplexity has unveiled a new approach called Search as Code (SaC) that enables AI systems to construct custom retrieval pipelines dynamically, marking a shift from traditional search methods. This development is significant because it addresses the limitations of fixed search pipelines in multi-step, agent-driven tasks, potentially boosting accuracy and efficiency in complex AI operations.
On June 1, 2026, Perplexity’s research team published a detailed proposal for Search as Code, arguing that conventional search systems are inadequate for the demands of AI agents executing multi-hour, multi-step tasks. Instead of treating search as a static endpoint, SaC exposes the internal components—retrieval, ranking, filtering, and rendering—as atomic primitives accessible via a Python SDK. This allows AI models to generate and execute code that orchestrates these components tailored to each specific task.
The system relies on a three-layer architecture: the model as the control plane, a sandbox environment for deterministic execution, and the primitive set within the SDK. This design enables the model to write bespoke retrieval programs, improving control and flexibility. A case study involving the identification of over 200 high-severity vulnerabilities showed SaC achieving 100% accuracy while reducing token usage by 85%, outperforming traditional systems that scored below 25%. Benchmark tests across multiple datasets also favored SaC, with leading performance on four of five tests and a 2.5× advantage on the WANDR benchmark.
While the approach is presented as innovative, critics note that the core idea of turning tools into executable code for better control has been explored previously, notably in recent research such as the CodeAct paper (ICML 2024) and Anthropic’s MCP framework. The key novelty claimed by Perplexity is the re-architecture of its search stack into atomic primitives, a complex engineering effort not easily replicable by external API wrappers. The company emphasizes this engineering achievement as its main contribution.
Search as Code
Perplexity says agents shouldn’t call a search engine — they should program one, composing atomic primitives into a bespoke pipeline in a sandbox. The thesis is right. It’s also the search-shaped version of an idea the field has been converging on since 2024.
Monolithic search
![Claude AI for Beginners Bible: [5 in 1] The Ultimate Guide to Automate Your Work, Save Hours Every Week, and Use AI for Real-World Results](https://m.media-amazon.com/images/I/415+fSJacsL._SL500_.jpg)
Claude AI for Beginners Bible: [5 in 1] The Ultimate Guide to Automate Your Work, Save Hours Every Week, and Use AI for Real-World Results
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Programmable primitives
Directionally right, genuinely engineered — the rebuilt-from-atoms search stack is the part rivals can’t cheaply copy. But it’s a strong execution of an industry-wide idea, validated mostly on benchmarks Perplexity ran itself. The moat is the infrastructure and the tuning loops, not the architecture.

Agentic AI Builder Blueprint 2026: Build Practical AI Agents, RAG Apps, MCP Workflows, Automation Systems, Evaluation Pipelines, and Production-Ready LLM Tools Step by Step
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Implications for AI Search and Retrieval
This development signals a potential paradigm shift in how AI systems perform search and retrieval, especially in complex, multi-step tasks requiring precise control over data fetching and filtering. By enabling models to generate custom retrieval pipelines, SaC could lead to more accurate, efficient, and adaptable AI agents, impacting sectors from cybersecurity to enterprise data management. However, the approach’s reliance on proprietary engineering and its current validation status mean its long-term effectiveness remains to be seen, and independent replication is needed to confirm its advantages.
Python SDK for search customization
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Evolution of Search and AI Agent Capabilities
Traditional search systems, designed for human users, rely on fixed pipelines that return a set of results based on a query. AI-optimized search, such as that pioneered by Perplexity in 2022, improved relevance but still treated search as a monolithic endpoint. The rise of autonomous AI agents executing complex tasks revealed the limitations of these static pipelines, prompting research into more flexible, code-driven approaches. Recent work by researchers like Wang et al. (ICML 2024) and companies like Cloudflare and Anthropic has demonstrated that turning tools into executable code within a sandbox improves success rates and reduces context overhead. Perplexity’s SaC builds on these ideas, re-architecting its search stack into composable primitives to enable dynamic, code-based retrieval pipelines.
“Perplexity’s Search as Code represents a significant engineering achievement, re-architecting the search stack into atomic primitives for flexible, model-generated retrieval pipelines.”
— Thorsten Meyer, AI researcher
AI retrieval pipeline components
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Validation and Independent Replication Challenges
Several aspects of SaC remain unconfirmed or uncertain. The most significant is the lack of independent replication of the reported performance gains, especially the WANDR benchmark result, which was internally developed by Perplexity. Critics note that the benchmarks used are either proprietary or not yet publicly available for external testing. Additionally, comparisons across different models and hardware configurations are not fully controlled, raising questions about the robustness of the claimed improvements. The long-term scalability and generalizability of SaC are also still unproven, and the approach’s reliance on proprietary engineering may limit widespread adoption.
Independent Testing and Broader Adoption Prospects
Next steps include independent researchers attempting to replicate Perplexity’s results using publicly available benchmarks and codebases. Peer review and external validation will be critical to establish SaC’s actual benefits. Meanwhile, other AI developers may explore similar architectures, and industry adoption could accelerate if the approach proves robust. Perplexity is expected to continue refining its system and publish more detailed results, including open benchmarks, in the coming months. The broader AI community will watch closely to see if this approach becomes a new standard for search in agent-driven AI systems.
Key Questions
What is Search as Code?
Search as Code (SaC) is an approach that allows AI systems to generate and execute custom retrieval pipelines by assembling atomic search primitives into code, enabling more flexible and precise data retrieval for complex tasks.
How does SaC improve over traditional search?
SaC offers greater control and adaptability by letting models write tailored retrieval programs, reducing token costs, and increasing accuracy in multi-step, agent-driven tasks compared to fixed, monolithic search endpoints.
Are Perplexity’s performance claims verified?
Most of Perplexity’s claims are based on internal benchmarks and proprietary data. Independent verification is pending, and skepticism remains until external tests confirm the results.
Is this approach widely applicable?
While promising, the approach’s reliance on engineering and proprietary components means broader adoption depends on validation, scalability, and ease of integration into existing systems.
What does this mean for the future of AI search?
If validated, SaC could revolutionize how AI systems perform retrieval, enabling more autonomous, efficient, and accurate agents capable of handling complex, multi-step tasks across industries.
Source: ThorstenMeyerAI.com