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 has announced a new approach called Search as Code, allowing AI models to generate and execute custom retrieval programs. This method significantly improves accuracy and reduces token usage, marking a notable advance in AI search capabilities.

Perplexity has introduced Search as Code (SaC), a new architecture that enables AI models to assemble custom retrieval pipelines on the fly, marking a significant shift from traditional search methods. This development aims to improve accuracy and control in AI-driven search, especially for complex multi-step tasks.

On June 1, 2026, Perplexity’s research team published a detailed explanation of SaC, which reimagines search not as a fixed endpoint but as a set of composable primitives that an AI can orchestrate through generated code. This approach allows models to control retrieval, filtering, and ranking processes dynamically, rather than relying on a monolithic search API.

The core innovation involves exposing the search stack as atomic, programmable components accessible via a Python SDK. The model acts as the control plane, generating code that directs retrieval and filtering in a sandboxed environment, enabling more precise and adaptable search strategies.

Perplexity demonstrated SaC’s effectiveness with a case study on identifying high-severity vulnerabilities (CVEs), achieving 100% accuracy while reducing token usage by 85%, outperforming other systems that scored below 25%. Benchmarks across multiple tests showed SaC leading in four out of five, with notable improvements in efficiency and cost-effectiveness.

While the results are promising, some skepticism remains. The most significant performance gains are reported on a proprietary benchmark (WANDR), which has not been independently validated. Additionally, the comparison involves different models and configurations, complicating direct attribution of improvements solely to SaC. The concept of programmable retrieval pipelines is not entirely new, having been explored in prior academic and industrial research.

At a glance
reportWhen: announced June 1, 2026
The developmentPerplexity’s research team revealed on June 1, 2026, that they have developed and are shipping a new search architecture called Search as Code, which allows AI models to build tailored retrieval 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 search 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 search customization

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Implications for AI Search and Retrieval Control

This development signals a potential paradigm shift in how AI systems perform search tasks. By enabling models to generate and execute custom retrieval code, SaC offers increased flexibility, precision, and efficiency, especially for complex or multi-step queries. This approach could improve the performance of AI agents in applications ranging from cybersecurity to research automation, reducing reliance on static APIs and enhancing control over information gathering.

However, the approach also raises questions about implementation complexity, standardization, and how quickly other organizations can adopt similar architectures. The ability to build such programmable search pipelines could influence the future design of AI tools and platforms, emphasizing modularity and code-based control.

Amazon

advanced search engine APIs

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search Architectures in AI Development

Traditional search engines and AI-optimized search systems have historically relied on fixed pipelines that accept a query and return a static set of results. This approach sufficed when AI models performed single, isolated queries, but it becomes inefficient for multi-step, autonomous tasks requiring hundreds or thousands of retrieval operations per minute.

In recent years, researchers and companies have explored more flexible architectures. Notably, the CodeAct paper (ICML 2024) formalized the idea that agents should act by writing executable code rather than just calling tool APIs, leading to higher success rates and more adaptable behavior. Similarly, Anthropic’s 2025 research demonstrated the benefits of turning tools into sandboxed code APIs, reducing context size and increasing control.

Perplexity’s SaC builds on these ideas by re-architecting its search stack into atomic primitives, enabling models to generate tailored retrieval programs. While the approach is not entirely novel, the engineering effort to modularize and expose the search process as programmable components is significant and distinguishes it from previous attempts.

“Search as Code represents a meaningful evolution in AI retrieval strategies, offering unprecedented control and efficiency.”

— Thorsten Meyer, AI researcher

Amazon

AI retrieval pipeline software

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Validation and Broader Adoption of Search as Code

While initial results are promising, independent validation of SaC’s benchmarks, especially the proprietary WANDR test, remains pending. The comparative advantage when using different models and configurations introduces uncertainty about the exact contribution of SaC itself. Additionally, the approach builds on prior concepts, and its scalability and ease of adoption across the industry are still unproven.

Further testing and peer review are needed to confirm the robustness and generalizability of these findings.

Next Steps for Industry Adoption and Validation

Perplexity plans to publish more detailed benchmark results and seeks independent verification of SaC’s performance. Industry observers anticipate that other AI developers will experiment with programmable retrieval pipelines, potentially leading to broader adoption if results are confirmed. Additionally, efforts to standardize such architectures could emerge, influencing future search and retrieval frameworks in AI systems.

Monitoring how SaC performs in real-world applications and whether it can be integrated into larger AI ecosystems will be crucial in the coming months.

Key Questions

What is Search as Code (SaC)?

SaC is an architecture that allows AI models to generate and execute custom retrieval pipelines through programmable primitives, enabling more precise and adaptable search processes.

How does SaC improve over traditional search methods?

SaC offers increased control, efficiency, and accuracy by allowing models to orchestrate search steps dynamically, reducing token usage and enabling multi-stage, tailored retrieval strategies.

Is this approach entirely new?

While the concept of programmable retrieval pipelines has been explored previously, Perplexity’s implementation of re-architecting its search stack into atomic primitives is a significant engineering achievement and a notable advancement in this area.

Will other companies adopt Search as Code?

Industry adoption depends on validation of SaC’s performance and ease of integration. If results are confirmed, it is likely that similar architectures will be explored by other AI developers.

What are the main uncertainties remaining?

Independent verification of benchmark results, scalability across different models, and industry-wide adoption are still uncertain at this stage.

Source: ThorstenMeyerAI.com

You May Also Like

What a Functional Post-Ai World Might Look Like — and How to Build It

Just imagining a post-AI world reveals transformative possibilities, but understanding how to build it responsibly is essential for a better future.

The Coding Singularity Is Real — and Steeper Than Clark Presented

New data confirms AI’s rapid coding capabilities and suggests the self-improving loop is accelerating faster than previously estimated, reshaping software development.

The Era of Network States Competing With Nation-States, Predicts a Prominent Web3 Executive.

Pioneering Web3 executives predict a transformative clash between network states and traditional nation-states, raising questions about our future governance landscape. What will this rivalry reveal?

One Video In, a Whole Publishing Kit Out — Without the Cloud

Discover how a single video can generate a complete publishing toolkit offline, boosting privacy, speed, and cost savings without cloud reliance.