📊 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 systems to build custom retrieval pipelines dynamically. This approach outperforms traditional search methods in accuracy and cost-efficiency, though some claims require independent validation.

On June 1, 2026, Perplexity’s research team revealed a new approach called Search as Code (SaC), which fundamentally changes how AI systems perform search tasks. This development allows AI models to dynamically assemble retrieval pipelines in code, leading to significant improvements in accuracy and efficiency. The announcement signals a shift toward more flexible, programmable search architectures in the agent era, with potential implications for large-scale AI applications.

Perplexity’s SaC architecture replaces the traditional search paradigm—where a fixed pipeline returns a static result set—with a modular, programmable approach. It exposes retrieval, filtering, ranking, and rendering as atomic primitives within a Python SDK, which models can control and assemble in real-time. This enables AI agents to tailor search strategies to specific tasks, improving control and precision.

The company demonstrated SaC’s effectiveness through a case study focused on identifying and characterizing over 200 high-severity vulnerabilities (CVEs). The system achieved 100% accuracy while reducing token usage by 85%. In benchmark tests, SaC outperformed existing systems on multiple metrics, including a 2.5× improvement on the WANDR dataset, and led in four out of five tests. Cost-performance analysis showed even low-reasoning models benefited from the approach.

While the results are promising, some claims, such as the benchmarks and model comparisons, are based on internal or proprietary tests that have not yet been independently verified. The approach builds on prior work in code-based agent architectures, with similar ideas appearing in academic papers and industry implementations over the past two years.

At a glance
updateWhen: announced June 1, 2026
The developmentPerplexity announced on June 1, 2026, that it has deployed Search as Code, a new architecture for AI-driven search that improves performance by enabling models to assemble retrieval pipelines in code.
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
50 AI Agents Every Developer Must Build: The Complete Guide to Building Scalable, Production-Ready Autonomous Systems with LangChain, LangGraph, and Python

50 AI Agents Every Developer Must Build: The Complete Guide to Building Scalable, Production-Ready Autonomous Systems with LangChain, LangGraph, and Python

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
Pro Tools Perpetual License NEW 1-year software download with updates + support for a year

Pro Tools Perpetual License NEW 1-year software download with updates + support for a year

Full version, permanent License of Avid Pro Tools. Includes 1-Year of software updates and upgrades.

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Implications of Search as Code for AI Search Strategies

The introduction of SaC by Perplexity marks a significant step toward more flexible and controllable AI search systems. By enabling models to compose retrieval pipelines programmatically, this approach could lead to more accurate, cost-efficient, and adaptable AI agents capable of handling complex, multi-step tasks. It also signals a broader trend of moving from static, API-based search towards dynamic, code-driven retrieval architectures, potentially reshaping how AI systems interact with data sources and knowledge bases.

However, the approach’s novelty is partly an evolution of existing ideas, with similar concepts appearing in academic research and other industry projects. The real-world impact will depend on how widely and effectively this architecture is adopted and validated outside of Perplexity’s internal tests.

Amazon

Python SDK for search customization

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search Architectures in AI Development

The concept of using code to orchestrate AI tools and retrieval processes has been emerging over the past two years. Notably, the CodeAct paper (ICML 2024) formalized the idea that agents should generate executable code for their operations, leading to higher success rates. Similarly, in November 2025, Anthropic introduced MCP, which also advocates turning tools into sandboxed code APIs to reduce context load and improve scalability.

Perplexity’s recent innovation lies in re-architecting its search stack into atomic primitives, allowing models to directly control and customize retrieval pipelines dynamically. While the general idea is not entirely new, the engineering effort to rebuild the search stack into composable parts is notable and represents a practical advancement.

“Perplexity’s Search as Code approach fundamentally shifts how AI models interact with search systems, enabling dynamic, task-specific retrieval pipelines.”

— Thorsten Meyer, AI researcher

Amazon

AI retrieval pipeline builder

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Validation and External Verification of SaC Results

While Perplexity reports impressive benchmark results, some claims, such as the 2.5× performance gain on WANDR and the CVE case study, are based on internal tests and proprietary benchmarks. Independent verification and replication of these results are not yet available, raising questions about their generalizability and robustness. Additionally, comparisons involving different models and configurations introduce some uncertainty about the precise benefits attributable solely to SaC.

Upcoming Validation and Broader Adoption of Search as Code

Next steps include independent replication of Perplexity’s benchmark results, broader testing across diverse tasks, and potential integration into commercial AI products. The company may also publish detailed technical documentation and open-source components to facilitate wider adoption. Monitoring how the approach performs outside of controlled experiments will be crucial for assessing its long-term impact.

Key Questions

What is Search as Code (SaC)?

SaC is an architecture where AI models assemble retrieval, filtering, and ranking pipelines dynamically in code, enabling more flexible and precise search strategies.

How does SaC improve over traditional search methods?

It allows models to control and customize the search process in real-time, leading to higher accuracy, lower token usage, and better handling of complex tasks.

Are the benchmark results from Perplexity independently verified?

No, the results are based on internal tests and proprietary benchmarks. Independent validation is still pending.

Is this approach widely adopted yet?

No, it is a recent development announced by Perplexity, and broader industry adoption will depend on further validation and integration efforts.

Does SaC build on existing research?

Yes, similar ideas have been explored in academic papers and other industry projects over the past two years, but Perplexity’s engineering of its search stack is a notable advancement.

Source: ThorstenMeyerAI.com

You May Also Like

Foldable Phones Make More Sense for Some Buyers Than You’d Think

Narrowing the gap between innovation and practicality, foldable phones are becoming increasingly appealing—discover why they might be right for you.

Ambient Invisible Intelligence: How Gadgets Now Anticipate You

Ambient Invisible Intelligence anticipates your needs seamlessly, transforming everyday life in ways you’ll want to uncover.

Public‑Key Cryptography Basics

A basic understanding of public-key cryptography reveals how secure communication and digital trust are built; discover the key concepts and their importance.

The Atlas. What the framework is.

A detailed overview of the Post-Labor Transition Atlas, its empirical basis, structural insights, and implications for AI-driven labor displacement.