📊 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 introduced Search as Code (SaC), allowing AI systems to build custom retrieval pipelines dynamically. This approach shows promising results in accuracy and cost, but independent validation and broader comparison are still needed.

On June 1, 2026, Perplexity’s research team unveiled a new approach called Search as Code (SaC), claiming it significantly improves AI search performance by enabling models to assemble custom retrieval pipelines dynamically, rather than relying on fixed search endpoints. This development aims to address limitations in traditional search systems, especially for complex, multi-step AI tasks. For more context on how search systems are evolving, see Search as Code: Perplexity Is Right About the Future — Just Not First to It.

The core innovation of SaC is to treat search components—retrieval, filtering, ranking, and rendering—as atomic primitives accessible via a Python SDK. The AI model acts as the control plane, generating code that orchestrates these primitives in real-time within a secure sandbox. This contrasts with conventional search APIs, which operate as monolithic, fixed pipelines, limiting flexibility for multi-step, high-volume retrieval tasks.

Perplexity demonstrated SaC’s capabilities through a case study involving 200+ high-severity CVEs. Their system achieved 100% accuracy while reducing token usage by 85%, outperforming other tested systems that scored below 25%. The approach involves a three-stage process: fan-out over vendor advisories, refinement via an LLM, and a schema-bound verifier to ensure precision. Benchmarks across multiple tests (DSQA, BrowseComp, WideSearch, WANDR, HLE) showed SaC leading in four out of five, with performance gains up to 2.5× over competitors.

However, some claims warrant caution. The most significant benchmark—WANDR—was internally developed by Perplexity, raising questions about independent validation. Additionally, the comparison models use different underlying models, complicating direct performance attribution. The conceptual basis of SaC is not entirely new; similar ideas have been proposed in academic papers and industry efforts over the past two years, emphasizing code-based tool integration for agents.

At a glance
reportWhen: announced June 1, 2026
The developmentPerplexity announced a new Search as Code framework on June 1, 2026, aiming to transform AI search capabilities by enabling dynamic, code-based retrieval pipelines.
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
Upgraded Pipe Center Finder, Measure Pipe Diameter, Pipefitter Tools With Centering Head, Measure Pipe Diameter Over 0.5" & up With 4" Y-Type Base and Adjustable Dial Bubble Protractor

Upgraded Pipe Center Finder, Measure Pipe Diameter, Pipefitter Tools With Centering Head, Measure Pipe Diameter Over 0.5" & up With 4" Y-Type Base and Adjustable Dial Bubble Protractor

Effortlessly Find Pipe Centers:This tool is perfect for pipefitters and welders to set center lines, determine angles, locate…

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 components

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Implications for AI Search and Retrieval Strategies

This development signals a shift towards more flexible, programmable search architectures that could enable AI systems to perform complex, multi-step retrieval tasks more accurately and efficiently. If validated externally, SaC could influence how future AI agents are designed, moving away from rigid search endpoints to dynamic, code-driven pipelines. It also underscores the importance of integrating code execution into AI workflows, potentially leading to more robust and adaptable systems.

PC-TECH Compatible with Windows 10 Professional 64 Bit USB With Key. Factory fresh, Recover, Repair and Restore. Key code and USB install Included. Fix PC, Laptop and Desktop. Free Technical Support

PC-TECH Compatible with Windows 10 Professional 64 Bit USB With Key. Factory fresh, Recover, Repair and Restore. Key code and USB install Included. Fix PC, Laptop and Desktop. Free Technical Support

Fresh USB Install With Key code Included

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background on Search and Agent Architectures

Traditional search systems treat retrieval as a simple query-response process, which sufficed for single-query tasks but falters in multi-step, high-volume scenarios. Recent academic and industry efforts have explored turning tool calls into executable code within AI workflows, with papers like ICML 2024’s CodeAct and Anthropic’s MCP highlighting the benefits of code-based tool integration. Perplexity’s innovation lies in re-architecting its search stack into composable primitives, a step beyond merely wrapping external APIs, aiming for more granular control and efficiency in search operations.

“Perplexity’s Search as Code demonstrates a meaningful evolution in how AI can dynamically assemble retrieval pipelines, but independent validation remains essential.”

— Thorsten Meyer, AI researcher

RAG-Driven Generative AI: Build custom retrieval augmented generation pipelines with LlamaIndex, Deep Lake, and Pinecone

RAG-Driven Generative AI: Build custom retrieval augmented generation pipelines with LlamaIndex, Deep Lake, and Pinecone

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Validation and Broader Benchmark Confirmation Needed

While initial results are promising, independent replication of the benchmarks, especially the internally developed WANDR test, has not yet been reported. The performance comparison involves different underlying models, which complicates direct attribution of improvements solely to SaC. Additionally, the full impact of SaC on diverse real-world tasks remains to be seen, as broader testing and peer review are still pending.

Upcoming Validation and Industry Adoption Trials

External researchers and industry players are likely to attempt independent replication of Perplexity’s benchmarks. Further development of SaC’s tooling and integration into broader AI systems is expected, alongside potential collaborations for standardized testing. Monitoring how SaC performs in varied real-world applications will be critical to assessing its long-term impact on AI search strategies.

Key Questions

What is Search as Code (SaC)?

SaC is a framework where AI models generate and execute code to assemble customized search pipelines from modular primitives, enabling more flexible and precise retrieval operations.

How does SaC improve over traditional search methods?

It allows models to dynamically control retrieval, filtering, and ranking processes, reducing token usage and increasing accuracy in complex, multi-step tasks.

Has SaC been independently validated?

No, independent validation of the benchmarks, especially the internally developed ones, has not yet been reported. Caution is advised until further testing is completed.

Is this approach entirely new?

While the concept of turning tool calls into executable code is not new, Perplexity’s specific re-architecture of its search stack into composable primitives is a significant engineering advancement.

What are the potential risks or limitations?

The main concerns include reliance on internal benchmarks, model comparison inconsistencies, and untested performance in diverse real-world scenarios.

Source: ThorstenMeyerAI.com

You May Also Like

Briefro: A Document That Tells the Truth

Briefro introduces an AI-powered document platform that guarantees data integrity by running entirely on local hardware, safeguarding privacy and accuracy.

FreeCAD in the Browser

FreeCAD now offers a browser-based platform, enabling users to access its CAD tools without installation. The development aims to enhance accessibility and collaboration.

Selecting An AI Student Planner: Key Factors To Consider

A new comparison finds that AI workbooks, educator guides and paper planners serve different academic planning needs.

Mobilised, Not Spent: What’s Left Of Europe’s €200 Billion AI Offensive

Europe aims to mobilize €200 billion for AI, but only a fraction is committed, with slow progress and significant uncertainties about actual spending and impact.