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, allowing AI systems to construct custom retrieval pipelines dynamically. This development aims to improve large language model performance in multi-step tasks, positioning Perplexity as a leader in search innovation, though the concept is not entirely new.

Perplexity has unveiled a new approach called Search as Code (SaC), allowing AI systems to dynamically assemble search pipelines through code, a move that aims to address limitations in traditional search methods for agent-based AI. This development positions Perplexity as a leader in search innovation, though the core idea has been explored elsewhere.

The core of Search as Code involves replacing the traditional search API with a modular stack of primitives—retrieval, filtering, ranking, and rendering—that the AI model can control and customize in real-time via code. This approach is implemented through a Python SDK, which exposes these primitives as atomic building blocks, enabling the model to generate and execute code that orchestrates search operations.

Perplexity demonstrated SaC’s effectiveness with a case study on identifying and characterizing over 200 high-severity CVEs, achieving 100% accuracy while reducing token usage by 85%, from 288,700 tokens to 42,900. The system’s strategy involved a three-stage process: fan-out over vendor advisories, targeted refinement via an LLM, and a schema-bound verifier to ensure precision. These results suggest that SaC can outperform traditional endpoints by writing bespoke, multi-stage retrieval programs.

Benchmark tests across multiple datasets showed SaC leading on four out of five tests, tying on the fifth, and outperforming other systems by up to 2.5 times on specific tasks. Cost-performance analysis indicated that even lower-reasoning configurations outperformed most rivals at lower costs. However, some results, including the WANDR benchmark, are based on proprietary data not yet independently verified.

At a glance
reportWhen: announced June 1, 2026
The developmentOn June 1, 2026, Perplexity announced a major update to its search architecture, enabling AI agents to assemble retrieval pipelines via code, aiming to enhance multi-step reasoning and control.
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
Amazon

Python SDK for search pipelines

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
Agentic AI Builder Blueprint 2026: Build Practical AI Agents, RAG Apps, MCP Workflows, Automation Systems, Evaluation Pipelines, and Production-Ready LLM Tools Step by Step

Agentic AI Builder Blueprint 2026: Build Practical AI Agents, RAG Apps, MCP Workflows, Automation Systems, Evaluation Pipelines, and Production-Ready LLM Tools Step by Step

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Implications for AI Search and Agent Control

This development signifies a shift in how AI systems handle search, moving from static, monolithic endpoints to flexible, programmable pipelines. By enabling models to generate and execute code that orchestrates search primitives, Perplexity aims to improve control, accuracy, and efficiency in complex, multi-step tasks. This approach could influence future AI architectures, emphasizing adaptability and precise control over retrieval processes, which are critical for scaling agent-based AI applications.

Mastering Tool Calling with Multi-Component Prompting (MCP): Build Modular, Intelligent AI Agents with Real-World Tool Integration, API Function Calling, and Scalable Workflow Automation

Mastering Tool Calling with Multi-Component Prompting (MCP): Build Modular, Intelligent AI Agents with Real-World Tool Integration, API Function Calling, and Scalable Workflow Automation

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search Strategies in AI Agents

The idea of turning tools into executable code for AI agents is not new. The concept was formalized in the 2024 CodeAct paper, which demonstrated higher success rates by integrating code execution into agent workflows. Similarly, in late 2025, Anthropic published research on MCP, emphasizing the benefits of sandboxed code execution and high context reduction. Perplexity’s innovation lies in re-architecting its search stack into atomic primitives, a complex engineering feat that many competitors have yet to replicate. While the core idea of programmable tools is established, the specific implementation of Search as Code in search systems represents a significant technical advancement.

“Perplexity’s Search as Code is a meaningful evolution in how AI systems can control and customize search pipelines dynamically.”

— Thorsten Meyer, AI researcher

LLMs in Enterprise: Design strategies, patterns, and best practices for large language model development

LLMs in Enterprise: Design strategies, patterns, and best practices for large language model development

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Independent Validation and Benchmark Transparency

Many of SaC’s key results, including the WANDR benchmark, are based on proprietary data and have not yet been independently verified. The largest performance margin was demonstrated on a benchmark created by Perplexity itself, raising questions about reproducibility. Additionally, comparisons involving different models and architectures are not fully controlled, leaving some uncertainty about the precise advantages of SaC over existing methods.

Next Steps in Validation and Adoption

Expect independent researchers to attempt replication of SaC’s results, particularly on the proprietary benchmarks. Perplexity may release more detailed technical documentation and open-source components to facilitate validation. Meanwhile, industry observers will watch for broader adoption of programmable search pipelines and integration into existing AI systems, potentially setting new standards for control and efficiency in agent architectures.

Key Questions

How is Search as Code different from traditional search methods?

SaC replaces fixed search endpoints with a modular stack of primitives that the AI can control and assemble via generated code, enabling more flexible, precise, and efficient retrieval strategies.

Is SaC a completely new idea?

The concept of turning tools into executable code for AI control is not new; SaC is a specific implementation that re-architects the search stack into atomic primitives, which is a notable engineering achievement.

Will SaC work with all AI models?

Currently, Perplexity’s implementation uses GPT-5.5, and effectiveness may depend on the model’s reasoning capabilities. Broader applicability will depend on further testing and integration.

What are the main limitations of SaC so far?

Results are still preliminary, with some benchmarks proprietary and unverified independently. The approach also requires sophisticated engineering and may face challenges scaling across diverse tasks.

How might SaC influence future AI development?

SaC could lead to more controllable, efficient, and accurate AI systems by enabling models to generate tailored search pipelines, impacting agent design and retrieval strategies across the industry.

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

So erstellen Sie E-Mail-Betreffzeilen, die bei Google ranken (Featured Snippet Hack) Business

Was ist das Geheimnis, um E-Mail-Betreffzeilen zu erstellen, die in Google-Featured Snippets ranken und Ihr Geschäft fördern? Lesen Sie weiter, um es herauszufinden.

The citation. Why generative engine optimization rewards the same brand on the least stable ground.

Analysis of generative engine optimization (GEO) reveals it favors established brands, with citations decaying quickly and benefiting the same players as traditional SEO.

Why Better Email Engagement Can Support Better Site Behavior Signals

Much better email engagement signals can enhance your site’s authority, but understanding how to leverage this connection can unlock even greater online success.

Schema-Markup für Newsletter: Rich Snippets im PosteingangGeschäft

Die Welt des Schema Markups für Newsletter zu erkunden, eröffnet potente Posteingangs-Funktionen, die Ihr E-Mail-Marketing transformieren können—entdecken Sie, wie Sie Rich Snippets noch heute nutzen können.