📊 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 construct retrieval pipelines for improved accuracy and efficiency. This development marks a significant evolution in search technology for AI agents, though some claims require further validation.

Perplexity has introduced a new approach called Search as Code (SaC), which enables AI systems to assemble custom retrieval pipelines dynamically, marking a significant shift in search technology for AI agents. This development is confirmed by Perplexity’s publication on June 1, 2026, and is relevant because it addresses fundamental limitations in current search architectures used by AI systems.

Perplexity’s research team argued that traditional search methods, which treat search as a fixed pipeline returning static results, are inadequate for the needs of AI agents executing complex, multi-step tasks. Instead, they propose SaC, a framework where the search process is broken into atomic, composable primitives accessible via a Python SDK. This allows models to generate code that orchestrates retrieval, filtering, and ranking in real-time, tailored to each specific query or task.

The core innovation lies in exposing the search stack’s components—retrieval, ranking, filtering—as programmable building blocks. The model acts as the control plane, generating code to assemble these blocks into a custom pipeline, which runs securely in a sandbox environment. This approach enables more flexible, precise control over search processes, moving away from monolithic APIs.

Perplexity demonstrated the effectiveness of SaC through a case study involving the identification and characterization of over 200 high-severity CVEs. Their system achieved 100% accuracy while reducing token usage by 85%, outperforming other systems that scored below 25%. They also reported leading results on several benchmark tests, including WANDR, where SaC outperformed competitors by 2.5 times.

While these results are promising, some claims are based on proprietary benchmarks not yet independently verified, and comparisons involve different models, raising questions about the robustness of the findings. The approach builds on prior work in code-based agent architectures, notably the CodeAct framework and recent research from Anthropic, which also advocate turning tools into executable code for better control and efficiency.

At a glance
reportWhen: announced June 1, 2026
The developmentOn June 1, 2026, Perplexity published research advocating for Search as Code, transforming how AI systems utilize search capabilities.
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
Python 50 ft. No Spill Clean & Fill w Hook & 24" Extended Length Gravel Tube Bundle

Python 50 ft. No Spill Clean & Fill w Hook & 24" Extended Length Gravel Tube Bundle

The Python 50 ft. No Spill Clean & Fill w/ Python Hook & 24" Extended Length Gravel Tube…

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 signals a paradigm shift in how AI systems handle search, moving from static, API-driven retrieval to dynamic, code-assembled pipelines. It offers the potential for more accurate, efficient, and adaptable search processes, especially for complex multi-step tasks. The approach could influence future AI architectures, enabling more autonomous and precise information retrieval, critical for applications like cybersecurity, research, and enterprise automation.

Free Fling File Transfer Software for Windows [PC Download]

Free Fling File Transfer Software for Windows [PC Download]

Intuitive interface of a conventional FTP client

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 systems, inherited from human information retrieval, rely on fixed pipelines that are not optimized for AI agents executing complex tasks. Recent efforts, including Perplexity’s answer engine introduced in 2022, have aimed to improve relevance and efficiency. The concept of turning tools into code-based APIs was formalized in recent research like the ICML 2024 CodeAct paper, and Anthropic’s MCP framework further demonstrated the benefits of sandboxed code execution for search and tool integration. Perplexity’s innovation lies in re-architecting its search stack into atomic primitives, enabling the model to generate tailored retrieval pipelines, a step beyond prior approaches.

“Perplexity’s Search as Code represents a meaningful evolution in AI retrieval, shifting control from rigid APIs to flexible, code-driven pipelines.”

— Thorsten Meyer, AI researcher

Executive Sandbox - Beach Themed Zen Garden - Desktop Stress Relieving Office Decor - Includes 8” x 10” Hardwood Sandbox, 8 Seaside Accessories, and Ultra-Fine Sand

Executive Sandbox – Beach Themed Zen Garden – Desktop Stress Relieving Office Decor – Includes 8” x 10” Hardwood Sandbox, 8 Seaside Accessories, and Ultra-Fine Sand

Instantly transport yourself to the beach with this idyllic zen garden

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Verification and Broader Adoption of Search as Code

It is not yet clear whether the proprietary benchmarks and results reported by Perplexity will be independently validated. The effectiveness of SaC across diverse real-world scenarios remains to be tested outside of controlled experiments, and comparisons with other models involve different underlying architectures, which complicates direct evaluation.

Next Steps for Validation and Industry Adoption

Independent researchers and industry players are likely to attempt replication of Perplexity’s benchmarks and test SaC in varied applications. Further development may include integrating SaC into broader AI systems, refining the primitives, and exploring its impact on multi-agent tasks. Monitoring how competitors respond and whether the approach becomes a standard in AI search architectures will be key in the coming months.

Key Questions

What is Search as Code?

Search as Code (SaC) is an approach where the components of the search process are exposed as programmable primitives, allowing AI models to generate code that constructs custom retrieval pipelines dynamically.

Why is this development important?

It enables more flexible, accurate, and efficient search processes for AI agents, particularly in complex tasks requiring multiple retrievals and filtering steps, potentially transforming AI system architectures.

Are the reported results reliable?

The results are based on proprietary benchmarks and internal experiments. Independent validation and testing in diverse real-world scenarios are still needed to confirm the effectiveness of SaC.

How does SaC compare to existing search methods?

Unlike traditional fixed pipelines, SaC allows dynamic, code-driven assembly of retrieval steps, which has shown promising results in specific benchmarks, outperforming some existing systems in accuracy and token efficiency.

What are the potential limitations of SaC?

Its reliance on generating and executing code introduces complexity, and its effectiveness outside controlled experiments remains to be seen. Also, the approach requires architectural changes that may not be straightforward to implement at scale.

Source: ThorstenMeyerAI.com

You May Also Like

The Bottleneck Moved: Inside Anthropic’s Expansion of Project Glasswing

Anthropic is extending its cybersecurity initiative, Project Glasswing, to 150 new organizations, shifting focus from detection to patching vulnerabilities in critical software.

Google Search lets creators know more about their reach

Google Search introduces new features to help creators understand their content’s visibility and reach, improving transparency and performance insights.

The pyramid cracks. What agentic AI does to the consulting leverage model.

Generative AI is disrupting the traditional consulting pyramid, shifting value from analysis to deployment and causing firm-by-firm restructuring.

Why people might ditch their smartwatches for something simpler

Many consumers are shifting away from feature-heavy smartwatches toward minimalist, screen-free fitness bands and analog alternatives due to distraction, cost, and usability concerns.