📊 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 method called Search as Code, allowing AI systems to dynamically assemble search pipelines using code. This approach aims to improve accuracy and control in AI search tasks, with early benchmarks showing promising results. The development builds on prior ideas but re-architects search stacks for better agent performance.
Perplexity announced the release of Search as Code (SaC) on June 1, 2026, a new framework that allows AI agents to assemble custom search pipelines dynamically using code. This approach aims to address limitations in traditional search methods, especially for complex, multi-step tasks, by exposing the search stack as composable primitives that models can control directly. The development marks a significant shift in how search is integrated into AI systems, emphasizing flexibility and precision.
Perplexity’s Search as Code approach involves breaking down the search process into atomic components—retrieval, filtering, ranking, and rendering—that are accessible via a Python SDK. The AI model acts as the control plane, generating code to orchestrate these components in real-time, rather than relying on a monolithic search API. This enables models to adapt search strategies on the fly, improving control and efficiency.
In their case study, Perplexity demonstrated SaC’s effectiveness by identifying over 200 high-severity CVEs with 100% accuracy, while reducing token usage by 85%. The system used a multi-stage retrieval pipeline, combining vendor-specific templates, targeted refinements, and schema-bound verification, illustrating how models can write bespoke retrieval programs. Benchmarks across multiple datasets showed SaC outperforming existing systems, with up to 2.5× better results on WANDR and improvements on four out of five tests.
While promising, the company acknowledges that some benchmarks are proprietary, and comparisons involve different models, which introduces some uncertainty about the results’ generality. The approach is rooted in prior research, notably the CodeAct framework and recent work by Anthropic, which advocate transforming tool calls into executable code within sandboxed environments.
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 No Spill Clean and Fill Aquarium Maintenance System, Gravel Cleaner and Water Changer, 50 Foot
Will not disturb fish or decor during routine aquarium maintenance
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.

JCTLIYXG Multi Surface Pipe Profiling Tool, Pipe Cutting Template Multi Functional Shape Duplicator, Lightweight and Wear-Resistant Fiberglass Material for Tiles Floors DIY Pro Plumbing (0-6" Pipes)
Multi-Surface Shaping with Precision: Achieve accurate pipeline shaping and surface shaping at any angle. This pipe profile tool…
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Implications for AI Search and Agent Control
This development signals a potential paradigm shift in how AI systems perform search tasks, emphasizing flexibility, control, and efficiency. By enabling models to write and execute custom retrieval pipelines, SaC could significantly improve performance on complex, multi-step queries and reduce costs associated with large language models.
It also demonstrates a move toward more programmable AI systems, where control over search processes is embedded within the model’s reasoning, rather than relying solely on fixed APIs. This could influence future AI architectures, encouraging more modular and adaptable search frameworks that better serve agent-based applications in enterprise, research, and consumer domains.
However, the approach’s novelty is partly evolutionary, building on existing ideas about code-based tool integration. Its success depends on wider adoption and independent validation, especially given the proprietary benchmarks and model comparisons involved.
custom retrieval and ranking software
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Prior Work on Code-Driven Search and Agent Architectures
The concept of transforming tool calls into executable code within AI agents has been explored in recent research, notably the CodeAct paper (ICML 2024), which showed improved success rates across multiple models. Similarly, in late 2025, Anthropic published work on loading tools as sandboxed code to reduce context size and improve scalability.
Perplexity’s innovation lies in re-architecting its entire search stack into atomic primitives, enabling the model to control the search process directly, rather than relying on external APIs or monolithic endpoints. While the idea is not entirely new, their engineering effort to rebuild the search stack as a composable, code-driven system is notable.
Critics point out that some of the benchmarks used to demonstrate SaC’s effectiveness are proprietary or self-created, which warrants cautious interpretation until independent replication occurs.
“Transforming search into a programmable, code-based process could be a game-changer for AI agents, enabling unprecedented control and efficiency.”
— Thorsten Meyer, AI researcher
AI developer tools for search
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Independent Validation and Benchmark Transparency
It is not yet clear how well SaC will perform outside of Perplexity’s internal benchmarks, which include proprietary tests like WANDR. Independent replication and validation by third parties are needed to confirm the claimed performance gains. Additionally, some comparisons involve different models and configurations, complicating direct assessment of SaC’s relative advantages.
Further, the benchmarks used are either self-developed or not fully published, raising questions about their objectivity and reproducibility.
Broader Adoption and External Testing of SaC
The next steps involve wider testing by independent researchers and developers to verify SaC’s effectiveness across diverse tasks and environments. Perplexity is expected to release more detailed documentation and open some benchmarks for external evaluation. Future updates may include integrating SaC into broader AI platforms and exploring its scalability for enterprise use cases.
Monitoring how the AI community responds and whether other vendors adopt similar architectures will be key to understanding SaC’s long-term impact.
Key Questions
How does Search as Code differ from traditional search methods?
Instead of using a fixed search API, SaC exposes the search stack as composable primitives that models can control by writing code, enabling dynamic, task-specific retrieval pipelines.
What are the main benefits of SaC according to Perplexity?
SaC offers higher accuracy, reduced token costs, and greater flexibility for complex, multi-step search tasks by allowing models to orchestrate search processes directly.
Has SaC been independently tested outside of Perplexity?
No, independent validation is still pending. Most results come from Perplexity’s internal benchmarks, some of which are proprietary.
Is this approach entirely new?
The idea of turning tool calls into executable code has been explored previously, but Perplexity’s contribution is in re-architecting its entire search stack into a modular, programmable system.
What are potential challenges for adopting SaC?
Wider adoption depends on external validation, integration complexity, and whether the approach scales effectively across different tasks and models.
Source: ThorstenMeyerAI.com