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 dynamically generate and execute retrieval pipelines. This innovation aims to improve accuracy and control in search for AI agents. For related insights, see Search as Code: Perplexity Is Right About the Future. The development is based on their recent research and product release, but broader validation and independent testing are still pending.

Perplexity has unveiled Search as Code (SaC), a new approach that allows AI models to dynamically construct and execute custom retrieval pipelines. Learn more about Search as Code. This development addresses longstanding limitations in traditional search methods, especially for AI agents executing complex, multi-step tasks. The move signals a significant shift toward more flexible, controllable, and precise search mechanisms powered by AI. You might also be interested in code search tools like Semble.

On June 1, 2026, Perplexity’s research team published a detailed analysis and product update demonstrating how their new Search as Code framework improves search accuracy and efficiency. Unlike conventional search APIs that treat retrieval as a fixed, monolithic process, SaC exposes the core components—retrieval, filtering, ranking, and assembly—as atomic primitives within a Python SDK. This enables AI models to generate code that orchestrates these components in real-time, tailored to each specific task.

The core innovation is that models act as the control plane, writing code that orchestrates the search stack in a sandbox environment. This design allows for flexible, multi-stage retrieval strategies, including parallel fetches, regex filtering, and schema validation, which were difficult or impossible to implement with traditional fixed pipelines. Their case study focused on identifying and characterizing over 200 high-severity CVEs, achieving 100% accuracy while reducing token usage by 85%, compared to less flexible systems.

Perplexity reports that SaC outperforms existing systems on four of five benchmark tests, including DSQA, BrowseComp, WideSearch, and their proprietary WANDR benchmark, tying with OpenAI on one. The benchmarks suggest that SaC delivers higher success rates at lower costs, especially in complex reasoning tasks. The approach is built on the premise that code, being a language models are extensively trained on, can serve as a more effective medium for orchestrating search workflows than predefined tool calls or API endpoints.

At a glance
reportWhen: announced June 1, 2026
The developmentPerplexity launched Search as Code, a new framework that enables AI models to build custom search pipelines by writing and executing code, aiming to enhance retrieval control and accuracy.
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
Agentic AI Builder Blueprint 2026: Build Practical AI Agents, RAG Apps, MCP Workflows, Automation Systems, Evaluation Pipelines, and Production-Ready LLM Tools Step by Step

Agentic AI Builder Blueprint 2026: Build Practical AI Agents, RAG Apps, MCP Workflows, Automation Systems, Evaluation Pipelines, and Production-Ready LLM Tools Step by Step

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
FOXWELL NT301 OBD2 Scanner Live Data Professional Mechanic OBDII Diagnostic Code Reader Tool for Check Engine Light

FOXWELL NT301 OBD2 Scanner Live Data Professional Mechanic OBDII Diagnostic Code Reader Tool for Check Engine Light

【Read Fault Codes】About the read code funtion needs to be in the ignition on state and if the…

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 indicates a potential paradigm shift in how AI systems handle search and information retrieval. By enabling models to generate and execute custom code, SaC offers finer control, adaptability, and efficiency, which are critical for complex, multi-step AI tasks. If validated at scale, this approach could influence the design of future AI agent architectures, making them more autonomous and capable of nuanced information gathering.

However, the innovation also raises questions about reproducibility and independent validation, as some of the benchmark results are based on proprietary or self-designed tests. The broader AI community will need to verify these claims through replication and real-world deployment to assess the true impact of Search as Code.

Amazon

retrieval pipeline automation software

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search Methods in AI Agents

Traditional search systems have relied on fixed pipelines that accept a query and return a set of results, a model inherited from the human era of information retrieval. With the rise of AI agents capable of multi-step reasoning, these static methods have proven insufficient for complex tasks requiring dynamic, context-aware search strategies.

In recent years, research has explored turning search into a programmable API, with frameworks like CodeAct (ICML 2024) and Cloudflare’s Code Mode demonstrating that code-based orchestration improves success rates. Similarly, Anthropic’s MCP (2025) showed that turning tools into sandboxed code APIs reduces context overhead and enhances control. Perplexity’s SaC builds on these ideas by re-architecting its search stack into composable primitives, a move that they claim provides a significant engineering advantage and greater flexibility.

“Search as Code fundamentally transforms how AI models interact with retrieval systems, enabling unprecedented control and precision.”

— Thorsten Meyer, Perplexity Research Lead

Amazon

AI model retrieval framework

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Validation and Reproducibility of SaC Results

It is not yet clear whether the impressive benchmark results will hold up in independent testing or real-world deployments. The key benchmarks, including WANDR, are proprietary or self-authored, and some results are based on single runs rather than multiple trials. The comparison between different models and configurations also leaves some ambiguity about the true performance gains attributable solely to SaC.

Further validation by third-party researchers and broader testing across diverse tasks are needed to confirm the robustness and generalizability of SaC’s approach.

Next Steps in Adoption and External Testing

Perplexity is expected to release more detailed documentation and possibly open-source components of SaC for community testing. External researchers and industry players will likely attempt to replicate the results and explore integrating SaC into their own systems. Future updates may include scaling tests, real-world applications, and broader benchmark comparisons to establish the approach’s efficacy and limitations.

Additionally, the AI community will watch for independent validation, potential standardization of code-based search frameworks, and how SaC influences the design of next-generation AI agents.

Key Questions

What is Search as Code (SaC)?

Search as Code is a framework that allows AI models to generate and execute custom search pipelines by writing code, enabling more flexible and controlled retrieval processes.

How does SaC improve over traditional search methods?

SaC exposes search components as primitives that models can orchestrate dynamically, improving accuracy, reducing token usage, and allowing complex multi-step retrieval strategies.

Are the benchmark results from Perplexity independently verified?

No, the results are based on internal or proprietary benchmarks. Independent validation and real-world testing are still needed to confirm performance claims.

Will SaC be available for external developers?

Perplexity has not yet announced open-sourcing SaC, but future releases and documentation are expected to facilitate external testing and integration.

What are the potential limitations of Search as Code?

Potential challenges include verifying the robustness of generated code, managing security in sandbox environments, and ensuring consistent performance across diverse tasks and models.

Source: ThorstenMeyerAI.com

You May Also Like

The Twelve Real Complaints About AI Tools in 2026 — A Reddit, Twitter, and GitHub Synthesis

In 2026, users report twelve major issues with AI tools, highlighting gaps between marketed and actual capabilities, affecting trust and deployment.

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

Discover how to turn a single video into a full publishing kit without relying on the cloud. Save time, protect privacy, and build a professional media presence locally.

Privacy-Friendly Camera Placement (Avoiding Sensitive Areas)

Smart camera placement balances security and privacy by avoiding sensitive areas, but discover the key strategies to achieve this effectively.