📊 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 unveiled a new approach called Search as Code, allowing AI systems to build custom retrieval pipelines dynamically. This innovation aims to improve accuracy and control in AI search, marking a significant step forward in agent-based AI applications.

Perplexity has revealed a new architecture called Search as Code (SaC), designed to revolutionize AI search by enabling models to assemble custom retrieval pipelines in real-time. This approach addresses longstanding limitations in traditional search methods, which are ill-suited for complex, multi-step AI tasks, and could significantly enhance the control and accuracy of AI agents.

On June 1, 2026, Perplexity’s research team published a detailed analysis of SaC, arguing that current search systems are inherently limited by their fixed pipelines, which hinder AI agents from executing complex, multi-step retrieval operations efficiently. SaC replaces monolithic search endpoints with a modular stack of primitives—retrieval, filtering, ranking, and rendering—that are accessible via a Python SDK. The AI model acts as the control plane, generating code that dynamically orchestrates these primitives within a sandbox environment, allowing for tailored, precise retrieval strategies.

Perplexity demonstrated SaC’s potential through a case study targeting high-severity software vulnerabilities (CVEs). Their system achieved 100% accuracy while reducing token usage by 85%, outperforming other systems that scored below 25%. The approach involves a three-stage process: broad fan-out over vendor advisories, refinement via language models, and a verification step that ensures each CVE links correctly to a product and fix. This multi-stage, model-generated code approach enables more efficient and accurate retrieval, especially for complex tasks requiring multiple retrieval operations.

Benchmark tests show SaC leading in four out of five metrics, including WANDR, where it outperformed competitors by 2.5 times, and adding up to 20 points over non-SaC baselines. Even at lower reasoning settings, SaC demonstrated superior cost-performance ratios, indicating its efficiency at scale.

At a glance
reportWhen: announced June 1, 2026
The developmentOn June 1, 2026, Perplexity announced a new architecture called Search as Code, transforming how AI systems perform search by enabling dynamic pipeline assembly.
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 retrieval pipeline tools

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

search as code programming kits

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Implications for AI Search and Agent Control

This development signals a shift toward more flexible, controllable AI search architectures that can adapt to complex, multi-step tasks. By enabling models to generate and execute tailored retrieval pipelines, SaC could dramatically improve the accuracy, efficiency, and reliability of AI agents in real-world applications, from cybersecurity to research automation. It also challenges the dominance of fixed API-based search systems, pushing toward more programmable, code-driven retrieval strategies that leverage the strengths of large language models trained on vast codebases.

Amazon

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search and AI Agent Architectures

Traditional search systems, rooted in the human-era paradigm, rely on fixed pipelines that accept a query and return a static set of results. With the rise of AI agents capable of multi-step reasoning, these systems have become inadequate, prompting research into more dynamic, programmable search architectures. Prior efforts, including the CodeAct framework (ICML 2024) and Anthropic’s MCP, have demonstrated that turning tools into executable code within a sandbox improves agent performance and reduces context overhead. Perplexity’s SaC builds on these ideas by re-architecting its search stack into atomic primitives, allowing models to assemble custom retrieval workflows on the fly. While the concept of code-based tool invocation is not new, SaC’s engineering effort to modularize the search stack is a notable advancement in making such architectures practical at scale.

“Perplexity’s approach to Search as Code represents a significant step toward more flexible and controllable AI search architectures.”

— Thorsten Meyer, AI researcher

Amazon

modular search engine components

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Unconfirmed Aspects and Independent Validation Needed

While Perplexity reports impressive results, some benchmarks, including the WANDR test where SaC performs best, were internally developed and have not yet been independently validated. The comparison involves different models running on different hardware, which complicates direct benchmarking. Additionally, the broader applicability of SaC across diverse tasks remains to be tested outside the specific CVE case study. The claims about cost-efficiency and accuracy improvements, though promising, require further replication and peer review to confirm their robustness and generalizability.

Next Steps for Independent Testing and Adoption

Further validation by independent researchers and industry players is needed to confirm SaC’s advantages. Expect upcoming publications or demonstrations showcasing SaC’s performance on a wider range of benchmarks and real-world tasks. Perplexity may also release open-source components or APIs to facilitate broader adoption and testing. Additionally, the AI community will scrutinize the architecture’s scalability, security, and integration with existing systems, shaping its future development and potential standardization.

Key Questions

How does Search as Code differ from traditional search methods?

SaC enables AI models to generate and execute custom retrieval pipelines dynamically, rather than relying on fixed, monolithic search endpoints. This allows for more precise, context-aware search strategies tailored to complex tasks.

What are the main benefits of SaC according to Perplexity?

SaC offers higher accuracy, reduced token usage, and greater control over retrieval processes, making AI agents more effective at multi-step, complex tasks.

Has SaC been independently validated?

No, the results are currently based on Perplexity’s internal benchmarks and case studies. Independent validation and broader testing are still needed.

Will SaC replace existing search APIs?

It aims to complement or replace fixed APIs by providing more flexible, code-driven retrieval pipelines, especially for complex, multi-step AI tasks.

What is the significance of this development for AI research?

It pushes toward more programmable, controllable AI architectures, potentially transforming how AI agents perform search and retrieval in diverse applications.

Source: ThorstenMeyerAI.com

You May Also Like

PostgreSQL And The OOM Killer: Why We Use Strict Memory Overcommit

PostgreSQL now uses strict memory overcommit settings to reduce the risk of the Linux OOM killer terminating database processes, enhancing stability.

The Co-Founder’s Black Hole — A Structural Read on Jack Clark’s Automated AI R&D Essay

Jack Clark predicts over 60% chance of fully autonomous AI research by 2028, raising concerns about institutional capacity and future unpredictability.

Why PPI Matters More Than Hype in a Coding Display

What truly matters in a coding display is PPI, as it directly impacts clarity and comfort—discover why it’s more than just hype.

AI-Driven Software Design Patterns

AI-driven software design patterns use neural networks and pattern recognition to help…