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 announced a new approach called Search as Code, allowing AI systems to dynamically build retrieval pipelines in code. This method aims to enhance accuracy and efficiency for complex agent tasks, though some claims remain unverified. The development signals a shift toward more flexible, programmable search architectures.

Perplexity has introduced Search as Code (SaC), a novel approach that transforms how AI systems perform search by enabling models to write and execute retrieval pipelines in code. This development aims to address limitations in traditional search methods, especially for complex, multi-step agent tasks, and could significantly improve the precision and control of AI retrieval processes.

The core idea behind SaC is to replace the conventional search API model—where a fixed query returns a static set of results—with a modular, programmable stack. Perplexity’s research team built a search stack into composable primitives accessible via a Python SDK, allowing models to assemble tailored retrieval pipelines dynamically. This includes control over retrieval, filtering, ranking, and rendering, which are traditionally opaque or rigid in standard search systems.

In a case study focused on identifying and characterizing over 200 high-severity CVEs, SaC achieved 100% accuracy while reducing token usage by 85%, compared to other systems that scored under 25%. The pipeline involved multi-stage retrieval, refinement, and verification, demonstrating that models can generate bespoke, multi-step search programs instead of repeatedly calling a single API endpoint. Benchmark tests showed SaC outperforming or tying leading systems on multiple datasets, with notable improvements in cost-efficiency and performance.

While the results are promising, some claims are based on internal benchmarks not yet independently verified, and comparisons involve models running on different versions of GPT. The approach is also an extension of concepts formalized in recent academic papers, emphasizing that SaC is a practical implementation of a broader trend toward code-based agent architectures rather than a wholly original invention.

At a glance
reportWhen: announced June 1, 2026
The developmentOn June 1, 2026, Perplexity unveiled Search as Code, a new framework for AI-driven retrieval that enables models to assemble custom search pipelines dynamically.
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
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.

Implications for AI Search and Retrieval Control

This development could fundamentally change how AI systems perform complex search tasks by granting models the ability to generate and execute custom retrieval pipelines. It enhances control, flexibility, and efficiency, which are critical for scaling agent-based AI in real-world applications such as cybersecurity, research, and enterprise automation. If validated broadly, SaC may accelerate the shift toward programmable, self-adaptive search architectures, reducing reliance on static APIs and improving AI reasoning capabilities.

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

The concept of turning search tools into programmable APIs has been explored in recent research, including the CodeAct framework (ICML 2024) and Anthropic’s MCP system (November 2025). These efforts highlight a broader movement toward integrating code execution within AI workflows to improve scalability and control. Perplexity’s innovation lies in re-architecting its own search stack into atomic, composable primitives, enabling dynamic pipeline assembly—a step beyond previous API-based approaches.

Historically, search has been treated as a simple, fixed interface, but the increasing complexity of AI tasks, especially those involving multi-step reasoning, has exposed its limitations. The recent academic and industry work indicates a convergence toward code-based tools, with Perplexity’s SaC representing a practical, engineering-driven realization of this trend.

“Transforming search into a programmable, modular system allows models to craft tailored retrieval pipelines, significantly improving accuracy and control.”

— Thorsten Meyer, AI researcher

API Phosphate Test Kit Box

API Phosphate Test Kit Box

Phosphate Test Kit Box

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Unverified Claims and Benchmark Limitations

Several key claims, including the performance improvements and benchmark results, are based on internal or proprietary tests not yet independently validated. The most significant benchmark, WANDR, was developed by Perplexity itself, raising questions about potential bias. Additionally, comparisons involve different model versions, complicating direct performance assessments. The broader academic consensus recognizes the potential of code-based search, but widespread adoption and validation are still pending.

Next Steps for Validation and Adoption

Independent researchers and industry players will need to replicate and verify Perplexity’s results, especially on external benchmarks. Broader adoption will depend on the availability of SaC’s SDK and its integration into real-world systems. Future updates may include more comprehensive evaluations, open benchmarks, and demonstrations of SaC’s scalability across diverse applications. Monitoring how competitors respond with similar architectures will also be critical.

Key Questions

What is Search as Code?

Search as Code is an approach where AI models generate and execute custom retrieval pipelines in code, replacing static search APIs with programmable, modular search stacks.

How does SaC improve over traditional search methods?

SaC allows models to dynamically assemble tailored search pipelines, improving control, accuracy, and efficiency for complex, multi-step tasks.

Are the reported results independently verified?

No, the results are based on internal benchmarks and tests by Perplexity; independent validation is still needed.

Is this approach widely available now?

Perplexity has announced SaC, but broader deployment and integration into other systems are still in progress.

Does this mean search engines will become programmable?

Potentially, as the concept supports more flexible, AI-driven search pipelines, but widespread adoption will take time and validation.

Source: ThorstenMeyerAI.com

You May Also Like

Acoustic Dampening, Placement, and the “Rig in the Closet” Setup

Learn how to effectively dampen sound, position your gear, and convert a tiny closet into a quiet, functional workspace with real-world tips and tricks.

What Makes a Laptop Good for AI Workloads?

Just what makes a laptop ideal for AI workloads? Discover the key components that can elevate your AI performance.

The Strange Reason Data Centers Care So Much About Cooling

I never realized how critical cooling is for data centers until I learned the surprising reasons behind their obsession with temperature control.

Incident postmortem builder for managed service providers

A new incident postmortem builder tailored for small MSPs is being tested to streamline post-outage reporting and client communication.