📊 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 approach called Search as Code (SaC), allowing AI systems to build custom search pipelines dynamically. Early case studies show promising accuracy and cost savings, but independent validation and broader benchmarks are still pending.

On June 1, 2026, Perplexity’s research team unveiled a new approach called Search as Code (SaC), claiming it significantly improves AI search performance for complex, multi-step tasks. This development is notable because it addresses fundamental limitations in traditional search methods used by AI agents, potentially transforming how retrieval systems are integrated into AI workflows.

Perplexity’s SaC framework reimagines search as a set of composable primitives—retrieval, filtering, ranking, and rendering—exposed via a Python SDK. Instead of a monolithic search endpoint, the model writes and executes code to assemble custom pipelines tailored to each task, enabling more control and flexibility. This approach is driven by the insight that models are already proficient at reasoning over context but lack the ability to dynamically steer how data is retrieved and processed.

Early results from a case study involving the identification of over 200 high-severity CVEs show 100% accuracy while reducing token usage by 85%, compared to less efficient systems. Perplexity reports that SaC outperforms existing benchmarks, leading on four out of five tests, and matching the best on a fifth. These tests include proprietary benchmarks like WANDR, which shows a 2.5× performance boost over competitors, indicating strong potential for SaC’s effectiveness in practical scenarios.

However, the approach is not without caveats. The benchmark where SaC shows the largest margin is internally developed by Perplexity and has not yet been independently validated. Additionally, the comparison involves different models—GPT-5.5 for SaC and OpenAI, and Opus 4.7 for Anthropic—making it difficult to isolate the architecture’s impact entirely. The idea of using code to orchestrate search is not entirely new; similar concepts have been explored in recent research and industry projects over the past two years, including work by ICML and Anthropic.

At a glance
reportWhen: announced June 1, 2026
The developmentPerplexity’s research team published a new framework on June 1, 2026, proposing Search as Code as a solution to improve AI search capabilities for agent-level 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
50 AI Agents Every Developer Must Build: The Complete Guide to Building Scalable, Production-Ready Autonomous Systems with LangChain, LangGraph, and Python

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

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
Introdução à Programação com Python

Introdução à Programação com Python

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 suggests a shift toward more flexible, controllable search systems that can be tailored dynamically by AI models, potentially enabling more sophisticated and efficient agent behavior. If validated at scale, SaC could reduce costs, improve accuracy, and expand the range of tasks AI agents can perform autonomously. However, the reliance on proprietary benchmarks and the novelty of the architecture mean broader adoption and validation are still needed to confirm its long-term impact.

Protecting User Privacy in Web Search Utilization (Advances in Information Security, Privacy, and Ethics (Aispe) Book Series)

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.

Evolution of Search and AI Agent Architectures

The concept of treating search as a programmable API rather than a fixed endpoint has gained traction over the past two years. In 2024, the CodeAct framework demonstrated how models could write executable code to orchestrate search tools, leading to higher success rates. Similarly, Anthropic’s MCP approach, published in late 2025, emphasized turning tools into sandboxed code APIs to reduce context overhead and improve scalability. Perplexity’s SaC builds on these ideas but is distinguished by its re-architected, primitive-level search stack, making it more adaptable and potentially more efficient.

While the core idea is not entirely new, Perplexity claims to have engineered a novel, modular search stack that allows models to reach into and control search operations directly, rather than relying solely on external API calls or fixed pipelines. This represents a significant engineering effort that, if adopted broadly, could influence future AI system design.

“Perplexity’s Search as Code approach is a meaningful step toward more flexible, agent-centric search systems, but its true impact depends on independent validation and real-world deployment.”

— Thorsten Meyer, AI researcher

Indexing-First Search Systems: Architecture, Trust and AI Retrieval

Indexing-First Search Systems: Architecture, Trust and AI Retrieval

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Validation and Broader Adoption Still Pending

While early results are promising, independent replication of the benchmarks, especially proprietary ones like WANDR, has not yet occurred. The comparison involves different models with varying architectures, making it difficult to isolate the impact of SaC itself. Additionally, the long-term scalability, security, and integration challenges remain to be tested in real-world applications.

Independent Testing and Real-World Deployment Expected

Further validation from third-party researchers and broader industry testing are anticipated in the coming months. Perplexity is likely to release more detailed benchmarks and open-source components to facilitate external evaluation. Meanwhile, early adopters may experiment with SaC in pilot projects to assess its practical benefits and limitations, shaping its future evolution.

Key Questions

What is Search as Code (SaC)?

SaC is an approach where search operations are exposed as programmable primitives that AI models can assemble and execute dynamically, rather than relying on fixed search endpoints.

How does SaC improve AI search performance?

By allowing models to write custom retrieval pipelines, SaC enables more precise control, reduces token usage, and improves accuracy in complex tasks like vulnerability analysis.

Is SaC widely adopted yet?

No, it is still in early testing stages. Independent validation and broader industry adoption are expected in the coming months.

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

SaC builds on recent research and industry efforts that use code to orchestrate search and tools, but it uniquely re-architects the search stack into atomic primitives for greater control.

What are the main risks or challenges with SaC?

Validation of benchmark results, security considerations in executing dynamically generated code, and integration into existing systems remain key challenges.

Source: ThorstenMeyerAI.com

You May Also Like

AirTag & Tracker Alerts: What They Mean and What to Do

Ineffective responses to AirTag and tracker alerts can compromise your privacy; learn what these alerts mean and how to protect yourself.

AMÁLIA · The Three Hard Questions.

Portugal’s €5.5M AMÁLIA project, a European Portuguese LLM, faces key structural questions about openness, native data, and objectives, impacting national AI policy.

The Defender’s Window Is Closing Faster Than Anyone Is Counting

Recent developments show AI models rapidly advancing offensive cyber skills, shrinking defenders’ time to respond and increasing risks.

The Compute Reckoning: Anthropic Finally Admits What Customers Suspected for Ten Months

Anthropic confirms that its recent customer experience issues stem from compute shortages, with major capacity deals announced including SpaceX and others.