📊 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 announced a new approach called Search as Code (SaC), allowing AI systems to dynamically compose search pipelines in code. Early tests show significant improvements in accuracy and token efficiency, positioning SaC as a notable advancement in AI search technology.
Perplexity has unveiled a new search architecture called Search as Code (SaC) that enables AI agents to assemble custom search pipelines dynamically, moving beyond conventional fixed search endpoints. This development aims to improve accuracy and control in complex retrieval tasks, marking a significant step forward in AI search technology.
On June 1, 2026, Perplexity’s research team published a detailed explanation of SaC, proposing a shift from the traditional query-response search model to a modular, code-driven approach. SaC exposes core search functions—retrieval, filtering, ranking, and rendering—as atomic primitives within a Python SDK, allowing the AI model to generate and execute tailored code to orchestrate these components on the fly.
In their case study involving the identification of over 200 high-severity software vulnerabilities, SaC achieved 100% accuracy while reducing token usage by 85% compared to previous systems. These results suggest that SaC enables more precise and efficient retrieval, especially in multi-stage, complex tasks. The system’s architecture includes three layers: the model as the control plane, a sandbox for deterministic execution, and the primitive set for search operations.
Perplexity reports that SaC outperforms or ties with leading benchmarks in multiple tests, including DSQA, BrowseComp, WideSearch, and WANDR, often by significant margins. The approach’s core advantage is the ability to construct bespoke, multi-stage retrieval programs, rather than relying on a single, monolithic search endpoint. This flexibility is seen as a key factor in the system’s improved performance.
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

50 AI Agents Every Developer Must Build: The Complete Guide to Building Scalable, Production-Ready Autonomous Systems with LangChain, LangGraph, and Python
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.
Python SDK for search automation
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Implications of Search as Code for AI Search Efficiency
This development is significant because it suggests a new paradigm for AI search systems, emphasizing control, flexibility, and efficiency. By enabling models to generate custom retrieval pipelines, SaC could lead to more accurate, cost-effective, and scalable AI applications across various domains where complex search and reasoning are required. It also aligns with broader trends toward integrating code execution within AI workflows, potentially transforming how AI agents interact with data sources.

Protecting User Privacy in Web Search Utilization (Advances in Information Security, Privacy, and Ethics (Aispe) Book Series)
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Background on Search Architectures and Recent Advances
Traditional search systems treat search as a fixed API: a query is sent, and a static set of results is returned. This model proved sufficient in the human-era of search but falls short in AI agent contexts, where multiple, rapid retrievals are needed during complex reasoning processes. Recent research, including the 2024 ICML CodeAct paper and Anthropic’s 2025 MCP work, has argued for turning tools into executable code, improving control and reducing context overhead. Perplexity’s SaC builds on these ideas by re-architecting its search stack into composable primitives, a step that requires significant engineering effort but offers tangible performance benefits.
While the conceptual foundation is not entirely new—similar ideas have appeared in academic and industry research—Perplexity’s implementation represents a notable engineering achievement. It is the first to fully reconfigure its search stack into atomic, programmable components, enabling the model to orchestrate search processes directly in code.
“SaC enables AI models to generate and execute tailored search pipelines, offering significant improvements in accuracy and efficiency.”
— Thorsten Meyer

Custom Search – Discover more:: A Complete Guide to Google Programmable Search Engines
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Unverified Aspects and Need for Independent Validation
While early results are promising, the benchmark where SaC shows the largest gains—WANDR—is internally developed by Perplexity and has not been independently validated. Additionally, comparisons involve different models (GPT-5.5 for SaC and OpenAI, Opus 4.7 for others), which complicates direct evaluation. The broader applicability and scalability of SaC across diverse tasks remain to be tested in independent settings. The long-term benefits of this approach are still subject to further validation and real-world deployment outcomes.
Next Steps for Validation and Broader Adoption
Perplexity is expected to publish more comprehensive results, including independent benchmarks and broader testing across various models and tasks. The company may also release open-source components or APIs to allow the community to evaluate SaC’s effectiveness. Industry observers will be watching for external validation of the approach’s scalability and real-world benefits. Further research could explore integrating SaC with other AI frameworks and expanding its use cases beyond vulnerability identification.
Key Questions
How does Search as Code differ from traditional search methods?
SaC allows AI models to generate and run custom search pipelines in code, rather than relying on fixed search endpoints, enabling more flexible and precise retrieval strategies.
What are the main benefits of SaC based on Perplexity’s tests?
Early results show improved accuracy—100% in a CVE case study—and significantly reduced token usage, making retrieval more efficient and adaptable for complex tasks.
Is SaC ready for widespread deployment?
While promising, SaC’s approach is still in early stages, with validation limited to internal benchmarks. Broader testing and independent validation are needed before widespread adoption.
How does SaC relate to previous research on code-based tools for AI?
SaC builds upon academic and industry research suggesting turning tools into executable code improves control and success rates. It is a practical implementation of these ideas within a search context.
Source: ThorstenMeyerAI.com