📊 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 framework called Search as Code, allowing AI systems to dynamically build search pipelines. This approach aims to improve accuracy and control in AI-driven retrieval, with initial tests showing promising results. The concept builds on existing ideas but re-architects the search stack for better agent performance.

Perplexity announced a new framework called Search as Code (SaC) on June 1, 2026, which enables AI systems to assemble custom search pipelines dynamically in code rather than relying on fixed search endpoints. This development aims to address limitations in traditional search methods, especially for complex, multi-step AI tasks, and could significantly influence how AI agents retrieve and process information.

The core idea behind SaC is to replace the conventional search API, which treats search as a static, monolithic process, with a modular stack of primitives—retrieval, filtering, ranking, and rendering—that can be assembled by an AI model in real-time using a Python SDK. This allows for fine-grained control and customization, enabling models to adapt their search strategies on the fly.

Perplexity demonstrated SaC’s capabilities through a case study involving the identification and characterization of over 200 high-severity vulnerabilities (CVEs). The results showed a 100% accuracy rate while reducing token usage by 85%, compared to less than 25% in comparable systems. The approach involves a three-stage process: broad fan-out over vendor-specific advisories, refinement with an LLM, and a schema-bound verification step, allowing for precise, bespoke retrieval programs rather than repetitive endpoint calls.

Benchmark results indicate SaC outperforms existing systems on four out of five tests, including WANDR, where it achieved a 2.5× performance gain over competitors. Cost-performance analyses suggest SaC operates efficiently even at lower resource settings. However, some results, such as the WANDR benchmark, are based on proprietary data not yet independently verified, raising questions about their generalizability.

At a glance
reportWhen: announced June 1, 2026
The developmentOn June 1, 2026, Perplexity revealed its new Search as Code framework, claiming significant improvements in AI search capabilities and efficiency.
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
Mastering AI Agent Development with OpenAI Agents SDK: From Fundamentals to Enterprise-Scale Agent Systems

Mastering AI Agent Development with OpenAI Agents SDK: From Fundamentals to Enterprise-Scale Agent Systems

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 suggests a shift toward more flexible, programmable search architectures that give AI models greater control over retrieval processes. By enabling models to write and execute their own retrieval pipelines, SaC could improve accuracy, reduce costs, and enhance the ability of AI agents to perform complex, multi-step tasks. It also signals a move away from static APIs toward dynamic, code-based retrieval strategies, potentially setting a new standard in AI search engineering.

Custom Search - Discover more:: A Complete Guide to Google Programmable Search Engines

Custom Search – Discover more:: A Complete Guide to Google Programmable Search Engines

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search Architectures in AI Agents

The idea of turning search into programmable code is not entirely new. Similar concepts appeared in the ICML 2024 CodeAct paper and in Anthropic’s MCP framework published in late 2025, both advocating for embedding tools as executable code within AI workflows. What distinguishes Perplexity’s approach is its re-architecture of the entire search stack into atomic primitives, allowing for more granular control and customization. This shift responds to longstanding challenges in scaling AI agents, especially in multi-hour, multi-step tasks that require extensive retrieval and filtering.

Prior to this, most systems relied on fixed APIs or tool calls, which limited flexibility and increased costs. Perplexity’s innovation is in modularizing the search process itself, making it programmable and adaptable in real time, a step that aligns with broader trends toward code-based AI tooling and agent design.

“Perplexity’s Search as Code re-architects the search stack into composable primitives, enabling models to craft bespoke retrieval pipelines in real time.”

— 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.

Unverified Claims and Limitations of SaC Results

Some of the benchmark results, particularly on the proprietary WANDR test, have not been independently validated, raising questions about their broader applicability. The comparison involving different models (GPT-5.5 and Opus 4.7) also complicates direct attribution of performance gains solely to SaC. Additionally, the full impact of SaC on real-world, multi-hour AI tasks remains to be demonstrated in diverse, uncontrolled environments.

Further, the approach’s scalability and integration into existing AI workflows are still under assessment, and the long-term benefits versus traditional methods are not yet conclusively established.

Next Steps for Adoption and Validation of SaC

Perplexity plans to release more detailed benchmark data and seek independent validation of its results. Industry observers will watch for real-world deployments and integration into broader AI systems to evaluate practical benefits. Additionally, further research is expected to explore how SaC performs across different models and tasks, and whether its modular approach can be standardized for wider adoption.

In the coming months, expect updates on performance metrics, case studies, and potential open-source tools to help other developers implement similar programmable search architectures.

Key Questions

How does Search as Code differ from traditional search methods?

SaC replaces static, monolithic search APIs with a modular stack of primitives that AI models can assemble and control in real time via code, enabling more flexible and precise retrieval strategies.

What are the potential advantages of SaC for AI agents?

SaC can improve accuracy, reduce token usage and costs, and allow AI agents to perform complex, multi-step retrieval and filtering tasks more effectively by customizing search pipelines dynamically.

Are the benchmark results from Perplexity independently verified?

No, some results, particularly on proprietary benchmarks like WANDR, have not been independently validated. Caution is advised in interpreting these claims until further testing is done.

Is this approach entirely new?

The concept of turning tools into executable code for AI is not new and has been explored in recent research and frameworks. Perplexity’s contribution is in re-architecting its search stack into atomic primitives for greater control.

What are the potential challenges for implementing SaC widely?

Challenges include integrating the approach into existing systems, validating performance across diverse tasks, and establishing standards for modular, code-based search pipelines.

Source: ThorstenMeyerAI.com

You May Also Like

Minerva. The opposite path.

Italy’s Minerva-3B, trained from scratch on 2.5 trillion tokens, scores just 4.9% on Italian exams, raising questions about scale vs. quality in sovereign LLMs.

The Frameworks Can’t See the Thing That Matters: A Year of AI-Enabled Cyber Threats

A new report reveals AI’s role in making cyber attackers more dangerous and harder to identify, challenging existing threat assessment methods.

The Machine Economy — Capital-Heavy, Human-Light, Trading With Itself

Analysis of the emerging machine economy where AI-driven firms operate with minimal human involvement, reshaping markets and economic structures.

The Deploy Button Became the Bottleneck — and Cloudflare Just Bought the Build Step

Cloudflare’s acquisition of VoidZero aims to streamline the build-to-deploy process, addressing the shifting software development bottleneck in 2026.