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’s research team announced a new method called Search as Code, allowing AI systems to build custom search pipelines dynamically. This approach aims to improve multi-step retrieval tasks, marking a significant development in AI search technology.

Perplexity’s research team has introduced ‘Search as Code’ (SaC), a new approach that allows AI systems to assemble custom search pipelines dynamically in code. This development aims to address limitations in traditional search methods, particularly for AI agents performing complex, multi-step tasks, and signals a significant shift in how search functions within AI systems.

Published on June 1, 2026, the Perplexity research paper argues that conventional search systems treat queries as fixed inputs, which is insufficient for AI agents executing complex workflows. Instead, SaC exposes the search stack—retrieval, filtering, ranking, and rendering—as atomic, composable primitives accessible via a Python SDK. The AI model acts as the control plane, generating code to orchestrate these primitives in real time, enabling tailored retrieval strategies.

The approach is demonstrated through a case study involving the identification and characterization of over 200 high-severity vulnerabilities (CVEs). The SaC system achieved 100% accuracy and reduced token usage by 85%, outperforming traditional systems that scored under 25%. These results suggest that writing bespoke, multi-stage retrieval programs can significantly improve accuracy and efficiency in complex search tasks.

Perplexity emphasizes this is not just a new API but a re-architecture of the search stack, allowing models to reach into and control the search process directly, rather than passively consuming results. The system relies on three layers: the model as the control plane, a sandbox for deterministic execution, and the primitive set for search operations.

At a glance
reportWhen: announced June 1, 2026
The developmentOn June 1, 2026, Perplexity published a research piece proposing Search as Code, claiming it enhances AI search capabilities by enabling dynamic, code-driven retrieval pipelines.
Crypto market snapshot
Fear & Greed Index
18/100 — Extreme Fear
Bitcoin BTC$59,917▼ 0.3%
Ethereum ETH$1,568▼ 0.5%
Tether USDT$0.9986▲ 0.0%
BNB BNB$555.5▼ 1.5%
USDC USDC$0.9997▼ 0.0%
XRP XRP$1.05▼ 0.9%
Solana SOL$70.41▼ 1.8%
TRON TRX$0.322▲ 0.5%
Live data · CoinGecko · alternative.me (24h change)
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 search 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 of Dynamic, Code-Driven Search for AI Development

This development matters because it addresses a core bottleneck in AI search and retrieval: control and flexibility. By enabling models to generate and execute custom search pipelines, SaC could improve the accuracy and efficiency of AI systems handling complex, multi-step tasks. This approach aligns with broader trends toward more autonomous, adaptable AI agents capable of managing their own search strategies, potentially transforming applications in cybersecurity, research, and enterprise data management.

However, the approach also raises questions about reproducibility and independence, as some benchmark results were generated by Perplexity’s own tools, and comparisons across different models are not fully controlled. Still, the engineering effort to re-architect the search stack into composable primitives represents a significant technical advance, with potential long-term impacts on AI system design.

Amazon

search primitives API for AI

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Historical and Technical Background of Search as Code

The concept of using code to orchestrate AI tool use is not new. The idea of turning tools into executable APIs was formalized in the ICML 2024 paper ‘CodeAct,’ which showed higher success rates using code-based tool integration. Similarly, in November 2025, Anthropic published research on ‘code execution with MCP,’ emphasizing the efficiency of turning tools into sandboxed code APIs to reduce context size and improve performance.

Perplexity’s innovation lies in its practical engineering: re-architecting the search stack into atomic primitives that the model can control directly. While the underlying idea is convergent with prior work, their implementation of a fully re-architected, composable search system is a notable engineering achievement that sets their approach apart.

Critics note that the core idea—using code to orchestrate tools—has been explored before, but Perplexity’s contribution is in demonstrating how to build a flexible, integrated search stack that can be controlled dynamically by the model in real time. This approach could influence future AI search architectures, especially for complex, multi-step tasks requiring precise control over retrieval strategies.

“Re-architecting the search stack into composable primitives is a significant engineering step that could redefine how AI systems handle complex retrieval tasks.”

— Thorsten Meyer, AI researcher

Amazon

custom search engine development kit

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Results and Claims Require Independent Verification

Many of the benchmark results, including the prominent CVE case study, were produced internally by Perplexity and have not yet been independently validated. The WANDR benchmark, where SaC showed the largest gains, was designed by Perplexity itself, raising questions about potential bias or overfitting. Additionally, comparisons across different models (GPT-5.5, Opus 4.7) are not perfectly controlled, making the claims suggestive rather than definitive. The broader community awaits independent replication and validation of these results before fully endorsing SaC’s purported advantages.

Next Steps: Independent Testing and Broader Adoption

Going forward, the key developments will involve independent researchers attempting to replicate Perplexity’s benchmark results, particularly on the CVE and WANDR datasets. Perplexity is expected to release more technical details and possibly open-source components of their search stack, enabling broader testing and validation. The company may also explore integrating SaC into commercial products or open standards, potentially influencing future AI search architectures. Meanwhile, the AI community will scrutinize the approach’s scalability, robustness, and applicability across diverse domains.

Key Questions

What exactly is Search as Code?

Search as Code is a method where AI systems generate and execute custom search pipelines in code, allowing dynamic control over retrieval, filtering, and ranking processes rather than relying on fixed search endpoints.

How does SaC improve over traditional search methods?

SaC enables models to tailor search strategies on the fly, potentially increasing accuracy and efficiency in complex, multi-step tasks by building bespoke retrieval programs instead of using static search APIs.

Has SaC been independently validated?

No, most of the results are from Perplexity’s internal tests and benchmarks. Independent validation is still pending, and community efforts are needed to verify the claims.

Is this approach applicable to all AI systems?

While promising, the approach requires re-architecting the search stack into primitives and may not be immediately applicable everywhere. Its scalability and generalizability are still under evaluation.

What are the potential risks or downsides?

Potential risks include overfitting to specific benchmarks, increased system complexity, and challenges in ensuring reproducibility and transparency across implementations.

Source: ThorstenMeyerAI.com

Nothing in this article is financial or investment advice. Cryptocurrency and precious-metal investments carry significant risk — do your own research and consider a licensed advisor.
You May Also Like

Eaton Financial Holdings Company LLC Grows Stock Holdings in Meta Platforms, Inc. $META

Eaton Financial Holdings LLC disclosed a 13.4% increase in its Meta Platforms holdings in Q4, owning 12,917 shares worth over $8.5 million, as per SEC filings.

The Coding Singularity Is Real — and Steeper Than Clark Presented

New data confirms rapid AI progress in coding, suggesting the coding singularity is occurring faster than previously estimated, with broad implications for the industry.

What Are the Merits of a Federal Crypto Reserve Beyond Fleeting Gains?

The merits of a federal crypto reserve extend beyond fleeting gains, hinting at transformative impacts on the economy and global influence that warrant exploration.