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.

FOR BUSINESS

Open a free Amazon Business account

Business pricing, bulk buying and tax-exempt orders.

Create a free account

As an affiliate, we earn on qualifying purchases.

TL;DR

Perplexity has published a new approach called Search as Code, allowing AI systems to dynamically assemble search pipelines using code. This method outperforms traditional search models in accuracy and cost-efficiency, but some claims require further validation.

Perplexity has unveiled a new architecture called Search as Code (SaC) that allows AI models to dynamically assemble search pipelines using code, a development that could significantly improve search accuracy and flexibility for AI agents.

On June 1, 2026, Perplexity’s research team published a detailed analysis of Search as Code, proposing a shift from traditional search methods to a modular, code-based retrieval system. This approach exposes the components of the search stack—retrieval, ranking, filtering—as primitives that the AI can assemble on-the-fly, using a Python SDK and sandboxed execution environment.

The core idea is to move away from monolithic search endpoints, which are rigid and limit control, towards a flexible system where models generate code to orchestrate search operations tailored to specific tasks. This enables more precise control over retrieval strategies, especially in complex multi-step tasks requiring hundreds of retrieval operations per minute.

Perplexity demonstrated SaC’s effectiveness through a case study involving the identification of over 200 high-severity vulnerabilities, achieving 100% accuracy while reducing token usage by 85%. They also reported superior results on multiple benchmark tests, outperforming competitors and previous models, especially in cost-performance metrics.

At a glance
reportWhen: announced June 1, 2026
The developmentPerplexity announced a new architecture called Search as Code that enables AI agents to create custom retrieval pipelines, improving search performance.
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

Impact of Search as Code on AI Search Capabilities

This development matters because it introduces a fundamentally more flexible and controllable way for AI systems to perform search tasks. By enabling models to generate and execute custom search pipelines, SaC can improve accuracy, reduce costs, and adapt more quickly to complex, multi-step queries. It signals a potential shift in how AI agents interact with data sources, moving toward more autonomous and precise retrieval strategies.

However, the approach’s novelty and effectiveness are still under scrutiny, and independent validation is needed. If proven robust, SaC could influence future search architectures across AI applications, from cybersecurity to knowledge management.

Amazon

Python SDK for search pipeline development

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background and Prior Developments in AI Search Architectures

Traditional search systems treat search as a fixed pipeline—accept a query, process it, and return results—an approach inherited from the human era of information retrieval. AI systems, especially those used in agents, require more dynamic control to handle complex, multi-step tasks involving hundreds or thousands of retrievals per minute.

Over the past two years, researchers have explored turning tool definitions and retrieval operations into programmable APIs that AI can orchestrate in sandboxed environments. Notable efforts include the 2024 ICML paper on CodeAct and Anthropic’s 2025 MCP framework, both emphasizing code-based execution for improved control and efficiency. Perplexity’s SaC builds upon these ideas by re-architecting its search stack into atomic primitives, enabling more direct, programmable control by AI models.

“Search as Code transforms how AI systems can control retrieval, making search more adaptable and precise.”

— Thorsten Meyer, lead researcher at Perplexity

Upgraded Pipe Center Finder Measure 0.5"& up with 4" Y-Type Pipe Diameter

Upgraded Pipe Center Finder Measure 0.5"& up with 4" Y-Type Pipe Diameter

  • Effortless Pipe Center Finding: Locate pipe centers and mark points easily
  • User-Friendly Operation: Loosen, position, tap to mark
  • Precise Adjustable Protractor: 4-inch Y-type head with dial bubble

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Unverified Claims and Need for External Validation

Many of Perplexity’s benchmark results, including the standout performance on the WANDR test, are based on proprietary or self-authored datasets that have not yet been independently replicated. The comparison between models running on different versions of GPT-5.5 and Opus 4.7 introduces variables that could influence outcomes, making the results suggestive but not conclusive. Additionally, the novelty of the SaC architecture, while technically significant, is not entirely new—similar ideas have been explored in prior research—raising questions about the actual uniqueness of this implementation.

Further validation from third-party researchers and replication of benchmarks are needed to confirm SaC’s advantages and to understand its limitations fully.

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.

Next Steps for Validation and Adoption

Researchers and industry players will likely focus on independently replicating Perplexity’s benchmark results, especially on the proprietary WANDR test. Further development of SaC’s tooling, integration into broader AI systems, and real-world testing in complex applications will determine its practical viability. Perplexity may also release more detailed technical documentation and open benchmarks to facilitate external validation.

Expect ongoing discussions and experiments around code-based retrieval architectures, with potential adoption in domains requiring high control and precision, such as cybersecurity, legal research, and enterprise knowledge management.

LINGO STEM Coding Kit - Build & Code Your Own Backup Sensor for Car - Learn Coding with Step-by-Step Guides - STEM Projects for Ages 13+ Years for Birthdays & Holidays

LINGO STEM Coding Kit – Build & Code Your Own Backup Sensor for Car – Learn Coding with Step-by-Step Guides – STEM Projects for Ages 13+ Years for Birthdays & Holidays

  • Learn Coding Effortlessly: Includes step-by-step guides and visual instructions
  • Unleash Creativity: Build and code your own car backup sensor
  • Build Confidence and Skills: Complete multiple STEM projects with 18+ components

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

What is Search as Code (SaC)?

Search as Code is an architecture proposed by Perplexity that allows AI models to generate and execute custom retrieval pipelines using code, enabling more flexible and precise search operations.

How does SaC improve upon traditional search methods?

SaC exposes search components as programmable primitives, allowing AI to assemble tailored retrieval strategies on-the-fly, which can increase accuracy and reduce costs in complex tasks.

Are Perplexity’s benchmark results independently verified?

No, the results are based on proprietary benchmarks and internal testing. Independent replication is needed to confirm the claims.

Is this approach entirely new?

While the idea of turning search components into code is not new, Perplexity’s implementation of a re-architected, atomic primitives stack is a notable engineering effort, but similar concepts have been explored in prior research.

What are the potential risks or limitations?

The approach’s complexity may introduce new challenges in stability, security, and scalability. Further testing is required to understand these risks fully.

Source: ThorstenMeyerAI.com

COLLEGE MOVE-IN

College move-in / dorm season Picks

As an affiliate, we earn on qualifying purchases.

You May Also Like

Mesh LLM: distributed AI computing on iroh

Mesh LLM introduces a distributed AI computing model on Iroh, enhancing large language model deployment and scalability. Details are still emerging.

Is Mistral Forge The AI Partner That Can Boost Your Efficiency?

An analysis of Mistral Forge, a sovereign AI platform, examining its suitability for high-stakes, specialized enterprise uses and its current market positioning.

Please Don’t Discontinue Gemini 2.5 Flash

Developers and users urge preservation of Gemini 2.5 Flash, amid plans for discontinuation. The issue highlights concerns over legacy software support.

Show HN: Ante, A Coding Agent In A Single Binary That Runs Offline

Ante is a new coding agent packaged as a single binary that operates offline, enabling local AI coding assistance without internet connectivity.