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 announced a new search architecture called Search as Code (SaC), allowing AI models to dynamically build retrieval pipelines. This approach aims to improve accuracy and control in AI search tasks, with early benchmarks showing promising results.

Perplexity has introduced a new search architecture called Search as Code (SaC), which enables AI models to construct custom retrieval pipelines dynamically. This development aims to address limitations in traditional search systems when used in complex, multi-step AI tasks. The announcement highlights a significant shift toward more flexible, code-driven search processes for AI agents, which could influence future search and retrieval strategies across the industry.

On June 1, 2026, Perplexity’s research team published findings advocating for a fundamental redesign of search systems used in AI. The core idea: replace the traditional query-response model with a framework where models generate executable code to orchestrate search primitives such as retrieval, filtering, and ranking. This approach, termed Search as Code (SaC), is built around three layers: the model as the control plane, a sandbox for deterministic execution, and a primitive set called the Agentic Search SDK.

The team demonstrated SaC’s effectiveness through a case study involving the identification and characterization of over 200 high-severity CVEs. The system achieved 100% accuracy while reducing token usage by 85%, outperforming existing systems that scored below 25%. Benchmarks across multiple datasets showed SaC leading in four out of five tests, with significant improvements in cost and efficiency.

Perplexity emphasizes that SaC is not merely an API wrapper but a re-architecture of the search stack into composable, atomic primitives. This allows models to write and execute code that precisely controls search processes, offering greater flexibility and potential for complex, multi-step AI tasks.

At a glance
reportWhen: announced June 1, 2026
The developmentPerplexity’s research team revealed a new search architecture, Search as Code, designed to enhance AI retrieval processes for agent-based tasks, announced on June 1, 2026.
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
ELEGOO Mega R3 Project The Most Complete Ultimate Starter Kit with Tutorial Compatible with Arduino IDE

ELEGOO Mega R3 Project The Most Complete Ultimate Starter Kit with Tutorial Compatible with Arduino IDE

The ELEGOO MEGA2560 complete starter kit includes over 200pcs premium components, and is compatible with Arduino kits

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Implications for AI Search and Retrieval Strategies

The introduction of Search as Code represents a notable shift in how AI systems approach search, moving away from static, monolithic endpoints toward dynamic, programmable pipelines. This can enable AI agents to perform more complex, precise, and context-aware retrieval, improving accuracy and efficiency in high-stakes or multi-step tasks. If widely adopted, SaC could influence the design of future AI systems, making them more adaptable and capable of handling intricate information-seeking behaviors.

However, the approach also raises questions about implementation complexity, scalability, and the need for further independent validation. Its success could redefine standards for search systems in AI, but broader adoption depends on further testing and real-world deployment.

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.

Previous Advances and Conceptual Foundations of Search as Code

The idea of turning tools into executable code for AI agents is not new. Researchers have explored similar patterns, such as the CodeAct framework (ICML 2024), which demonstrated higher success rates by replacing tool calls with code execution. Cloudflare’s Code Mode and Anthropic’s MCP also adopted this paradigm, emphasizing sandboxed code execution to improve control and efficiency.

Perplexity’s innovation lies in re-architecting its search stack into atomic primitives, enabling models to generate tailored retrieval pipelines rather than relying on fixed endpoints. While the conceptual basis is established, the engineering effort to build such flexible, composable systems is significant and distinguishes Perplexity’s approach.

Critics note that the core ideas are convergent with existing research, but the implementation details and architectural re-design are substantial engineering achievements.

“Search as Code allows models to write and execute custom retrieval pipelines, vastly improving control and efficiency.”

— Thorsten Meyer, AI researcher

National Geographic 4-Cylinder Engine Building Kit – 175+ Piece Working Model with Moving Parts, Clear Visible Engine Model, STEM Building Toy with Tools & Learning Guide for Kids

National Geographic 4-Cylinder Engine Building Kit – 175+ Piece Working Model with Moving Parts, Clear Visible Engine Model, STEM Building Toy with Tools & Learning Guide for Kids

BUILD YOUR OWN ENGINE – Assemble a clear 4-cylinder engine model kit with 175+ durable pieces. A fun…

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Unverified Benchmarks and Implementation Challenges

Several aspects of SaC’s performance and practicality remain unconfirmed. The most notable is the benchmark where SaC achieved the largest margin of victory, WANDR, which was developed internally by Perplexity and has not been independently validated. The reliance on proprietary benchmarks raises questions about reproducibility.

Additionally, the comparison involves different models and configurations, with some models running on GPT-5.5 and others on Opus 4.7, complicating direct performance assessments. The scalability and real-world deployment of SaC, especially in large-scale or diverse environments, are still uncertain.

Further independent testing and broader community validation are needed to confirm the robustness and generalizability of SaC’s benefits.

Next Steps for Validation and Adoption of Search as Code

Perplexity is expected to publish more detailed results and possibly open-source components of SaC for peer review. Industry adoption will depend on independent replication of results and demonstration of scalability in real-world applications. Researchers and developers will likely explore integrating SaC into existing systems and testing its performance across diverse tasks.

Further research may focus on automating pipeline generation, managing complexity, and extending the approach to broader search domains. Monitoring how competitors respond and whether similar architectures emerge elsewhere will also be key.

Key Questions

What is Search as Code (SaC)?

Search as Code is an architecture where AI models generate executable code to orchestrate search primitives, enabling dynamic, tailored retrieval pipelines instead of relying on fixed search endpoints.

Why is SaC considered innovative?

It re-architects the search process into composable, atomic primitives, allowing models to write and execute custom retrieval programs, which offers greater flexibility and control for complex AI tasks.

Has SaC been independently validated?

Not yet. Most benchmarks are internal or proprietary, and independent validation is needed to confirm performance claims, especially for the WANDR benchmark which was developed by Perplexity.

What are the potential challenges of implementing SaC?

Challenges include managing system complexity, ensuring scalability, and integrating with existing search infrastructure. Further testing is required to assess real-world deployment feasibility.

How does SaC compare to previous approaches?

SaC builds on existing ideas of turning tools into executable code but distinguishes itself by re-architecting the search stack into modular primitives, enabling models to orchestrate search processes dynamically.

Source: ThorstenMeyerAI.com

You May Also Like

Audio Interfaces for Artists: Inputs, Latency, and What You Actually Need

Just understanding the key features of audio interfaces can transform your music setup—discover what truly matters for your creative process.

The Co-Founder’s Black Hole — A Structural Read on Jack Clark’s Automated AI R&D Essay

Anthropic co-founder Jack Clark predicts over 60% chance of fully automated AI research by 2028, raising concerns about institutional capacity and future risks.

The Bubble Question, Disentangled: 1999 vs 2026 Category by Category

A detailed comparison of AI investment patterns and bubble signals between 1999 dotcom era and 2026, highlighting key differences and implications.

How AI Art Generators Work: A Beginner’s Guide

Curious about how AI art generators transform prompts into images? Discover the fascinating process behind this creative technology.