📊 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 models to build custom retrieval pipelines in real-time. This method outperforms traditional search and sets a new direction for AI agent development, though some claims require further validation.

Perplexity has introduced a new architecture called Search as Code, which fundamentally changes how AI systems perform search by enabling models to assemble custom retrieval pipelines dynamically, rather than relying on fixed search endpoints. This development aims to address the limitations of traditional search methods in AI agent workflows, potentially improving accuracy and control.On June 1, 2026, Perplexity’s research team published a detailed proposal for Search as Code (SaC), arguing that conventional search models are insufficient for complex, multi-step AI tasks. Instead of treating search as a static query-response process, SaC exposes the search stack’s components—retrieval, filtering, ranking, and rendering—as atomic primitives accessible via a Python SDK. The AI model acts as the control plane, generating code to orchestrate these primitives in a tailored pipeline for each task. The approach was demonstrated through a case study involving the identification and characterization of over 200 high-severity cybersecurity vulnerabilities. The SaC system achieved 100% accuracy while reducing token usage by 85%, outperforming other systems that scored below 25%. The system’s strategy involved multi-stage retrieval, refinement by large language models, and schema-bound verification, illustrating a flexible, bespoke retrieval process. Perplexity reports that SaC outperforms existing solutions on four out of five benchmark tests, tying on the fifth, and achieving up to 2.5× better results on their new WANDR benchmark. The system also demonstrated cost efficiency, with lower token consumption and competitive performance at reduced computational expense. These results suggest SaC’s potential to significantly improve AI retrieval workflows, especially in complex, multi-step tasks.
At a glance
reportWhen: announced June 1, 2026
The developmentOn June 1, 2026, Perplexity unveiled Search as Code, a novel architecture for AI search systems designed to improve retrieval control 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

AI retrieval pipeline development tools

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
Amazon

Python SDK for AI search systems

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Implications for AI Search and Retrieval Control

The introduction of Search as Code marks a shift toward more flexible, programmable AI retrieval systems, enabling models to orchestrate search components dynamically. This could lead to more accurate, efficient, and adaptable AI agents capable of handling complex tasks that require multiple retrieval operations. If broadly adopted, SaC may redefine standards for AI search infrastructure, impacting fields from cybersecurity to knowledge management. However, some claims, especially benchmark results, remain to be independently verified, and the approach’s practical deployment at scale is still uncertain.
Amazon

AI search optimization software

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search Architectures in AI Systems

Traditional search in AI systems has relied on fixed pipelines that accept a query and return a static set of results, a model inherited from human search paradigms. Even advanced AI-optimized search systems, such as those pioneered by Perplexity in 2022, have maintained this structure. Recent research, including the CodeAct paper (ICML 2024), has argued for transforming tools into executable code to improve flexibility and success rates. Anthropic’s MCP framework (November 2025) also proposed turning tools into sandboxed code APIs, reducing context load and increasing control. Perplexity’s approach builds on these ideas by re-architecting its entire search stack into composable primitives, allowing models to generate code that orchestrates retrieval processes in real-time. This represents a significant engineering effort and a conceptual evolution in how search and retrieval are integrated into AI workflows.

“Search as Code fundamentally changes how AI systems control retrieval, enabling dynamic, bespoke pipelines that adapt to each task.”

— Thorsten Meyer, Lead Researcher at Perplexity

Amazon

large language model development tools

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 benchmark results, including the WANDR test, are based on proprietary data and have not been independently validated. The comparison between models running on different underlying architectures (GPT-5.5 vs. Opus 4.7) introduces potential confounding factors. Additionally, the system’s performance in real-world, large-scale deployments remains to be seen, and the claims about token reduction and accuracy need further replication.

Next Steps for Validation and Adoption of SaC

Independent researchers and industry players are expected to attempt replicating Perplexity’s benchmark results, particularly on WANDR. Further development will focus on scaling SaC’s architecture for broader deployment, integrating it into existing AI workflows, and assessing its performance in real-world scenarios. Industry adoption will likely depend on external validation and demonstrated robustness in diverse applications.

Key Questions

What is Search as Code and why is it important?

Search as Code is a new architecture introduced by Perplexity that allows AI models to assemble and execute custom retrieval pipelines dynamically, improving control and efficiency in complex tasks.

How does SaC differ from traditional search methods?

Traditional search treats search as a fixed query-response process, while SaC exposes search components as programmable primitives that models can orchestrate in real-time via generated code.

Are the benchmark results from Perplexity independently verified?

No, some results, especially on proprietary benchmarks like WANDR, have not yet been independently validated, and further replication is needed.

Will SaC be scalable for real-world applications?

The system shows promise, but its scalability and robustness in large-scale, diverse environments remain to be tested in future deployments.

How does this development relate to previous research?

This approach builds on earlier ideas of turning tools into executable code, as seen in the CodeAct paper and Anthropic’s MCP framework, but with a significant engineering effort to re-architect the search stack itself.

Source: ThorstenMeyerAI.com

You May Also Like

AI Vs Humans: Will Artificial Intelligence Take Our Jobs or Make Life Better?

Artificial intelligence is transforming work and life, but will it replace us or create new opportunities? Discover the possibilities.

Super Apps: Will One App Replace All Others on Your Phone?

What if one app could handle everything on your phone, but are there reasons it might not fully replace others?

The CFO’s new operating system. Anthropic, OpenAI, and the consulting margin that just got compressed.

Anthropic, OpenAI, and consulting firms face margin pressures as CFOs adopt new AI-driven operational models, reshaping industry economics.

The referral. How AI search severs the content-for-traffic contract that funded the open web.

AI search now answers queries directly, ending the traditional referral traffic that funded publishers. The shift impacts small publishers most.