Search as Code: Perplexity Is Right About the Future — Just Not First to It
AIThis post was created with the assistance of artificial intelligence (AI).

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

Buying for a business?Offer from Amazon

Get business pricing on office and shipping supplies

  • Business-only prices and quantity discounts
  • Tax-exempt purchasing
  • Multiple users, one account, clear invoices
As an affiliate, we earn on qualifying purchases.

TL;DR

Perplexity announced a new method called Search as Code, allowing AI systems to assemble retrieval pipelines dynamically. Early results show promise, but some benchmarks and comparisons need independent validation.

Perplexity has unveiled a new approach called Search as Code (SaC), which allows AI models to dynamically assemble retrieval pipelines using modular primitives. The company claims this method significantly improves search accuracy and reduces token usage, marking a potential shift in how AI agents interact with search systems. This development matters because it could enable more efficient, adaptable, and precise AI-driven information retrieval, especially for complex multi-step tasks.

Perplexity’s SaC approach reimagines search as a set of composable primitives—retrieval, filtering, ranking, and rendering—that the AI model can control by generating and executing code within a sandbox environment. This contrasts with traditional search systems, which treat search as a fixed pipeline returning static results based on a query. The company demonstrated its method on a vulnerability identification task, achieving 100% accuracy while reducing token consumption by 85%, outperforming other systems that scored below 25%. The core idea is that models can craft bespoke retrieval programs, enabling more nuanced and task-specific search strategies.

Perplexity reports that SaC outperforms existing benchmarks on four of five tests, leading in accuracy and cost-efficiency. The approach involves a three-stage process: broad fan-out over vendor advisories, refinement via a language model, and verification through schema-bound filtering. The company emphasizes that SaC is not merely wrapping an API but re-architecting the search stack into atomic, programmable components, allowing the model to reach into the search process directly.

At a glance
reportWhen: announced June 1, 2026
The developmentOn June 1, 2026, Perplexity revealed its Search as Code approach, claiming significant improvements in search 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

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

Implications of Search as Code for AI-driven Search

This development could significantly impact how AI systems perform complex search tasks, especially in environments requiring multi-step retrieval and filtering. By enabling models to build and control their own retrieval pipelines, SaC offers the potential for more precise, efficient, and adaptable search processes. This could improve AI performance in cybersecurity, research, and enterprise applications, where tailored search strategies are critical. However, the approach’s reliance on re-architected search stacks and the early nature of some benchmark results mean broader validation is needed before widespread adoption.

Ninja Foodi DualZone Smart XL Air Fryer, 10 Qt, 6-in-1, Black (DZ550)

Ninja Foodi DualZone Smart XL Air Fryer, 10 Qt, 6-in-1, Black (DZ550)

Shark Pet Cordless Stick Vacuum, Up to 40-Minute Runtime, Lightweight, IX141

Shark Pet Cordless Stick Vacuum, Up to 40-Minute Runtime, Lightweight, IX141

As an affiliate, we earn on qualifying purchases.

Evolution of Search Strategies in AI Agents

Traditional search systems, inherited from human-centric paradigms, process queries through fixed pipelines that return static result sets. Recent research has explored turning search into a programmable API, with approaches like CodeAct (ICML 2024) and Cloudflare’s Code Mode, emphasizing code execution and modular tool use. Anthropic’s MCP also proposed turning tools into sandboxed code APIs to reduce context load and improve scalability. Perplexity’s SaC builds on this conceptual foundation but distinguishes itself by re-architecting its entire search stack into composable primitives, aiming for greater control and efficiency. These developments reflect a broader trend toward making AI systems more autonomous and adaptable in their search behaviors.

“Perplexity’s Search as Code approach redefines the search process, enabling models to craft bespoke retrieval pipelines that could revolutionize AI-driven search tasks.”

— Thorsten Meyer, AI researcher

Validation and Benchmarking Challenges for SaC Claims

While Perplexity reports impressive performance improvements, some benchmarks are proprietary or self-created, raising questions about independent validation. The most significant benchmark, WANDR, is not publicly available for replication, and comparisons involve models running on different architectures, complicating direct evaluation. Additionally, the approach’s novelty is partly conceptual; similar ideas have been explored in recent research, such as CodeAct and MCP, with comparable results. It remains unclear whether SaC’s claimed advantages will hold up under broader testing and real-world deployment.

Next Steps for Validation and Adoption of SaC

Further independent testing and replication of Perplexity’s benchmarks are needed to confirm SaC’s advantages. The company is likely to release more detailed technical documentation and possibly open-source components to facilitate external validation. Industry observers will watch for real-world applications and integration into existing AI systems. As the approach matures, broader adoption will depend on demonstrating scalability, robustness, and clear benefits over traditional search methods in diverse environments.

Key Questions

How does Search as Code differ from traditional search methods?

SaC allows AI models to generate and execute custom retrieval pipelines composed of modular primitives, rather than relying on fixed search endpoints. This enables more flexible, task-specific search strategies.

What are the main benefits claimed by Perplexity for SaC?

Perplexity claims SaC achieves higher accuracy, significantly reduces token usage, and provides greater control over search processes, especially for complex, multi-step tasks.

Are the benchmarks used to evaluate SaC publicly available?

No, some benchmarks like WANDR are proprietary and not publicly accessible, raising questions about independent validation of the results.

Is this approach entirely new?

The idea of turning search into code is not new; similar concepts have been explored in recent research and products. SaC’s innovation is in its re-architected, primitive-based implementation.

What are the potential risks or limitations of SaC?

Risks include reliance on proprietary benchmarks, the need for robust sandboxing to prevent errors, and the challenge of integrating this approach into existing systems at scale.

Source: ThorstenMeyerAI.com

This content is for general information only and is not financial, tax or legal advice. Consult a qualified professional for decisions about your money.
You May Also Like

Boost Efficiency With 12 Top AI Productivity Apps In 2026

Discover the 12 leading AI productivity tools in 2026 that are transforming work, automating tasks, and enhancing decision-making for professionals across industries.

France’s Proposed AI Chatbot Checks: What Developers Should Know

A French expert commission recommends pre-market and recurring checks for consumer AI assistants. Its proposals are not yet law and would largely require EU action.

The Door: Why the Interface Is Worth More Than the Model

SpaceX’s $60 billion purchase of a coding interface highlights the growing importance of the user interface over AI models in distribution and control.

Why A Rude Chat Could Lead To An AI Chatbot Ban

A Cleveland.com headline suggests rude chatbot use could lead to a ban, but the policy, chatbot and stated reason cannot be verified from the available details.