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 systems to dynamically construct retrieval pipelines. Early results show high accuracy and cost efficiency, but independent validation and broader testing are still pending.

Perplexity has introduced a new framework called Search as Code (SaC), which aims to transform how AI systems perform search by enabling them to dynamically assemble custom retrieval pipelines. The company claims this approach significantly improves accuracy and reduces costs, marking a notable shift in AI retrieval strategies. This development is relevant because it addresses fundamental limitations of traditional search methods in the context of AI agents handling complex, multi-step tasks. To see a related project, check out Semble’s code search tool. Learn more about Semble’s code search innovations.

On June 1, 2026, Perplexity’s research team published details of SaC, proposing a shift from treating search as a fixed query-response process to a modular, code-driven approach. SaC exposes core search functions—retrieval, filtering, ranking, and rendering—as atomic components within a Python SDK, allowing AI models to generate and execute tailored pipelines in a sandbox environment. This enables more control over retrieval strategies, especially for multi-step, high-volume tasks.

Perplexity demonstrated SaC’s effectiveness through a case study involving the identification and characterization of over 200 high-severity vulnerabilities (CVEs). According to the company, SaC achieved 100% accuracy while reducing token usage by 85% compared to traditional methods. The system’s multi-stage retrieval process involved querying vendor advisories, refining results with the model, and verifying advisories, leading to highly precise outputs. Benchmark tests show SaC outperforming existing systems on multiple datasets, including WANDR, with up to 2.5× improvement in efficiency.

While these results are promising, some skepticism exists. The primary benchmark where SaC scored highest—WANDR—is internally developed by Perplexity, and independent validation has not yet been published. Additionally, the comparison involves different models and configurations, which complicates direct attribution of improvements solely to SaC. The broader conceptual approach of turning search into executable code is not new; similar ideas have been explored in recent research and by other companies, such as Semble and Hugging Face.

At a glance
reportWhen: announced June 1, 2026
The developmentPerplexity unveiled its Search as Code framework on June 1, 2026, claiming improved retrieval accuracy and efficiency for AI agents.
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
Amazon

Python SDK for search automation

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Implications for AI Search and Retrieval Strategies

The introduction of Search as Code could significantly impact how AI systems perform complex retrieval tasks, especially in high-stakes or multi-step scenarios. By enabling models to control and customize their search pipelines dynamically, SaC may lead to more accurate, efficient, and adaptable AI agents. If validated through independent testing, this approach could redefine best practices in AI-powered information retrieval, reducing costs and improving reliability across applications.

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.

Evolution of Search in AI and the Rise of Modular Approaches

Traditional search systems have relied on fixed pipelines designed for human use, which are less suited for AI agents executing multi-hour, multi-query tasks. Recent developments have seen AI researchers advocate for more flexible, code-driven search architectures. Notably, the idea of turning tools into APIs that can be composed in sandbox environments has gained traction, with companies like Hugging Face and Anthropic publishing similar frameworks in 2024 and 2025. Perplexity’s SaC builds on this trend but emphasizes re-architecting its own search stack into atomic primitives, a complex engineering effort that sets it apart.

Prior to this, Perplexity pioneered AI answer engines that optimized search for single-query responses, but the new framework addresses the limitations of static pipelines in agent scenarios. The broader movement reflects a shift toward more controllable, programmable retrieval systems capable of supporting complex, multi-stage reasoning.

“Turning search into executable code allows models to craft tailored retrieval strategies, promising higher accuracy and efficiency.”

— Thorsten Meyer, AI researcher

Building Production RAG Systems: Vector Databases, Embeddings, and Retrieval Engineering (Production AI Engineering Series)

Building Production RAG Systems: Vector Databases, Embeddings, and Retrieval Engineering (Production AI Engineering Series)

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Validation and Independent Testing of Search as Code

While Perplexity reports promising results, independent validation of SaC’s effectiveness remains pending. The key benchmark, WANDR, was internally developed by the company, raising questions about reproducibility. Comparisons involving different models and configurations also complicate definitive conclusions. It is unclear how SaC performs across broader, real-world datasets or in diverse application contexts, and whether its engineering complexity can be scaled cost-effectively.

Next Steps: External Validation and Broader Adoption

Going forward, independent researchers and industry players will likely attempt to reproduce SaC’s results, especially on publicly available benchmarks. Perplexity may also expand testing to real-world scenarios, assessing scalability and robustness. The company is expected to release more detailed documentation and possibly open-source components, which will facilitate wider adoption and validation. Monitoring how SaC integrates into existing AI workflows will determine its long-term impact.

Key Questions

What is Search as Code (SaC)?

SaC is a framework that allows AI systems to assemble and execute custom search pipelines by generating code, enabling more control over retrieval, filtering, and ranking processes.

SaC enables models to dynamically craft tailored retrieval strategies, leading to higher accuracy and lower token usage, especially for complex, multi-step tasks.

Is SaC a fully proven technology?

Not yet. While early results are promising, independent validation and broader testing are still needed to confirm its effectiveness and scalability.

How does SaC relate to previous research?

The idea of turning tools into executable code for AI agents has been explored in recent papers and frameworks, but Perplexity’s engineering effort to re-architect its search stack into primitives is a notable development.

What are the risks or limitations?

Potential limitations include the complexity of engineering, dependence on proprietary benchmarks, and uncertain scalability outside controlled environments.

Source: ThorstenMeyerAI.com

You May Also Like

Anthropic in talks to acquire workflow automation startup

Anthropic is in negotiations to acquire a workflow automation startup, signaling expansion into automation tools for AI applications.

Capability or Control: The European Enterprise AI Playbook for the AI Act Era

How European companies navigate the AI Act: balancing capability, control, licensing, and jurisdiction for compliance and resilience.

Two Channels: How the Pentagon Just Split Frontier-AI Procurement in Half

The Pentagon has split its AI procurement into two separate channels, placing Anthropic exclusively in a cybersecurity-focused stream, not in the classified network.

OpenEuroLLM. The third path.

OpenEuroLLM, Europe’s pan-European LLM project, faces significant compute resource challenges as it aims to develop multilingual models across 20 organizations.