📊 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 build custom retrieval pipelines using code. While promising, the idea is not entirely new, but Perplexity’s implementation is a significant engineering step. The development could impact future AI search strategies.

Perplexity has unveiled a new approach called Search as Code (SaC), designed to give AI models the ability to construct and control search pipelines dynamically. This development aims to address limitations in traditional search methods, especially for complex, multi-step agent tasks, and could significantly alter how retrieval systems are integrated into AI workflows.

On June 1, 2026, Perplexity’s research team published a detailed explanation of Search as Code, proposing a shift from treating search as a fixed API to a modular, programmable stack. The system exposes retrieval, ranking, filtering, and rendering as atomic primitives accessible via a Python SDK, allowing models to generate code that orchestrates search operations tailored to specific tasks.

The core innovation lies in enabling the model to write and execute code within a sandbox environment, giving it more control over search components. This approach contrasts with traditional search APIs, which offer limited flexibility and downstream control. Perplexity claims this method improves both accuracy and efficiency, demonstrated through a case study on identifying high-severity vulnerabilities, achieving 100% accuracy while reducing token usage by 85%.

Benchmark results show SaC leading on multiple tests, including WANDR, where it outperformed competitors by 2.5 times, and improving overall performance by up to 20 points over non-SaC baselines. The company emphasizes that SaC is not just a wrapper but a re-architecture of the search stack into composable parts, allowing for more precise control and customization in retrieval operations.

At a glance
reportWhen: announced June 1, 2026
The developmentPerplexity announced on June 1, 2026, that it is implementing Search as Code, a method for AI systems to dynamically assemble search pipelines, claiming improved accuracy and efficiency.
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
Amazon

Python SDK for search APIs

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Implications of Search as Code for AI Search Strategies

This development signals a potential paradigm shift in how AI systems handle search and retrieval tasks. By enabling models to generate and execute custom search pipelines, Perplexity aims to improve accuracy, control, and efficiency, especially for complex, multi-step tasks common in enterprise and security applications. If widely adopted, SaC could reduce reliance on monolithic search APIs and foster more adaptable, intelligent retrieval systems, influencing future AI assistant design and deployment.

Memory Systems: Cache, DRAM, Disk

Memory Systems: Cache, DRAM, Disk

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Evolution of Search Techniques in AI Systems

The idea of turning tools into code for better control in AI agents is not new. Formalized in the CodeAct paper (ICML 2024), the concept has been shown to improve success rates across multiple models. Cloudflare’s Code Mode and Anthropic’s MCP have also demonstrated similar approaches, emphasizing sandboxed code execution for tool management. Perplexity’s innovation lies in re-architecting its own search stack into atomic primitives, a complex engineering feat that sets it apart from external API wrappers.

While the core idea is established, Perplexity’s specific implementation and performance claims are recent and still require independent verification. Their benchmark results, especially on the proprietary WANDR test, are promising but have yet to be validated by third parties. The broader trend reflects growing interest in programmable, code-driven retrieval systems for AI agents.

“Perplexity’s Search as Code approach is a significant engineering advance, but the core concept of turning search into programmable primitives is not entirely new.”

— Thorsten Meyer, AI researcher

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.

Validation and Independent Replication of SaC Results

While Perplexity reports impressive benchmark results, including a proprietary WANDR test, these claims have not yet been independently verified. The performance on other established benchmarks is promising but less conclusive, and comparisons involve different models and configurations, which complicates direct assessment. The true impact of SaC will depend on further testing and validation by third parties.

Next Steps for Adoption and Validation of Search as Code

Further independent testing and peer review are needed to confirm SaC’s advantages. Industry adoption may follow if results are validated, potentially leading to new standards in AI retrieval systems. Perplexity is likely to continue refining its implementation and share more detailed benchmarks, including open validation of proprietary results. Monitoring community feedback and third-party experiments will be crucial in the coming months.

Key Questions

Is Search as Code a completely new idea?

No, the concept of turning tools into executable code for AI control has been explored in recent research and projects, such as the CodeAct paper (ICML 2024) and Cloudflare’s Code Mode. Perplexity’s contribution is in re-architecting its search stack into atomic primitives for better control.

How does SaC improve search performance?

SaC enables models to generate custom, multi-stage retrieval pipelines, reducing redundant API calls and increasing precision. Perplexity claims this approach improves accuracy and reduces token usage, as demonstrated in their CVE case study and benchmark tests.

Are the benchmark results from Perplexity independently verified?

No, the results are currently proprietary and have not been independently validated. The benchmarks are promising but should be interpreted cautiously until third-party confirmation is available.

Will this approach be adopted widely?

Potentially, if independent validation confirms its advantages, the approach could influence future AI retrieval architectures. Widespread adoption depends on further testing and industry acceptance.

What challenges remain for implementing Search as Code?

Technical challenges include ensuring robustness, security, and scalability of generated code, as well as integrating this approach into existing systems. Validation and standardization will also be important hurdles.

Source: ThorstenMeyerAI.com

You May Also Like

IEEE Rolls Out Large Language Models Training Course

IEEE has announced a new training course focused on large language models, aimed at advancing AI expertise among professionals and researchers.

California launches tracker for AI-related job losses

California has introduced a new online tracker to monitor AI-related job losses, aiming to serve as an early warning system for workforce disruptions.

Apple’s most powerful Macs might be waiting until 2027 for big processor upgrades

Apple plans to delay releasing Pro and Max variants of its next-generation M7 chip until 2027, affecting its high-end Mac lineup and upgrade cycle.

Cursor Introduces Composer 2.5

Cursor introduces Composer 2.5, featuring improved intelligence, targeted reinforcement learning, synthetic data training, and advanced training techniques, marking a significant upgrade.