📊 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 developed a new method called Search as Code (SaC), allowing AI models to dynamically build search pipelines using code. This approach has shown promising results in accuracy and efficiency, challenging traditional search paradigms.

Perplexity has unveiled a new approach called Search as Code (SaC), which allows AI models to construct and execute custom search pipelines in real-time. This development aims to address limitations in traditional search systems, especially for AI agents performing complex, multi-step tasks. The announcement highlights a significant shift in search architecture, emphasizing flexibility and control for AI-driven retrieval processes.

Perplexity’s research team published their findings on June 1, 2026, proposing SaC as a solution to the rigidity of conventional search systems. Unlike traditional search, which treats search as a static endpoint returning fixed results, SaC exposes retrieval, filtering, ranking, and assembly as composable primitives within a Python SDK. The AI model then writes code to orchestrate these primitives, enabling tailored, multi-stage retrieval pipelines.

The core innovation is integrating search stack components into a controllable, programmable framework, allowing models to adapt retrieval strategies dynamically. The system is built around three layers: the model as the control plane, a sandbox for deterministic execution, and the primitive set for search operations. This architecture enables the model to fetch, filter, and assemble data more precisely, reducing token usage and increasing accuracy.

In a case study focused on identifying high-severity vulnerabilities (CVE data), SaC achieved 100% accuracy while reducing token consumption by 85%, outperforming existing systems that scored below 25%. The approach was also tested across multiple benchmark suites, where it led in four out of five tests, tying on the fifth, and surpassing rivals in efficiency and cost-performance metrics.

While the results are promising, the developers acknowledge the approach’s novelty is not entirely new—similar ideas have been explored in recent academic papers and by other companies, such as in code search tools. The key difference is Perplexity’s engineering effort to re-architect its search stack into atomic primitives, which is more difficult to replicate with external APIs. The company emphasizes that SaC is a practical implementation of existing concepts, tailored for high-stakes, scalable AI applications.

At a glance
reportWhen: announced June 1, 2026
The developmentOn June 1, 2026, Perplexity announced a new architecture called Search as Code, which enables AI systems to assemble customizable search pipelines dynamically.
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 development Python SDK

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

custom search pipeline tools

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 potential paradigm shift in how AI systems perform search and retrieval. By enabling models to generate and execute custom search pipelines, SaC could significantly improve accuracy, reduce costs, and increase flexibility for complex AI tasks. It challenges the dominance of monolithic search APIs, pushing toward more programmable, adaptable retrieval systems that better serve AI agents in real-world scenarios.

For practitioners, this means more control over data retrieval processes, potentially leading to more precise and trustworthy results. For the industry, it suggests a move toward integrated, code-based search architectures that can be tailored to specific tasks, reducing reliance on fixed APIs and static pipelines. However, the approach also raises questions about complexity, robustness, and the need for further validation across diverse applications.

Amazon

search as code software

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background and Related Developments in Search Architectures

Traditional search systems have long relied on fixed pipelines that accept a query and return results, a model inherited from the human era of web search. Recent advances in AI have challenged this paradigm, with companies like OpenAI and Anthropic exploring tool-based and code-driven retrieval methods. In 2024, the CodeAct paper formalized the idea of using executable code to orchestrate search and reasoning, demonstrating higher success rates across models.

Earlier in 2026, Hugging Face introduced frameworks like smolagents, and Cloudflare launched Code Mode, both emphasizing code-based approaches for AI tool integration. Perplexity’s innovation lies in re-architecting its entire search stack into atomic, composable primitives, making it more adaptable and potentially more powerful than previous API-based methods. This aligns with broader trends toward programmable AI systems capable of dynamic task-specific behavior.

“Search as Code fundamentally changes how AI models interact with retrieval systems, enabling tailored, multi-stage pipelines that improve both accuracy and efficiency.”

— Thorsten Meyer, Lead Researcher at Perplexity

Amazon

AI retrieval pipeline components

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Unverified Claims and Areas Requiring Further Validation

Some claims, such as the performance on proprietary benchmarks like WANDR, have not been independently verified, as Perplexity has not published full details. The comparison across different models (GPT-5.5 vs. Opus 4.7) raises questions about the fairness of the benchmark results. Additionally, the scalability and robustness of SaC in diverse, real-world scenarios remain to be tested, and the impact on system complexity and maintenance is still unclear.

Next Steps for Validation and Adoption of Search as Code

Further independent testing and replication of Perplexity’s benchmark results are expected. The company may release more detailed technical documentation and open-source components to facilitate validation. Broader industry adoption will depend on how well SaC performs in varied applications, its ease of integration, and its resilience under operational conditions. Ongoing research and development will likely refine the architecture and expand its capabilities.

Key Questions

How does Search as Code differ from traditional search methods?

SaC allows AI models to generate and execute custom code to orchestrate search components dynamically, rather than relying on fixed, monolithic search endpoints. This enables more tailored, multi-stage retrieval pipelines.

What are the main benefits of SaC according to Perplexity?

SaC offers higher accuracy, reduced token usage, and greater flexibility in search strategies. It also allows models to adapt retrieval processes to specific tasks in real-time.

Has SaC been independently validated outside of Perplexity?

No, the current results are from Perplexity’s internal benchmarks. Independent validation is needed to confirm performance claims across diverse scenarios.

Will this approach be easy to implement in existing AI systems?

Implementation complexity depends on the system architecture. While SaC’s primitives are designed to be modular, integrating code-based search pipelines may require significant engineering effort.

What challenges could arise from using code to control search pipelines?

Potential challenges include managing system complexity, ensuring robustness, preventing errors in generated code, and maintaining security in sandboxed environments.

Source: ThorstenMeyerAI.com

You May Also Like

The Skills Marketplace Nobody Is Building Yet

A comprehensive analysis of the emerging skills standard in AI, its current limitations, and the opportunity for a dedicated marketplace platform.

Why Acoustic Control Is Becoming a Serious Work Upgrade

Keen to boost focus and reduce stress, discover how acoustic control can transform your workspace—here’s why it’s a serious work upgrade.

EMO: Pretraining mixture of experts for emergent modularity

AI researchers introduce EMO, a mixture-of-experts model that naturally develops modular structure during pretraining, enabling selective expert use with minimal performance loss.

The Defender’s Window Is Closing Faster Than Anyone Is Counting

April 2026 saw a surge in offensive AI capabilities, with models now able to autonomously find vulnerabilities and perform complex cyber-attacks, raising urgent security concerns.