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 announced a new approach called Search as Code, allowing AI models to dynamically assemble retrieval pipelines. This innovation aims to improve performance in complex tasks, though its novelty and independent validation remain uncertain.

Perplexity announced the release of Search as Code on June 1, 2026, a new framework that allows AI models to assemble custom search pipelines dynamically, instead of relying on fixed search endpoints. This development aims to address limitations in traditional search methods when used in complex, multi-step AI tasks, marking a significant shift in how retrieval systems are integrated with AI agents.

The core idea behind Search as Code (SaC) is to replace the conventional search API, which treats retrieval as a monolithic process, with a modular architecture where retrieval, filtering, ranking, and rendering are exposed as atomic primitives accessible via a Python SDK. This enables AI models to generate and execute code that orchestrates search operations tailored to specific tasks, providing greater control and flexibility.

Perplexity demonstrated SaC’s potential through a case study involving the identification and characterization of over 200 high-severity CVEs. The system achieved 100% accuracy while reducing token usage by 85%, outperforming traditional systems that scored under 25%. The approach involves a three-stage process: broad fan-out over vendor advisories, targeted refinements via language models, and schema-bound verification, all orchestrated through generated code rather than fixed endpoints.

Benchmark results show SaC leading on four of five tests, including WideSearch and WANDR, with performance improvements up to 2.5 times over previous systems. The company emphasizes that SaC’s architecture is not just a new API wrapper but a fundamental re-architecture of the search stack into composable primitives, enabling more precise and efficient retrieval in complex scenarios.

At a glance
reportWhen: announced June 1, 2026
The developmentOn June 1, 2026, Perplexity unveiled Search as Code, a novel method for AI search systems to generate custom retrieval pipelines using code, promising enhanced accuracy and control.
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 of Search as Code for AI Search Strategies

This development signals a shift toward more flexible, programmable retrieval systems in AI, enabling models to craft custom search pipelines on the fly. Such control can improve accuracy, reduce costs, and support complex multi-step tasks, which are critical for advanced AI agents operating in real-world environments. However, the approach’s reliance on re-architecting core search infrastructure raises questions about its scalability and replicability across different platforms.

While Perplexity’s results are promising, their benchmarks are either proprietary or require further independent validation. The broader adoption of Search as Code could influence future AI system design, pushing toward more modular, code-driven retrieval architectures that harness the full potential of large language models trained on code.

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.

Background and Evolution of Search in AI Agents

Traditional search systems, inherited from the human-era paradigm, process queries through fixed pipelines that return static result sets. As AI agents evolved, the need for more dynamic and multi-step retrieval became apparent, especially when handling complex tasks requiring hundreds of retrieval operations per minute. Prior efforts, including Perplexity’s own answer engine introduced in 2022, aimed to optimize search for AI but still relied on monolithic APIs.

The conceptual foundation for turning search into programmable, executable code was laid in recent research, notably the 2024 ICML paper by Wang et al., which formalized the idea of agents acting by writing code to orchestrate tools. Similarly, Anthropic’s 2025 work on MCP demonstrated the benefits of turning tools into sandboxed APIs, reducing context load and increasing success rates. Perplexity’s SaC builds on these ideas, re-architecting its search stack into atomic primitives for more flexible control.

“Perplexity’s Search as Code represents a significant step toward more programmable, adaptable search systems for AI agents.”

— Thorsten Meyer, AI researcher

Memory Systems: Cache, DRAM, Disk

Memory Systems: Cache, DRAM, Disk

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Validation and Broader Adoption of Search as Code

It remains unclear how well SaC’s approach will scale across different platforms or whether independent benchmarks will replicate Perplexity’s results. The performance gains reported are based on proprietary benchmarks and internal tests, some of which are not yet publicly validated. Additionally, the broader AI community has seen similar ideas proposed before, raising questions about the novelty and practical advantages of SaC outside Perplexity’s environment.

Next Steps for Validation and Industry Adoption

Independent researchers and industry players will likely attempt to replicate Perplexity’s benchmarks and evaluate SaC’s effectiveness in diverse real-world scenarios. Further development may include integrating SaC into larger AI systems, exploring its scalability, and assessing its impact on multi-agent coordination. Perplexity may also publish more detailed results and open-source components to foster broader validation and adoption.

Key Questions

What is Search as Code?

Search as Code is Perplexity’s approach to making search pipelines programmable, allowing AI models to generate and execute code that orchestrates retrieval, filtering, and ranking dynamically.

How does SaC differ from traditional search methods?

Unlike fixed APIs that treat search as a monolithic process, SaC exposes search components as primitives that models can assemble into custom pipelines, offering greater control and efficiency.

Are the claimed performance improvements verified?

Perplexity reports promising results on internal benchmarks, but independent validation and replication are still pending to confirm these performance gains.

Is this a completely new idea?

Turning search components into programmable primitives builds on prior research in code-driven agents, but Perplexity’s specific architecture and implementation are new innovations.

What are the risks or limitations?

Potential challenges include scalability, complexity of implementation, and the need for broader validation before widespread industry adoption.

Source: ThorstenMeyerAI.com

You May Also Like

Client asset intake portal for accountants

A new client asset intake portal for small accounting firms is set to be tested, aiming to streamline document collection and reduce administrative loops.

The Channel Move: Anthropic, Wall Street, and the Acquisition of the Real Economy

Anthropic, backed by major PE firms, launches a $1.5B joint venture to embed Claude AI into thousands of portfolio companies, transforming enterprise AI deployment.

When a Content Network Starts Publishing to Itself

A major content network has begun internal publishing, creating a self-sustaining ecosystem that enhances audience control and engagement, with emerging risks.

Week Three — Foundation model vs Brownian motion. Kronos on five-minute BTC.

Kronos foundation model tested against Brownian motion for 5-minute BTC predictions; results show no significant improvement, challenging assumptions about AI trading edge.