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 systems to build custom retrieval pipelines dynamically. This innovation aims to enhance accuracy and control in AI search tasks, marking a significant step forward in agent-based AI systems.

Perplexity has introduced Search as Code (SaC), a new framework that transforms how AI systems perform search operations. This approach allows models to assemble and execute custom retrieval pipelines dynamically, moving beyond traditional fixed search endpoints. The development is significant because it addresses the control and flexibility issues faced by AI agents performing complex, multi-step retrieval tasks.

In a publication dated June 1, 2026, Perplexity’s research team detailed how traditional search systems, including those optimized for AI, rely on a fixed pipeline that limits control and adaptability for AI agents executing multi-hour or multi-step tasks. SaC replaces monolithic search endpoints with a modular stack of primitives—retrieval, ranking, filtering, and rendering—that can be orchestrated by the AI model through generated code in a secure sandbox environment.

The system uses a three-layer architecture: the model as the control plane, a sandbox for deterministic execution, and the primitive set called the Agentic Search SDK. This design enables models to fetch, filter, and assemble search results more precisely, reducing token usage and increasing accuracy. For example, in a case study involving high-severity vulnerability identification, SaC achieved 100% accuracy while reducing token consumption by 85%, outperforming conventional systems significantly.

Benchmark results show SaC leading in four out of five tests, including DSQA, BrowseComp, WideSearch, and WANDR, and tying with OpenAI on HLE. The approach also demonstrated a 2.5× performance improvement on WANDR compared to previous systems. These results highlight the potential of code-based retrieval pipelines to enhance AI search capabilities, especially in complex, multi-step scenarios.

At a glance
reportWhen: announced June 1, 2026
The developmentOn June 1, 2026, Perplexity published a research piece proposing Search as Code, claiming it improves AI search capabilities by enabling dynamic, code-based retrieval pipelines.
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
Hands-On Agentic AI with LangChain, RAG, and Ollama:: Build Modular Local AI Agents, Retrieval Pipelines, Tool-Using Workflows, and Production-Ready Applications

Hands-On Agentic AI with LangChain, RAG, and Ollama:: Build Modular Local AI Agents, Retrieval Pipelines, Tool-Using Workflows, and Production-Ready Applications

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
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.

Implications for AI Search and Agent Control

This development matters because it marks a shift toward more flexible, controllable, and efficient AI search architectures. By enabling models to generate and execute code that dynamically manages retrieval pipelines, SaC enhances the ability of AI agents to perform complex tasks with higher accuracy and lower resource consumption. This approach could influence future AI system designs, especially in domains requiring precise and adaptable information retrieval, such as cybersecurity, legal research, and scientific discovery.

Competitive Programming 4 - Book 1: The Lower Bound of Programming Contests in the 2020s

Competitive Programming 4 – Book 1: The Lower Bound of Programming Contests in the 2020s

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search Techniques in AI

Traditional search systems have relied on fixed pipelines designed for human users, not AI agents. In recent years, there has been a push to adapt search for AI, with innovations like AI-optimized search engines and answer-focused retrieval. The idea of using code to orchestrate search operations is not new; prior research, including the 2024 ICML paper on CodeAct, demonstrated that models trained on code perform better at executing complex retrieval strategies. Similarly, Anthropic’s 2025 work on code execution with MCP showed that turning tools into sandboxed code APIs drastically reduces context overhead.

Perplexity’s contribution lies in re-architecting its search stack into atomic primitives that can be composed by the model, a step beyond merely wrapping external APIs. While the concept of code-based tool use has been explored, applying it specifically to search pipelines within a dedicated SDK represents a notable engineering advance, though the core idea predates the company’s work.

“Search as Code fundamentally shifts how AI systems can control and optimize retrieval processes, making them more adaptable and precise.”

— Thorsten Meyer, AI researcher

Amazon

modular search primitives for AI

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Unverified Claims and Benchmark Limitations

While Perplexity reports impressive results, some claims are based on proprietary benchmarks like WANDR, which has not yet been independently validated. The benchmarks where SaC shows the largest advantage are self-authored, raising questions about reproducibility. Additionally, comparisons involve different models (GPT-5.5 vs. Opus 4.7), complicating direct assessment of architecture impact. The broader applicability of SaC beyond tested scenarios remains to be seen, and the long-term robustness of the approach is still under evaluation.

Next Steps for Validation and Adoption

Further independent testing and replication of Perplexity’s benchmarks are needed to confirm the claimed advantages of SaC. Industry adoption will depend on how well this approach scales across diverse tasks and whether competitors develop similar architectures. Perplexity plans to release more detailed technical documentation and possibly open-source components to facilitate external validation. Watching how the broader AI community responds and tests SaC’s effectiveness will be crucial in assessing its future impact.

Key Questions

What is Search as Code and how does it differ from traditional search?

Search as Code (SaC) allows AI models to generate and run custom retrieval pipelines by writing code, replacing fixed search endpoints. Traditional search returns static results based on a query, while SaC enables dynamic, programmable control over search processes.

What are the main benefits of SaC according to Perplexity?

SaC improves search accuracy, reduces token usage, and provides greater control and flexibility for AI agents performing complex retrieval tasks, especially in multi-step scenarios.

Has SaC been independently validated outside of Perplexity?

No, the benchmarks and claims are currently limited to Perplexity’s internal testing. Independent validation and replication are still pending.

Will SaC be available for other AI systems to adopt?

Perplexity has not announced open-sourcing SaC yet, but future releases and technical documentation are expected to facilitate broader adoption and testing.

What are the limitations or risks of the SaC approach?

Potential limitations include reliance on proprietary benchmarks, unverified performance outside tested scenarios, and the complexity of integrating code-based pipelines into existing systems. Long-term robustness remains uncertain.

Source: ThorstenMeyerAI.com

You May Also Like

SanDisk’s New 8TB PS5 SSD Costs More Than Three Times As Much As The PS5 Pro

SanDisk’s new 8TB SSD for PS5 costs significantly more than the PS5 Pro, raising questions about pricing and value for gamers.

The Co-Founder’s Black Hole — A Structural Read on Jack Clark’s Automated AI R&D Essay

Jack Clark predicts over a 60% chance of fully automated AI research by 2028, raising concerns about institutional preparedness and future risks.

Candor as a Moat: A Critical Reading of Dario Amodei and Anthropic

A critical examination of Dario Amodei’s transparency and safety proposals, and how they may reinforce Anthropic’s market position amid regulatory actions.

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

Anthropic confirms that recent customer experience issues were due to compute shortages, with a major deal with SpaceX addressing the problem.