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 (SaC), allowing AI agents to build custom search pipelines dynamically. This development aims to address limitations in traditional search methods, with early results showing significant accuracy and efficiency gains. However, some claims are preliminary, and independent validation is pending.

On June 1, 2026, Perplexity’s research team announced a new approach called Search as Code (SaC), designed to overhaul how AI systems perform search in the agent era. This method enables AI models to construct custom retrieval pipelines dynamically, moving beyond traditional fixed search endpoints. The development could significantly improve AI’s ability to handle complex, multi-step tasks that require multiple retrieval operations, making it a notable advance in AI search technology.

Perplexity’s SaC approach exposes the components of the search stack—retrieval, filtering, ranking, and rendering—as atomic, programmable primitives within a Python SDK. The AI model acts as the control plane, generating code that orchestrates these components in real-time, allowing for tailored search pipelines per task. This contrasts with traditional search APIs, which treat search as a monolithic, fixed process.

The company demonstrated SaC’s effectiveness through a case study involving the identification and characterization of over 200 high-severity vulnerabilities (CVEs). The system achieved 100% accuracy while reducing token usage by 85%. Benchmarks across multiple tests showed SaC outperforming existing systems, including OpenAI’s models, with a 2.5× margin on the WANDR benchmark. These results suggest SaC’s potential to significantly improve search precision and efficiency in AI applications.

Perplexity emphasizes that SaC is not merely wrapping an API but involves a fundamental re-architecture of the search process, enabling models to write and execute code that directly manipulates search primitives. This approach leverages the fact that models are trained extensively on code, making them better suited to orchestrate complex retrieval workflows.

At a glance
reportWhen: announced June 1, 2026
The developmentPerplexity unveiled Search as Code, a new method for AI search systems to assemble retrieval pipelines dynamically, promising enhanced control and performance.
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 builder

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

programmatic search API tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Implications for AI Search and Agent Capabilities

This development matters because it addresses a core bottleneck in AI-powered search: control over retrieval processes. By enabling models to craft custom, multi-stage pipelines, SaC could improve the accuracy, adaptability, and efficiency of AI agents performing complex tasks, such as security vulnerability analysis or enterprise data retrieval. If validated independently, this approach could reshape how search systems are built for AI agents, moving away from static APIs toward dynamic, code-driven pipelines.

However, the claims are still early, and the full impact depends on further validation, wider adoption, and whether other systems can replicate the engineering advancements involved in re-architecting the search stack.

Amazon

search as code SDK

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search Architectures in AI Agents

The idea of turning tools into executable code for AI agents is not new. Prior work, such as the CodeAct framework (ICML 2024), demonstrated that models perform better when orchestrating tools through code rather than predefined tool calls. Similarly, Anthropic’s MCP system (November 2025) showed how turning tools into sandboxed code APIs reduces context size and improves agent performance. Perplexity’s SaC builds on this trend but applies it specifically to search, re-architecting its search stack into composable primitives for the first time at this scale.

While the engineering behind SaC is novel, the conceptual foundation is shared with earlier approaches, emphasizing code-based tool orchestration as a key to scaling agent capabilities. The main difference is the focus on search primitives, which allows for more flexible and precise retrieval workflows.

“Perplexity’s Search as Code represents a significant step forward in how AI systems can dynamically control search processes, potentially transforming agent capabilities.”

— 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 Adoption Challenges for SaC

While early results are promising, independent replication of the benchmarks, especially the proprietary WANDR test, is pending. The comparison involves different models and configurations, raising questions about the robustness of the performance claims. Additionally, the engineering effort required to re-architect search stacks at this level may limit widespread adoption in the near term. It remains unclear how quickly other organizations will adopt or replicate this approach, and whether SaC will scale effectively across diverse applications.

Next Steps for Validation and Integration

Further independent testing and replication are needed to confirm SaC’s performance claims. Perplexity is likely to release more detailed benchmarks and potentially open-source parts of their SDK, enabling broader experimentation. Industry observers will watch for adoption by other AI developers and integration into larger systems. Additionally, research into extending code-based search orchestration to other domains may accelerate, as the approach gains validation.

Key Questions

What is Search as Code (SaC)?

SaC is an approach where AI models dynamically assemble search pipelines by writing and executing code that manipulates search primitives, enabling more flexible and precise retrieval workflows.

How does SaC differ from traditional search methods?

Traditional search treats search as a fixed, monolithic process, while SaC exposes internal components as programmable primitives, allowing models to build custom retrieval pipelines on the fly.

What are the early results of SaC’s performance?

In initial case studies, SaC achieved 100% accuracy on a vulnerability identification task while reducing token usage by 85%, outperforming existing systems in benchmarks.

What are the main challenges facing SaC’s broader adoption?

Validation by independent researchers, the engineering effort to re-architect search stacks, and the need for widespread implementation are key hurdles to adoption.

Will SaC replace existing search APIs?

It is too early to say, but SaC’s approach offers a more flexible and controllable paradigm that could complement or eventually replace traditional fixed search APIs in AI agent systems.

Source: ThorstenMeyerAI.com

This content is for general information only and is not financial, tax or legal advice. Consult a qualified professional for decisions about your money.
You May Also Like

A War Room for Your Next Idea: Inside IdeaClyst

Discover how IdeaClyst provides founders with a local-first, AI-powered war room to validate ideas, simulate debates, and make data-driven decisions securely on their own machine.

Minerva. The opposite path.

Italy’s Minerva project trained from scratch on 2.5 trillion tokens but scored only 4.9% on Italian exams, raising questions about scale and language-specific investment.

Jack Clark Says It Out Loud — Reading the Co-Founder’s 60%/2028 Estimate on Automated AI R&D

Anthropic’s co-founder Jack Clark publicly estimates a 60% chance of autonomous AI R&D by 2028, signaling a major policy stance on AI timelines.