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 approach called Search as Code, allowing AI systems to build tailored search pipelines in real-time. This method aims to improve accuracy and efficiency, positioning Perplexity ahead in search innovation, though some claims require further validation.

On June 1, 2026, Perplexity’s research team announced a new architecture called Search as Code (SaC), designed to transform how AI systems perform search by enabling models to dynamically assemble retrieval pipelines in code, rather than relying on fixed search endpoints. This development could significantly impact the future of AI search capabilities and efficiency.

Perplexity’s SaC approach involves exposing the search stack—retrieval, ranking, filtering, and rendering—as atomic, composable primitives accessible via a Python SDK. The AI model acts as the control plane, generating code that orchestrates these primitives within a secure sandbox, allowing for highly customized, task-specific retrieval strategies. The company demonstrated the approach using a case study focused on identifying and characterizing over 200 high-severity CVEs, achieving 100% accuracy and reducing token usage by 85% compared to traditional systems.

In benchmark testing, SaC outperformed existing solutions on four of five tests, including WANDR, where it achieved a 2.5× improvement over competitors. The results suggest that models can write bespoke, multi-stage retrieval programs that adapt dynamically, rather than relying on repeated calls to monolithic search APIs. However, some of these benchmarks, including WANDR, are proprietary and not independently verified, raising questions about their generalizability.

At a glance
reportWhen: announced June 1, 2026
The developmentPerplexity unveiled Search as Code, a novel architecture for AI search, claiming major improvements in retrieval 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

Python SDK for search pipeline development

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
RAG-Driven Generative AI: Build custom retrieval augmented generation pipelines with LlamaIndex, Deep Lake, and Pinecone

RAG-Driven Generative AI: Build custom retrieval augmented generation pipelines with LlamaIndex, Deep Lake, and Pinecone

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Implications for AI Search and Retrieval Strategies

This development indicates a potential shift in AI search methodology, emphasizing flexible, code-based retrieval pipelines that can be tailored to complex, multi-step tasks. If validated broadly, SaC could lead to more accurate, efficient, and adaptable AI systems, reducing token costs and improving control over search processes. However, as some benchmarks are proprietary and comparisons involve models running on different architectures, the broader applicability remains to be confirmed.

Pro Tools Perpetual License NEW 1-year software download with updates + support for a year

Pro Tools Perpetual License NEW 1-year software download with updates + support for a year

Full version, permanent License of Avid Pro Tools. Includes 1-Year of software updates and upgrades.

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search Architectures in AI Development

Traditional search systems, including those optimized for AI, have relied on fixed pipelines that accept a query and return a set of results. This approach sufficed for simple queries but falters when AI agents need to execute complex, multi-step retrievals involving hundreds or thousands of operations per minute. The concept of turning search into dynamically assembled code is not new; prior work such as the CodeAct framework (ICML 2024) and Anthropic’s MCP (November 2025) demonstrated similar ideas by transforming tool calls into code executed in sandbox environments. Perplexity’s innovation lies in re-architecting its own search stack into atomic primitives, enabling direct, programmable control within its system.

“Perplexity’s Search as Code represents a meaningful step toward more flexible and efficient AI retrieval strategies, though some claims warrant independent validation.”

— Thorsten Meyer, AI researcher

ELEGOO UNO Project Basic Starter Kit with Tutorial and UNO R3 Compatible with Arduino IDE

ELEGOO UNO Project Basic Starter Kit with Tutorial and UNO R3 Compatible with Arduino IDE

The cheapest and most basic electronic components kit for Arduino beginner

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Validation and Generalizability of Search as Code

Several key questions remain unconfirmed. The most significant is whether the proprietary benchmarks, particularly WANDR, accurately reflect real-world performance and can be independently replicated. Additionally, the comparison involves models running on different architectures, complicating direct evaluation. The broader applicability of SaC across diverse search tasks and models is still uncertain, and the approach’s scalability outside of Perplexity’s environment has yet to be demonstrated.

Next Steps for Adoption and Validation

Further independent testing of SaC’s performance on publicly available benchmarks and real-world tasks is expected. Perplexity may also release more detailed technical documentation and open-source components to facilitate external validation. The industry will closely watch whether other AI developers adopt similar code-based retrieval architectures, potentially setting a new standard for AI search systems.

Key Questions

What is Search as Code (SaC)?

SaC is an architecture that allows AI systems to assemble customized search pipelines in real-time by generating and executing code, rather than relying on fixed search endpoints.

How does SaC improve search performance?

By enabling models to write task-specific retrieval programs, SaC can increase accuracy, reduce token usage, and adapt dynamically to complex queries, as demonstrated in Perplexity’s case study.

Are the benchmarks used in the demonstration independent?

No, some benchmarks like WANDR are proprietary and created by Perplexity, so their results require independent validation to confirm generalizability.

Is this approach widely adopted yet?

Not yet. While promising, SaC is a recent development, and broader industry adoption and validation are still in progress.

What are the risks of this new search architecture?

The main risks include overreliance on proprietary benchmarks, potential scalability issues, and the need for models to generate correct code reliably in diverse scenarios.

Source: ThorstenMeyerAI.com

You May Also Like

EuroHPC. The compute substrate.

Analysis of EuroHPC’s infrastructure role in Europe’s AI ambitions, highlighting operational strengths and structural challenges for frontier AI training.

Build vs Buy a Prebuilt AI Workstation

Struggling to choose between building or buying your AI workstation? Discover the real costs, benefits, and tradeoffs to make the best decision in 2026.

Building an AI Trading Bot — Week One: Why a 90 % Win Rate Can Still Lose Money

Initial testing of an AI trading bot shows high win rates can be misleading; real edge requires positive risk-reward balance, not just frequent wins.

Why the Best Mac Studio Setup for AI Creators Is About Balance

Meta description: Making the best Mac Studio setup for AI creators is about balance, ensuring seamless performance—discover what truly matters to unlock your potential.