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 create tailored retrieval pipelines. This method aims to improve accuracy and control in search-based AI tasks. While promising, some claims require further independent validation.

Perplexity has introduced a new architecture called Search as Code (SaC), which transforms how AI systems perform retrieval tasks. This development aims to address limitations in traditional search methods by enabling models to assemble custom retrieval pipelines dynamically, improving accuracy and control for complex AI tasks. The announcement highlights a significant shift in search technology, emphasizing the importance of flexible, code-driven retrieval strategies for AI agents.

On June 1, 2026, Perplexity’s research team published a detailed proposal for Search as Code (SaC), a new approach to AI search that moves away from fixed, monolithic search endpoints. Instead, SaC exposes the components of the search process—retrieval, filtering, ranking, and assembly—as atomic primitives within a Python SDK. This allows AI models to generate and execute code that constructs tailored retrieval pipelines on the fly, providing greater control and adaptability.

The core idea is that traditional search systems, which accept a query and return a static set of results, are inadequate for AI agents executing multi-step, high-frequency retrieval tasks. SaC addresses this by enabling models to orchestrate search operations dynamically, improving efficiency and precision. Perplexity demonstrated this approach through a case study involving the identification of over 200 high-severity vulnerabilities, achieving 100% accuracy while reducing token usage by 85%. These results suggest significant improvements in retrieval performance and cost-efficiency compared to existing systems.

While the announcement claims that SaC outperforms previous benchmarks and offers a new standard for AI search, some aspects remain unverified. For example, the most significant performance gains are reported on a proprietary benchmark called WANDR, which has not yet been independently validated. Additionally, comparisons involve different models and configurations, complicating direct attribution of improvements solely to SaC. Critics note that the idea of using code for AI-driven retrieval is not entirely new, citing prior work such as the CodeAct framework and recent publications by other organizations.

At a glance
reportWhen: announced June 1, 2026
The developmentOn June 1, 2026, Perplexity unveiled Search as Code, proposing a new architecture for AI search systems that enables dynamic, code-based retrieval pipelines.
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

Python SDK for AI retrieval pipelines

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

AI search pipeline development tools

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 represents a meaningful evolution in how AI systems perform search tasks. By enabling models to generate executable code that constructs custom retrieval pipelines, this approach offers enhanced control, flexibility, and potential for higher accuracy in complex tasks. For AI developers and organizations, SaC could lead to more efficient, cost-effective retrieval systems capable of handling multi-step, high-volume operations. However, the full impact depends on independent validation of the benchmarks and the adoption of this architecture in broader contexts.

Amazon

custom search engine development kit

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search Architectures and Prior Work

Traditional search systems have relied on fixed pipelines that accept a query and return a static set of results, a model inherited from the human information era. Recent innovations, including AI-optimized search engines like Perplexity’s 2022 answer engine, have improved relevance but still operate within rigid frameworks. The concept of using code to orchestrate retrieval processes has been explored before, notably in the 2024 ICML paper CodeAct and by organizations like Hugging Face and Cloudflare, which developed frameworks for executing search operations via code. In November 2025, Anthropic published work on high-performance tool integration through sandboxed code execution, echoing the principles behind SaC. Perplexity’s contribution lies in re-architecting its own search stack into atomic primitives, a technical achievement that allows deeper customization and control for AI agents.

“Perplexity’s Search as Code approach is a significant step toward giving AI models the ability to dynamically assemble retrieval pipelines, which could revolutionize high-scale AI tasks.”

— Thorsten Meyer, AI researcher

Amazon

AI retrieval system components

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Unverified Claims and Need for Independent Validation

While Perplexity reports impressive results, including 100% accuracy on a proprietary CVE benchmark and leading scores on several tests, these findings are based on internal experiments and specific benchmarks not yet independently verified. The most significant performance gains are on WANDR, a benchmark created by Perplexity, which has not been published or validated externally. Additionally, comparisons involve different models and configurations, raising questions about the direct impact of SaC. Critics also point out that the core concept of using code for AI retrieval has been explored previously, and the novelty of Perplexity’s approach may be overstated.

Independent Testing and Broader Adoption of SaC

Next steps include independent replication of Perplexity’s benchmarks and broader testing of SaC across different models and applications. Open-source implementations or third-party evaluations will be crucial for validating the claimed performance improvements. Additionally, industry adoption will depend on how easily SaC can be integrated into existing AI workflows and whether its benefits outweigh the development effort involved. Perplexity is expected to release more technical details and possibly open-source components to facilitate external validation and adoption in the coming months.

Key Questions

What is Search as Code (SaC)?

Search as Code is an approach where AI models generate and execute code to construct custom retrieval pipelines, replacing static search endpoints with dynamic, programmable search processes.

How does SaC improve AI search performance?

SaC allows models to assemble tailored, multi-stage retrieval programs that can adapt to complex tasks, increasing accuracy and efficiency while reducing token usage and costs.

Is SaC a completely new idea?

No, the concept of using code to orchestrate AI tool and search operations has been explored before, notably in recent research and frameworks like CodeAct and by organizations such as Cloudflare and Anthropic.

What are the main uncertainties about SaC?

Key uncertainties include the independent validation of reported benchmarks, the generalizability of results beyond proprietary tests, and how easily SaC can be adopted in different AI systems.

When will we see broader adoption of SaC?

Broader adoption depends on external validation, technical integration efforts, and whether the demonstrated benefits justify the development and deployment costs. This is expected to unfold over the coming months.

Source: ThorstenMeyerAI.com

You May Also Like

Xbox Game Pass adds updates for Forza Horizon 6, World War Z, and more

Xbox Game Pass has rolled out updates for Forza Horizon 6, World War Z, and additional titles, enhancing gameplay and features for subscribers.

Today’s NYT Connections Hints, Answers and Help for June 27, #1112

Get the latest confirmed hints, answers, and assistance for the NYT Connections puzzle on June 27, 2024, puzzle #1112.

Delvasta: Forms That Build Themselves

Delvasta introduces a platform where forms build themselves using AI and branching logic to improve lead quality and user experience. Early access now available.

AI Is the Alibi. The Reorg Is the Signal.

Coinbase’s recent layoffs and reorg are officially linked to AI, but evidence suggests market pressures and crypto downturns are primary drivers. The reorg signals a shift in work models.