📊 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 systems to dynamically assemble retrieval pipelines. This innovation aims to improve performance in complex, multi-step tasks, though it builds on existing ideas and faces some validation challenges.

Perplexity has unveiled a new approach called Search as Code (SaC) that enables AI systems to construct custom retrieval pipelines dynamically, marking a shift from traditional search methods. This development is significant because it addresses the limitations of fixed search pipelines in multi-step, agent-driven tasks, potentially boosting accuracy and efficiency in complex AI operations.

On June 1, 2026, Perplexity’s research team published a detailed proposal for Search as Code, arguing that conventional search systems are inadequate for the demands of AI agents executing multi-hour, multi-step tasks. Instead of treating search as a static endpoint, SaC exposes the internal components—retrieval, ranking, filtering, and rendering—as atomic primitives accessible via a Python SDK. This allows AI models to generate and execute code that orchestrates these components tailored to each specific task.

The system relies on a three-layer architecture: the model as the control plane, a sandbox environment for deterministic execution, and the primitive set within the SDK. This design enables the model to write bespoke retrieval programs, improving control and flexibility. A case study involving the identification of over 200 high-severity vulnerabilities showed SaC achieving 100% accuracy while reducing token usage by 85%, outperforming traditional systems that scored below 25%. Benchmark tests across multiple datasets also favored SaC, with leading performance on four of five tests and a 2.5× advantage on the WANDR benchmark.

While the approach is presented as innovative, critics note that the core idea of turning tools into executable code for better control has been explored previously, notably in recent research such as the CodeAct paper (ICML 2024) and Anthropic’s MCP framework. The key novelty claimed by Perplexity is the re-architecture of its search stack into atomic primitives, a complex engineering effort not easily replicable by external API wrappers. The company emphasizes this engineering achievement as its main contribution.

At a glance
reportWhen: announced June 1, 2026
The developmentPerplexity’s research team published a proposal on June 1, 2026, for transforming search into a programmable, modular system for AI agents, claiming significant performance improvements.
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
Claude AI for Beginners Bible: [5 in 1] The Ultimate Guide to Automate Your Work, Save Hours Every Week, and Use AI for Real-World Results

Claude AI for Beginners Bible: [5 in 1] The Ultimate Guide to Automate Your Work, Save Hours Every Week, and Use AI for Real-World Results

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
Agentic AI Builder Blueprint 2026: Build Practical AI Agents, RAG Apps, MCP Workflows, Automation Systems, Evaluation Pipelines, and Production-Ready LLM Tools Step by Step

Agentic AI Builder Blueprint 2026: Build Practical AI Agents, RAG Apps, MCP Workflows, Automation Systems, Evaluation Pipelines, and Production-Ready LLM Tools Step by Step

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Implications for AI Search and Retrieval

This development signals a potential paradigm shift in how AI systems perform search and retrieval, especially in complex, multi-step tasks requiring precise control over data fetching and filtering. By enabling models to generate custom retrieval pipelines, SaC could lead to more accurate, efficient, and adaptable AI agents, impacting sectors from cybersecurity to enterprise data management. However, the approach’s reliance on proprietary engineering and its current validation status mean its long-term effectiveness remains to be seen, and independent replication is needed to confirm its advantages.

Amazon

Python SDK for search customization

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search and AI Agent Capabilities

Traditional search systems, designed for human users, rely on fixed pipelines that return a set of results based on a query. AI-optimized search, such as that pioneered by Perplexity in 2022, improved relevance but still treated search as a monolithic endpoint. The rise of autonomous AI agents executing complex tasks revealed the limitations of these static pipelines, prompting research into more flexible, code-driven approaches. Recent work by researchers like Wang et al. (ICML 2024) and companies like Cloudflare and Anthropic has demonstrated that turning tools into executable code within a sandbox improves success rates and reduces context overhead. Perplexity’s SaC builds on these ideas, re-architecting its search stack into composable primitives to enable dynamic, code-based retrieval pipelines.

“Perplexity’s Search as Code represents a significant engineering achievement, re-architecting the search stack into atomic primitives for flexible, model-generated retrieval pipelines.”

— Thorsten Meyer, AI researcher

Amazon

AI retrieval pipeline components

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Validation and Independent Replication Challenges

Several aspects of SaC remain unconfirmed or uncertain. The most significant is the lack of independent replication of the reported performance gains, especially the WANDR benchmark result, which was internally developed by Perplexity. Critics note that the benchmarks used are either proprietary or not yet publicly available for external testing. Additionally, comparisons across different models and hardware configurations are not fully controlled, raising questions about the robustness of the claimed improvements. The long-term scalability and generalizability of SaC are also still unproven, and the approach’s reliance on proprietary engineering may limit widespread adoption.

Independent Testing and Broader Adoption Prospects

Next steps include independent researchers attempting to replicate Perplexity’s results using publicly available benchmarks and codebases. Peer review and external validation will be critical to establish SaC’s actual benefits. Meanwhile, other AI developers may explore similar architectures, and industry adoption could accelerate if the approach proves robust. Perplexity is expected to continue refining its system and publish more detailed results, including open benchmarks, in the coming months. The broader AI community will watch closely to see if this approach becomes a new standard for search in agent-driven AI systems.

Key Questions

What is Search as Code?

Search as Code (SaC) is an approach that allows AI systems to generate and execute custom retrieval pipelines by assembling atomic search primitives into code, enabling more flexible and precise data retrieval for complex tasks.

SaC offers greater control and adaptability by letting models write tailored retrieval programs, reducing token costs, and increasing accuracy in multi-step, agent-driven tasks compared to fixed, monolithic search endpoints.

Are Perplexity’s performance claims verified?

Most of Perplexity’s claims are based on internal benchmarks and proprietary data. Independent verification is pending, and skepticism remains until external tests confirm the results.

Is this approach widely applicable?

While promising, the approach’s reliance on engineering and proprietary components means broader adoption depends on validation, scalability, and ease of integration into existing systems.

If validated, SaC could revolutionize how AI systems perform retrieval, enabling more autonomous, efficient, and accurate agents capable of handling complex, multi-step tasks across industries.

Source: ThorstenMeyerAI.com

You May Also Like

How Heat Transfer Vinyl Changes Cutter Setup Decisions

Just understanding how HTV properties influence cutter settings is essential to achieving perfect cuts; discover how to optimize your setup for flawless results.

Disk Is the Contract: Inside Threlmark’s Local-First Architecture

Threlmark treats local disk storage as the definitive data source, simplifying sync, offline use, and interoperability. This report explores how this approach transforms project management tools.

Why Digital Proofing Is Becoming Essential for Fine Art Printing

Digital proofing is becoming essential in fine art printing because it helps…

Some Reasons Why Google Had Such A Bad Day

A combination of technical issues, AI missteps, and market pressures contributed to Google’s challenging day, according to reports.