Search as Code: Perplexity Is Right About the Future — Just Not First to It

📊 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 assemble retrieval pipelines dynamically. Early results show promise, but some benchmarks and comparisons need independent validation.

Perplexity has unveiled a new approach called Search as Code (SaC), which allows AI models to dynamically assemble retrieval pipelines using modular primitives. The company claims this method significantly improves search accuracy and reduces token usage, marking a potential shift in how AI agents interact with search systems. This development matters because it could enable more efficient, adaptable, and precise AI-driven information retrieval, especially for complex multi-step tasks.

Perplexity’s SaC approach reimagines search as a set of composable primitives—retrieval, filtering, ranking, and rendering—that the AI model can control by generating and executing code within a sandbox environment. This contrasts with traditional search systems, which treat search as a fixed pipeline returning static results based on a query. The company demonstrated its method on a vulnerability identification task, achieving 100% accuracy while reducing token consumption by 85%, outperforming other systems that scored below 25%. The core idea is that models can craft bespoke retrieval programs, enabling more nuanced and task-specific search strategies.

Perplexity reports that SaC outperforms existing benchmarks on four of five tests, leading in accuracy and cost-efficiency. The approach involves a three-stage process: broad fan-out over vendor advisories, refinement via a language model, and verification through schema-bound filtering. The company emphasizes that SaC is not merely wrapping an API but re-architecting the search stack into atomic, programmable components, allowing the model to reach into the search process directly.

At a glance
reportWhen: announced June 1, 2026
The developmentOn June 1, 2026, Perplexity revealed its Search as Code approach, claiming significant improvements in search accuracy and efficiency for AI agents.
Search as Code — Perplexity SaC, in context
AI Dispatch · Infrastructure

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.

■ The old contract
One fixed pipeline. The model tweaks query params and consumes whatever comes back — through the context window, every time.
model → query(params)
engine → fixed pipeline
return → full result set
repeat ×N serial round-trips
⚠ every intermediate result routed through model context
▲ Search as Code
Amazon

AI retrieval pipeline tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Programmable primitives

The model writes code that orchestrates atomic search ops — fan-out, dedupe, verify — keeping bulk data out of the token stream.
sdk.search.web_many(queries)
filter()
dedupe()
sdk.llm.extract_many(schema)
verified records
✓ only the useful tokens reach the model
100%
CVE case-study accuracy (SaC run)
−85%
Token use vs baseline 288.7K → 42.9K
<25%
Score for the rival systems tested
2.5×
SaC lead on Perplexity’s own WANDR bench
A convergent idea, not a cold start
“Let the model write code instead of emitting tool calls” has been building for two years. SaC is the search-specific instantiation.
2024
CodeAct
Wang et al. · ICML
2024–25
smolagents
Hugging Face
2025
Code Mode
Cloudflare
Nov 2025
Code exec + MCP
Anthropic
Jun 2026
Search as Code
Perplexity
The take

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.

Sources: Perplexity Research, “Rethinking Search as Code Generation” (Jun 1 2026); CodeAct (Wang et al., ICML 2024); HF smolagents; Cloudflare Code Mode; Anthropic “Code execution with MCP” (Nov 2025). Figures as reported by Perplexity.
thorstenmeyerai.com
Amazon

search as code development kit

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Implications of Search as Code for AI-driven Search

This development could significantly impact how AI systems perform complex search tasks, especially in environments requiring multi-step retrieval and filtering. By enabling models to build and control their own retrieval pipelines, SaC offers the potential for more precise, efficient, and adaptable search processes. This could improve AI performance in cybersecurity, research, and enterprise applications, where tailored search strategies are critical. However, the approach’s reliance on re-architected search stacks and the early nature of some benchmark results mean broader validation is needed before widespread adoption.

Amazon

modular search engine components

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search Strategies in AI Agents

Traditional search systems, inherited from human-centric paradigms, process queries through fixed pipelines that return static result sets. Recent research has explored turning search into a programmable API, with approaches like CodeAct (ICML 2024) and Cloudflare’s Code Mode, emphasizing code execution and modular tool use. Anthropic’s MCP also proposed turning tools into sandboxed code APIs to reduce context load and improve scalability. Perplexity’s SaC builds on this conceptual foundation but distinguishes itself by re-architecting its entire search stack into composable primitives, aiming for greater control and efficiency. These developments reflect a broader trend toward making AI systems more autonomous and adaptable in their search behaviors.

“Perplexity’s Search as Code approach redefines the search process, enabling models to craft bespoke retrieval pipelines that could revolutionize AI-driven search tasks.”

— Thorsten Meyer, AI researcher

Amazon

AI programming sandbox environment

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Validation and Benchmarking Challenges for SaC Claims

While Perplexity reports impressive performance improvements, some benchmarks are proprietary or self-created, raising questions about independent validation. The most significant benchmark, WANDR, is not publicly available for replication, and comparisons involve models running on different architectures, complicating direct evaluation. Additionally, the approach’s novelty is partly conceptual; similar ideas have been explored in recent research, such as CodeAct and MCP, with comparable results. It remains unclear whether SaC’s claimed advantages will hold up under broader testing and real-world deployment.

Next Steps for Validation and Adoption of SaC

Further independent testing and replication of Perplexity’s benchmarks are needed to confirm SaC’s advantages. The company is likely to release more detailed technical documentation and possibly open-source components to facilitate external validation. Industry observers will watch for real-world applications and integration into existing AI systems. As the approach matures, broader adoption will depend on demonstrating scalability, robustness, and clear benefits over traditional search methods in diverse environments.

Key Questions

How does Search as Code differ from traditional search methods?

SaC allows AI models to generate and execute custom retrieval pipelines composed of modular primitives, rather than relying on fixed search endpoints. This enables more flexible, task-specific search strategies.

What are the main benefits claimed by Perplexity for SaC?

Perplexity claims SaC achieves higher accuracy, significantly reduces token usage, and provides greater control over search processes, especially for complex, multi-step tasks.

Are the benchmarks used to evaluate SaC publicly available?

No, some benchmarks like WANDR are proprietary and not publicly accessible, raising questions about independent validation of the results.

Is this approach entirely new?

The idea of turning search into code is not new; similar concepts have been explored in recent research and products. SaC’s innovation is in its re-architected, primitive-based implementation.

What are the potential risks or limitations of SaC?

Risks include reliance on proprietary benchmarks, the need for robust sandboxing to prevent errors, and the challenge of integrating this approach into existing systems at scale.

Source: ThorstenMeyerAI.com

This content is for general information only and is not financial, tax or legal advice. Consult a qualified professional for decisions about your money.
You May Also Like

The bridge. Why the AI buildout runs on a nuclear story and a gas reality.

Analysis of the conflicting energy narratives behind AI infrastructure: long-term nuclear deals versus immediate gas generation.

Fable and Mythos: How Anthropic Shipped Its Most Powerful Model to Everyone

Anthropic launches Fable 5, the first Mythos-class AI model available to the public, with safety measures that route risky queries to a weaker model, balancing power and safety.

Build vs Buy a Prebuilt AI Workstation

Exploring the tradeoffs between building and buying AI workstations in 2026, including costs, deployment speed, and customization options.

The Compute Concentration Audit: When Sovereign Wealth Funds Notice Three Companies Own the Frontier

Global regulators are conducting a structural audit of the cloud infrastructure market, focusing on the dominance of AWS, Microsoft Azure, and Google Cloud, affecting AI development.