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 has announced a new method called Search as Code (SaC), allowing AI systems to dynamically assemble search pipelines. This approach is a significant evolution in AI search, but its novelty and broader validation remain uncertain.

On June 1, 2026, Perplexity’s research team revealed a new approach called Search as Code (SaC), designed to fundamentally change how AI systems perform search during multi-step tasks. This development aims to address limitations in traditional search methods by allowing AI agents to assemble custom retrieval pipelines in real-time, which could significantly improve efficiency and accuracy for complex information retrieval.

The core idea behind SaC is to break away from the conventional search model—where a fixed API endpoint processes queries and returns results—and instead expose the search stack as a set of atomic primitives that can be orchestrated by the AI in code. This includes retrieval, filtering, ranking, and rendering, all accessible via a Python SDK. The AI model acts as the control plane, generating code that dynamically constructs tailored search pipelines for each task.

Perplexity demonstrated SaC’s capabilities through a case study involving the identification and characterization of over 200 high-severity CVEs. They reported that SaC achieved 100% accuracy while reducing token usage by 85%—from 288,700 tokens to 42,900 tokens—compared to traditional methods. Their benchmarks also show SaC outperforming other systems on four out of five tests, including their new WANDR benchmark, where it scored 2.5 times better than the next best system. These results suggest SaC can enable more precise and cost-effective retrieval, especially in complex, multi-step scenarios.

At a glance
reportWhen: announced June 1, 2026
The developmentPerplexity has published a detailed proposal and initial results for Search as Code, claiming improved accuracy and efficiency in AI search tasks.
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
Production AI Agents with the OpenAI Agents SDK: Sandboxing, Harnesses, and Subagents

Production AI Agents with the OpenAI Agents SDK: Sandboxing, Harnesses, and Subagents

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

Implications for AI Search and Agent Capabilities

This development indicates a potential paradigm shift in how AI systems handle complex search tasks. By enabling models to write and execute custom retrieval programs, SaC offers greater control, flexibility, and efficiency. If broadly adopted, this could enhance the performance of AI agents in applications requiring multi-step reasoning, such as cybersecurity, research, and enterprise knowledge management. However, the approach’s novelty and the robustness of initial results warrant cautious optimism, as independent validation is still pending.

Evolution of Search and Agent Architectures

The concept of turning tools into executable code for AI agents is not new. Prior work, such as the CodeAct paper (ICML 2024), demonstrated that models trained on real code outperform synthetic tool-call formats. Similarly, Anthropic’s MCP system (November 2025) showed the benefits of sandboxed code execution for high-reduction context management. Perplexity’s contribution lies in re-architecting its entire search stack into composable primitives, an engineering feat that distinguishes it from merely wrapping external APIs. This shift aligns with broader trends emphasizing code-based tool integration for scalable, multi-step reasoning.

“Perplexity’s Search as Code represents a meaningful step toward more flexible and efficient AI search pipelines, but its true impact remains to be seen through independent validation.”

— Thorsten Meyer, AI researcher

Validation and Broader Adoption Unclear

While initial results are promising, independent replication of SaC’s benchmarks—particularly the proprietary WANDR test—is pending. The comparison across models running on different architectures introduces some uncertainty about the exact performance gains. Additionally, the broader applicability of SaC outside of Perplexity’s specific use case remains to be demonstrated, and the complexity of re-architecting entire search stacks may limit immediate adoption.

Next Steps for Validation and Adoption

Further validation by independent researchers is needed to confirm SaC’s performance claims. Perplexity is likely to release more detailed benchmarks and possibly open-source components to facilitate external testing. Monitoring how the industry responds—whether through similar architectural shifts or integration into existing systems—will be critical in assessing SaC’s long-term impact on AI search and agent design.

Key Questions

What is Search as Code (SaC)?

SaC is an approach where the search process is broken into composable primitives that an AI model can assemble and execute in code, enabling more flexible and targeted retrieval pipelines.

How does SaC improve over traditional search methods?

It allows AI models to dynamically craft search pipelines tailored to each task, reducing token usage and increasing accuracy, especially in complex multi-step scenarios.

Is SaC widely available now?

Perplexity has announced SaC and demonstrated initial results, but broader adoption and independent validation are still forthcoming.

What are the limitations of SaC at this stage?

Its performance claims are based on internal benchmarks, some of which are proprietary, and the approach requires re-architecting search stacks, which may limit immediate widespread use.

How does SaC relate to previous work on code-based AI tools?

SaC builds on prior concepts like CodeAct and MCP, emphasizing turning tools into executable code for more scalable, multi-step reasoning in AI agents.

Source: ThorstenMeyerAI.com

You May Also Like

FreeBSD Ate My RAM

Users report FreeBSD consuming excessive RAM, leading to system crashes. Confirmed issue with potential fixes under investigation.

What Is a Direct Attach Copper (DAC) Cable? (2021)

A detailed overview of DAC cables: what they are, how they work, their uses, and limitations in high-speed networking as of 2021.

Trillion‑Dollar Tech Merger Faces Antitrust Showdown

The trillion-dollar tech merger faces fierce antitrust scrutiny, with regulators warning of potential market dominance—discover how this battle could change your digital world.

Trump Joins the Long List of South Park Targets

Lurking behind South Park’s sharp satire of Trump lies a provocative commentary that challenges viewers to consider the show’s lasting cultural impact.