📊 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’s research team announced a new method called Search as Code, allowing AI systems to build custom search pipelines dynamically. This approach aims to improve multi-step retrieval tasks, marking a significant development in AI search technology.
Perplexity’s research team has introduced ‘Search as Code’ (SaC), a new approach that allows AI systems to assemble custom search pipelines dynamically in code. This development aims to address limitations in traditional search methods, particularly for AI agents performing complex, multi-step tasks, and signals a significant shift in how search functions within AI systems.
Published on June 1, 2026, the Perplexity research paper argues that conventional search systems treat queries as fixed inputs, which is insufficient for AI agents executing complex workflows. Instead, SaC exposes the search stack—retrieval, filtering, ranking, and rendering—as atomic, composable primitives accessible via a Python SDK. The AI model acts as the control plane, generating code to orchestrate these primitives in real time, enabling tailored retrieval strategies.
The approach is demonstrated through a case study involving the identification and characterization of over 200 high-severity vulnerabilities (CVEs). The SaC system achieved 100% accuracy and reduced token usage by 85%, outperforming traditional systems that scored under 25%. These results suggest that writing bespoke, multi-stage retrieval programs can significantly improve accuracy and efficiency in complex search tasks.
Perplexity emphasizes this is not just a new API but a re-architecture of the search stack, allowing models to reach into and control the search process directly, rather than passively consuming results. The system relies on three layers: the model as the control plane, a sandbox for deterministic execution, and the primitive set for search operations.
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
Python SDK for search pipelines
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.
AI search pipeline development tools
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Implications of Dynamic, Code-Driven Search for AI Development
This development matters because it addresses a core bottleneck in AI search and retrieval: control and flexibility. By enabling models to generate and execute custom search pipelines, SaC could improve the accuracy and efficiency of AI systems handling complex, multi-step tasks. This approach aligns with broader trends toward more autonomous, adaptable AI agents capable of managing their own search strategies, potentially transforming applications in cybersecurity, research, and enterprise data management.
However, the approach also raises questions about reproducibility and independence, as some benchmark results were generated by Perplexity’s own tools, and comparisons across different models are not fully controlled. Still, the engineering effort to re-architect the search stack into composable primitives represents a significant technical advance, with potential long-term impacts on AI system design.
search primitives API for AI
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Historical and Technical Background of Search as Code
The concept of using code to orchestrate AI tool use is not new. The idea of turning tools into executable APIs was formalized in the ICML 2024 paper ‘CodeAct,’ which showed higher success rates using code-based tool integration. Similarly, in November 2025, Anthropic published research on ‘code execution with MCP,’ emphasizing the efficiency of turning tools into sandboxed code APIs to reduce context size and improve performance.
Perplexity’s innovation lies in its practical engineering: re-architecting the search stack into atomic primitives that the model can control directly. While the underlying idea is convergent with prior work, their implementation of a fully re-architected, composable search system is a notable engineering achievement that sets their approach apart.
Critics note that the core idea—using code to orchestrate tools—has been explored before, but Perplexity’s contribution is in demonstrating how to build a flexible, integrated search stack that can be controlled dynamically by the model in real time. This approach could influence future AI search architectures, especially for complex, multi-step tasks requiring precise control over retrieval strategies.
“Re-architecting the search stack into composable primitives is a significant engineering step that could redefine how AI systems handle complex retrieval tasks.”
— Thorsten Meyer, AI researcher
custom search engine development kit
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Results and Claims Require Independent Verification
Many of the benchmark results, including the prominent CVE case study, were produced internally by Perplexity and have not yet been independently validated. The WANDR benchmark, where SaC showed the largest gains, was designed by Perplexity itself, raising questions about potential bias or overfitting. Additionally, comparisons across different models (GPT-5.5, Opus 4.7) are not perfectly controlled, making the claims suggestive rather than definitive. The broader community awaits independent replication and validation of these results before fully endorsing SaC’s purported advantages.
Next Steps: Independent Testing and Broader Adoption
Going forward, the key developments will involve independent researchers attempting to replicate Perplexity’s benchmark results, particularly on the CVE and WANDR datasets. Perplexity is expected to release more technical details and possibly open-source components of their search stack, enabling broader testing and validation. The company may also explore integrating SaC into commercial products or open standards, potentially influencing future AI search architectures. Meanwhile, the AI community will scrutinize the approach’s scalability, robustness, and applicability across diverse domains.
Key Questions
What exactly is Search as Code?
Search as Code is a method where AI systems generate and execute custom search pipelines in code, allowing dynamic control over retrieval, filtering, and ranking processes rather than relying on fixed search endpoints.
How does SaC improve over traditional search methods?
SaC enables models to tailor search strategies on the fly, potentially increasing accuracy and efficiency in complex, multi-step tasks by building bespoke retrieval programs instead of using static search APIs.
Has SaC been independently validated?
No, most of the results are from Perplexity’s internal tests and benchmarks. Independent validation is still pending, and community efforts are needed to verify the claims.
Is this approach applicable to all AI systems?
While promising, the approach requires re-architecting the search stack into primitives and may not be immediately applicable everywhere. Its scalability and generalizability are still under evaluation.
What are the potential risks or downsides?
Potential risks include overfitting to specific benchmarks, increased system complexity, and challenges in ensuring reproducibility and transparency across implementations.
Source: ThorstenMeyerAI.com