📊 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 approach called Search as Code, allowing AI models to build custom search pipelines dynamically. This innovation aims to improve accuracy and control in retrieval tasks, marking a significant shift from traditional search methods.

Perplexity has unveiled a new framework called Search as Code (SaC), designed to transform how AI systems perform search tasks by enabling models to assemble retrieval pipelines dynamically. This development aims to address limitations in traditional search approaches, especially for complex, multi-step AI agent operations.

The core idea behind SaC is to move away from treating search as a fixed API or endpoint, instead exposing search components—retrieval, filtering, ranking, and rendering—as atomic, programmable primitives. These primitives are accessible via a Python SDK, allowing models to generate and execute code that customizes search pipelines on the fly.

Perplexity demonstrated SaC’s potential through a case study involving the identification and characterization of over 200 high-severity vulnerabilities (CVEs). They reported 100% accuracy and an 85% reduction in token usage compared to traditional methods, outperforming other systems significantly. The approach involves a three-stage process: fan-out over vendor-specific templates, targeted refinements via language models, and a schema-bound verifier to ensure precision.

Benchmark tests across multiple datasets also favored SaC, with the system leading in four out of five tests, and achieving a 2.5× improvement over competitors on the WANDR benchmark. These results suggest that the approach offers both higher accuracy and cost efficiency, especially in complex retrieval scenarios.

At a glance
reportWhen: announced June 1, 2026
The developmentOn June 1, 2026, Perplexity revealed its new Search as Code framework, claiming significant performance improvements and a novel architecture for AI-driven search.
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
Python 50 ft. No Spill Clean & Fill w Hook & 24" Extended Length Gravel Tube Bundle

Python 50 ft. No Spill Clean & Fill w Hook & 24" Extended Length Gravel Tube Bundle

The Python 50 ft. No Spill Clean & Fill w/ Python Hook & 24" Extended Length Gravel Tube…

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 signals a shift toward more flexible, controllable search architectures for AI agents, enabling them to perform complex, multi-step retrieval tasks with higher precision. It challenges the traditional search paradigm, which relies on fixed pipelines and limits the model’s ability to tailor search strategies dynamically.

By exposing search components as programmable primitives, SaC allows models to adapt retrieval strategies in real-time, potentially improving performance in applications like cybersecurity, legal research, or scientific discovery. It also aligns with broader trends toward code-based control of AI systems, emphasizing transparency and customizability.

World's Best Artist

World's Best Artist

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search Architectures for AI Agents

The idea of replacing static search APIs with code-driven retrieval methods is not entirely new. Similar concepts have been explored in academic research, such as the CodeAct framework (ICML 2024) and the work by Anthropic on MCP (November 2025). These approaches leverage the natural coding ability of large language models to dynamically orchestrate retrieval and filtering processes, achieving higher success rates in complex tasks.

Perplexity’s innovation lies in re-architecting its own search stack into atomic, composable primitives, a move that requires significant engineering effort and represents a step beyond merely wrapping external APIs. While the conceptual foundation is established, practical implementation at scale remains an ongoing challenge for the industry.

“Search as Code transforms the retrieval process from a monolithic endpoint into a flexible, programmable pipeline, enabling models to tailor search strategies dynamically.”

— Thorsten Meyer, AI researcher at Perplexity

Amazon

programmable search engine components

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Unverified Claims and Benchmark Limitations

Some results, particularly the WANDR benchmark improvements, are based on proprietary tests that have not yet been independently replicated. The benchmarks where SaC shows the largest gains are either self-authored or not fully published, raising questions about reproducibility. Additionally, the comparison involves different models (GPT-5.5 versus Opus 4.7), which complicates direct attribution of performance gains solely to SaC.

Further validation from independent research and wider industry testing is needed to confirm these claims and assess scalability across diverse applications.

Next Steps for Industry Adoption and Validation

Expect further independent testing and peer review of Perplexity’s SaC approach, especially regarding the proprietary benchmarks. Industry players may begin experimenting with code-based search pipelines, either inspired by SaC or developing similar architectures. Perplexity is likely to release more detailed technical documentation and open-source components to facilitate broader adoption.

Monitoring how these techniques perform in real-world, multi-domain scenarios will be critical to understanding their practical impact and limitations.

Key Questions

What is Search as Code (SaC)?

SaC is an approach that transforms traditional search into a programmable, modular process, allowing AI models to assemble and execute custom retrieval pipelines dynamically using code.

How does SaC improve over traditional search methods?

SaC offers greater control, flexibility, and efficiency by enabling models to tailor search strategies in real-time, reducing token usage and increasing accuracy in complex retrieval tasks.

Is this approach widely validated yet?

Not fully. While initial results are promising, independent replication and testing across diverse applications are still pending to confirm its effectiveness and scalability.

Will other companies adopt similar architectures?

It’s likely. The concept aligns with broader trends toward code-driven AI control, and industry players are exploring similar ideas, though implementation at scale remains challenging.

What are the main challenges ahead?

Scaling the architecture, ensuring reproducibility of benchmark results, and integrating these systems into existing workflows are key hurdles for wider adoption.

Source: ThorstenMeyerAI.com

You May Also Like

New arXiv policy: 1-year ban for hallucinated references

arXiv introduces a new policy banning authors for one year if their submissions contain hallucinated references, aiming to improve research integrity.

The queue. Why the grid, not the chip, is the binding constraint on AI.

A new analysis argues AI growth is being limited less by chips than by power access, interconnection delays and grid capacity.

Mac vs GPU Tower for Local LLMs: The Heat-and-Noise Tradeoff

Comparing Mac Studio and GPU towers for local large language models, focusing on heat, noise, capacity, and performance tradeoffs.

Before You Buy a 3D Printer, Read This Reality Check

What you need to know before buying a 3D printer could save you time and money—discover the essential reality check you can’t afford to miss.