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 published a new approach called Search as Code (SaC), allowing AI systems to dynamically assemble search pipelines. While promising, the concept builds on existing ideas, and independent validation is pending.

On June 1, 2026, Perplexity announced the release of Search as Code (SaC), a new framework designed to overhaul how AI systems perform search. This development aims to enable AI agents to dynamically assemble custom retrieval pipelines, moving beyond traditional search models that treat search as a fixed, monolithic process. The announcement underscores Perplexity’s push to improve control, efficiency, and accuracy in AI-driven search operations, which is vital for complex multi-step tasks.

Perplexity’s SaC approach reimagines the search stack as a set of composable primitives—retrieval, filtering, ranking, and rendering—that are accessible via a Python SDK. This allows AI models to generate and execute code that precisely controls how search results are retrieved and processed, rather than relying on static endpoints. The company demonstrated SaC’s effectiveness through a case study involving the identification of over 200 high-severity vulnerabilities, achieving 100% accuracy and reducing token usage by 85% compared to traditional methods.

In benchmark tests, SaC outperformed existing systems on multiple datasets, including the company’s own WANDR benchmark, where it achieved a 2.5× improvement over competitors. These results suggest that SaC enables more efficient, accurate, and adaptable search strategies by allowing AI to craft bespoke retrieval pipelines on the fly. However, the company notes that some of these benchmarks, such as WANDR, are proprietary and have not been independently validated.

At a glance
reportWhen: announced June 1, 2026; currently shipp…
The developmentPerplexity announced on June 1, 2026, that it has developed and is shipping Search as Code, a new framework for AI-driven search pipelines designed to improve control 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
Amazon

Python SDK for search customization

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Implications of Search as Code for AI Search Strategies

This development is significant because it addresses a core limitation of current search systems: the rigidity of fixed pipelines that cannot adapt to complex, multi-step tasks performed by AI agents. By enabling models to generate and execute custom retrieval code, SaC could lead to more precise, context-aware search operations, improving AI’s ability to handle nuanced queries and large-scale information retrieval. It also signals a shift towards more modular, controllable AI architectures that can be tailored to specific use cases, potentially transforming how AI systems interact with data sources.

A Simple Guide to Retrieval Augmented Generation

A Simple Guide to Retrieval Augmented Generation

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search and the Rise of Code-Driven Retrieval

Traditional search systems, inherited from the human era, rely on fixed pipelines that accept a query and return a set of results. Recent advances, including AI-optimized search engines like Perplexity’s own answer engine, have improved relevance but still depend on monolithic endpoints. The idea of using code to orchestrate search operations has been explored in academic research and smaller projects, such as the ICML 2024 CodeAct paper, which demonstrated that models trained on code perform better at executing complex retrieval tasks. Prior efforts like Hugging Face’s smolagents and Cloudflare’s Code Mode have laid the groundwork for turning search tools into programmable APIs. Perplexity’s innovation is to re-architect its entire search stack into atomic primitives, allowing AI models to generate tailored code pipelines, rather than relying on external APIs or static configurations.

“Search as Code fundamentally shifts control from fixed endpoints to dynamic, model-generated pipelines, unlocking new levels of precision and adaptability.”

— Thorsten Meyer, AI researcher at Perplexity

ANCEL AD310 Classic Enhanced Universal OBD II Scanner Car Engine Fault Code Reader CAN Diagnostic Scan Tool, Read and Clear Error Codes for 1996 or Newer OBD2 Protocol Vehicle (Black)

ANCEL AD310 Classic Enhanced Universal OBD II Scanner Car Engine Fault Code Reader CAN Diagnostic Scan Tool, Read and Clear Error Codes for 1996 or Newer OBD2 Protocol Vehicle (Black)

CEL Doctor: The ANCEL AD310 is one of the best-selling OBD II scanners on the market and is…

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 benchmark results, some key claims—such as the 2.5× improvement on WANDR—are based on proprietary benchmarks that have not yet been independently validated. The broader applicability of SaC across different models and real-world scenarios remains to be seen, and some aspects, like state management and multi-turn execution, are still under investigation. Additionally, the approach builds on prior academic work, indicating that SaC is not entirely novel but an engineering advancement in an existing conceptual framework.

Future Validation, Adoption, and Open Benchmarking

Moving forward, independent researchers and industry players will likely scrutinize Perplexity’s claims through replication and testing on open datasets. The company plans to release more detailed technical documentation and possibly open-source components of SaC to facilitate broader adoption and validation. Watch for updates on how SaC performs in diverse environments, its integration into other AI systems, and whether competitors adopt similar programmable search architectures. Further, validation on external benchmarks will be crucial to establish SaC’s effectiveness beyond proprietary tests.

Key Questions

What is Search as Code (SaC)?

SaC is a framework that allows AI systems to generate and execute custom search pipelines by assembling composable primitives—retrieval, filtering, ranking, and rendering—via code, rather than relying on fixed search endpoints.

How does SaC improve search for AI agents?

It enables AI models to control how search results are retrieved and processed dynamically, leading to more precise, context-aware, and efficient retrieval strategies, especially for complex multi-step tasks.

Are the benchmark results from Perplexity independently verified?

No, the reported results are based on proprietary benchmarks, and independent validation is still pending. Caution is advised when interpreting these claims.

Is SaC a completely new idea?

No, the concept of turning tools into code APIs for better control has been explored in prior research and projects. Perplexity’s contribution is in re-architecting its search stack into atomic primitives for the first time at this scale.

What are the next steps for SaC?

Perplexity plans to release more technical details, promote independent testing, and explore broader adoption. Validation on external benchmarks will be key to confirming its effectiveness.

Source: ThorstenMeyerAI.com

You May Also Like

Disk Is the Contract: Inside Threlmark’s Local-First Architecture

Threlmark’s innovative local-first design uses disk-based JSON files as the single source of truth, enabling portable, restartable project management without a database.

Three Days at the Frontier: Washington Suspends Fable 5 and Mythos 5

The US government has suspended access to Anthropic’s Fable 5 and Mythos 5 models amid national-security concerns over a jailbreak demonstration.

Glasspane: When Transparency Itself Becomes the Product

Glasspane introduces role-aware dashboards and AI-driven insights, emphasizing transparency and self-hosting for enterprise infrastructure management.

One Model, a Whole Portfolio: What Ten Days on Fable Mean for a Business Building on Frontier AI

A solo experiment with Anthropic’s Claude Fable 5 shows how one model can manage a diverse business portfolio, but with significant costs and risks.