📊 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 Search as Code approach, allowing AI systems to dynamically build search pipelines using composable primitives. While promising, independent validation and broader adoption are still pending.

Perplexity has announced a new approach called Search as Code (SaC), which allows AI agents to dynamically assemble custom retrieval pipelines using composable primitives. This development aims to address limitations in traditional search systems, especially for complex, multi-step tasks performed by AI agents, and could significantly improve retrieval control and efficiency.

Perplexity’s Search as Code reimagines how search systems operate within AI workflows. Instead of relying on fixed, monolithic search endpoints, SaC exposes retrieval, filtering, ranking, and rendering components as atomic, programmable blocks accessible via a Python SDK. The AI model acts as the control plane, generating code that orchestrates these primitives in real-time, enabling tailored, multi-stage retrieval pipelines.

The approach was validated through a case study involving the identification and characterization of over 200 high-severity vulnerabilities (CVEs). According to Perplexity, SaC achieved 100% accuracy while reducing token usage by 85%, outperforming other systems that scored less than 25%. The system’s strategy involved multi-stage retrieval, targeted refinements, and schema-bound verification, illustrating more efficient and precise search capabilities.

In benchmark testing, SaC led in four out of five tests, tying with OpenAI on the fifth, and outperformed competitors on the WANDR benchmark by 2.5×. The results suggest that dynamically assembled, code-driven search pipelines can outperform traditional fixed APIs, especially in complex retrieval scenarios.

At a glance
reportWhen: announced June 1, 2026; development ong…
The developmentOn June 1, 2026, Perplexity unveiled Search as Code, a novel method for AI search that improves control and efficiency by enabling models to assemble retrieval pipelines in code.
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.

Potential Impact on AI Search and Agent Capabilities

This development could transform how AI systems perform search, enabling more precise control, better scalability, and enhanced multi-step reasoning. By allowing models to write and execute custom retrieval code, SaC may improve the effectiveness of AI agents in complex tasks such as cybersecurity, research, and data analysis. However, as the approach is still new, broader validation and independent replication are necessary before widespread adoption.

Custom Search - Discover more:: A Complete Guide to Google Programmable Search Engines

Custom Search – Discover more:: A Complete Guide to Google Programmable Search Engines

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search and Agent Architectures

Traditional search systems have relied on fixed pipelines designed for human users, which are less effective for AI agents executing multi-stage tasks. Recent research, including the CodeAct paper and efforts by Hugging Face and Anthropic, has shown that turning tools into executable code within sandboxed environments enhances agent performance. Perplexity’s SaC builds on this trend by re-architecting its search stack into atomic, programmable primitives, a significant engineering effort that distinguishes it from external API wrappers.

While the concept of using code to orchestrate search is not entirely new, Perplexity claims to be the first to fully re-engineer its internal search stack into composable, programmable parts, aiming to give models more control and flexibility. The approach aligns with broader industry movements toward code-based tool integration for large language models.

“Perplexity’s Search as Code represents a meaningful step toward more controllable and efficient AI search pipelines, but independent validation remains essential.”

— 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 Replication Challenges for SaC

While initial results are promising, independent validation of SaC’s benchmarks, especially the proprietary WANDR test, has not yet been published. The comparisons involve different models and configurations, raising questions about the robustness of the performance claims. Furthermore, the approach’s novelty is partly an evolution of existing ideas, and broader community validation is still needed to confirm its advantages.

Next Steps for Adoption and Independent Testing

Further independent benchmarking and peer-reviewed validation are expected to clarify SaC’s true performance benefits. Widespread adoption will depend on replicability, integration into existing AI workflows, and demonstration of advantages across diverse real-world tasks. Perplexity may also expand its SDK and refine the approach based on feedback from the research community.

Key Questions

How does Search as Code differ from traditional search methods?

SaC allows AI models to assemble and execute custom retrieval pipelines using programmable primitives, rather than relying on fixed search endpoints. This provides greater control and flexibility for complex, multi-step tasks.

Is SaC already proven to be better than existing search systems?

Initial tests show promising results, with higher accuracy and efficiency in specific benchmarks. However, independent validation and broader testing are still pending to confirm these claims.

What are the main limitations or uncertainties around SaC?

The main uncertainties involve the lack of independent replication of benchmark results, the proprietary nature of some tests, and whether the approach generalizes well across diverse tasks and models.

Will SaC be adopted widely in the AI community?

Widespread adoption depends on validation, ease of integration, and demonstrated benefits in real-world scenarios. Industry interest may grow if the approach proves scalable and reliable.

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 Rise of Tap‑to‑Pay on Android: What Developers Need to Know

Getting started with tap-to-pay on Android requires understanding key security and protocol updates to ensure seamless, safe contactless transactions.

DeepSWE – The benchmark that made the models spread out again

DeepSWE, released May 26, 2026, reveals larger gaps among AI coding models, challenging previous benchmarks’ accuracy and highlighting model differences.