📊 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 developed a new approach called Search as Code, allowing AI models to dynamically build search pipelines. While promising, some claims are based on proprietary benchmarks, and the idea itself isn’t entirely new.

Perplexity has introduced a new approach called Search as Code (SaC) that enables AI models to construct custom retrieval pipelines dynamically, marking a significant shift from traditional search methods. This development aims to improve accuracy and control in AI-driven search tasks, especially for complex multi-step operations.

On June 1, 2026, Perplexity’s research team published a detailed explanation of Search as Code, a method that exposes the underlying components of the search process—retrieval, ranking, filtering, and assembly—as composable primitives within a Python SDK. This allows AI models to generate and execute code that customizes search pipelines in real time, rather than relying on fixed endpoints or monolithic APIs.

The company demonstrated SaC’s effectiveness through a case study involving the identification and characterization of over 200 high-severity CVEs. Results showed 100% accuracy and an 85% reduction in token usage compared to traditional methods. Perplexity claims that SaC outperforms existing systems on several benchmark tests, including WANDR, where it achieved a 2.5× improvement over competitors.

While the approach is technically innovative—restructuring the search stack into atomic, programmable parts—some experts note that the core concept is not entirely new. Similar ideas about turning tools into executable code for better control and efficiency have been explored in prior research and industry projects, such as the CodeAct framework and recent work by Anthropic.

At a glance
reportWhen: announced June 1, 2026
The developmentPerplexity announced on June 1, 2026, that it has implemented Search as Code, transforming how AI systems perform search tasks with improved accuracy and efficiency.
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 search pipeline development 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

Python SDK for search customization

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Implications for AI Search and Agent Capabilities

This development could significantly enhance the ability of AI agents to perform complex, multi-step tasks that require precise control over search and retrieval processes. By enabling models to assemble tailored pipelines, SaC offers the potential for higher accuracy, better resource efficiency, and more adaptable search strategies. However, the claims are partly based on proprietary benchmarks and comparisons that have not yet been independently verified, so the broader industry impact remains to be seen.

Amazon

search as code software

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search Strategies in AI Agents

The idea of turning search tools into programmable APIs has been around for several years, with notable frameworks like CodeAct and recent publications from Anthropic advocating similar approaches. Perplexity’s innovation lies in re-architecting its own search stack into atomic primitives, allowing dynamic pipeline construction directly within its platform. Prior efforts have demonstrated that integrating code execution into search workflows can improve success rates and efficiency, but widespread adoption is still emerging.

The broader trend reflects a shift from static, monolithic search endpoints toward more flexible, programmable systems that give models greater control. This aligns with recent industry moves toward making AI systems more autonomous and adaptable in complex tasks requiring multiple retrieval steps.

“Perplexity’s approach of exposing search components as primitives is a meaningful engineering advance, but the core idea of turning tools into code APIs is not entirely new.”

— Thorsten Meyer, AI researcher

Amazon

AI retrieval and ranking tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Verification and Industry Adoption of Search as Code

Many of the benchmark results, especially the WANDR test where SaC shows the largest gains, are based on proprietary datasets and internal benchmarks that have not been independently verified. The comparison involves different models and configurations, which complicates direct assessment of SaC’s true advantages. Additionally, the broader industry has yet to adopt or validate similar approaches at scale, so the generalizability remains uncertain.

Independent Validation and Broader Industry Adoption

Further independent testing and replication of Perplexity’s benchmarks are needed to confirm SaC’s advantages. Industry observers will watch for broader adoption of programmable search pipelines in other platforms and for new research validating or challenging these claims. Perplexity may also release more details about its benchmarks and methodologies to facilitate external validation.

Key Questions

How does Search as Code differ from traditional search methods?

Search as Code enables AI models to build and run custom search pipelines dynamically, rather than relying on fixed endpoints. This allows for more precise control, multi-step processing, and potentially higher accuracy in complex tasks.

Are Perplexity’s claims about performance independently verified?

No, the results are based on proprietary benchmarks and internal tests. Independent verification is still pending.

Is this approach completely new?

The concept of turning search tools into programmable APIs has been explored before, but Perplexity’s engineering of its own search stack into atomic primitives is a novel implementation.

What are the limitations of Search as Code?

Current limitations include reliance on proprietary benchmarks, lack of independent validation, and the need for broader industry adoption to assess real-world effectiveness.

Source: ThorstenMeyerAI.com

You May Also Like

Subwoofer Size vs Room Size: Bigger Is Not Always Better

Understand why choosing the right subwoofer size for your room is crucial for balanced sound and how to optimize your setup effectively.

Smart Lock Battery Life Depends on More Than Brand

Your smart lock’s battery life isn’t just about the brand; it’s mainly…

Foldable Phones: Novelty or New Normal?

A groundbreaking shift in mobile tech is underway with foldable phones, but are they truly the future or just a passing trend?

Differential Privacy: How It Protects Data

Being a key privacy technique, differential privacy secretly adds noise to protect individual data while still enabling useful insights—discover how it works.