📊 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 (SaC), allowing AI systems to build custom retrieval pipelines dynamically. This innovation aims to improve search control and efficiency for AI agents, with promising benchmark results. However, some claims require independent validation.
Perplexity has introduced Search as Code (SaC), a new framework that allows AI models to assemble custom retrieval pipelines dynamically, rather than relying on traditional fixed search APIs. This development aims to address limitations in current search methods when used by AI agents for complex, multi-step tasks. The announcement underscores a shift toward more flexible, controllable search mechanisms designed specifically for agent-driven AI workflows.
Perplexity’s SaC approach exposes core components of the search stack — such as retrieval, filtering, ranking, and rendering — as atomic, programmable primitives within a Python SDK. The AI model acts as the control plane, generating code that orchestrates these primitives in a sandboxed environment, enabling tailored search pipelines for each task. This design departs from traditional monolithic search endpoints, offering greater control and adaptability.
The company demonstrated SaC’s effectiveness through a case study involving the identification and characterization of over 200 high-severity vulnerabilities (CVEs). In this test, SaC achieved 100% accuracy while reducing token usage by 85%, outperforming non-Perplexity systems that scored under 25%. The process involved a three-stage pattern: broad fan-out over vendor advisories, targeted refinements via an LLM, and a schema-bound verifier to ensure precision. These results suggest that models can generate bespoke, multi-stage retrieval programs instead of repeatedly hitting a single search endpoint.
Benchmark tests across multiple datasets showed SaC leading in four out of five tests, tying for first on a fifth, and surpassing competitors by up to 2.5 times on certain metrics. Cost-performance analyses also indicated that even low-reasoning settings with SaC outperform most rivals at lower costs. These findings highlight the potential for SaC to improve both search accuracy and efficiency in agent-based AI systems.
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.
Monolithic search

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
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.
programmable search primitives
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 and controllable search mechanisms for AI agents, enabling them to adapt retrieval strategies dynamically based on the task. By exposing core search components as programmable primitives, SaC could significantly enhance the precision and efficiency of AI-driven information gathering, especially for complex, multi-step workflows. If widely adopted, this approach may redefine standards for AI search systems, making them more adaptable and capable of handling diverse, high-stakes tasks.
However, the approach’s novelty and effectiveness are still subject to validation. The benchmark results, though promising, are based on proprietary tests and a new, self-authored dataset. The broader AI community will need to verify these claims through independent replication before SaC’s full impact is confirmed.

Introdução à Programação com Python
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Evolution of Search for AI Agents
Traditional search systems, inherited from human-era paradigms, treat search as a fixed pipeline that returns a static set of results for each query. This model sufficed when AI systems made single, isolated queries. However, as AI agents take on more complex, multi-step tasks, the limitations of monolithic search endpoints become apparent, especially in controlling retrieval, filtering, and assembly of information.
The concept of turning search into programmable code is not entirely new. The idea was formalized in the CodeAct paper (ICML 2024), which demonstrated that models trained on extensive codebases can generate more effective retrieval strategies. Similarly, companies like Hugging Face and Cloudflare have developed frameworks for turning tools into executable code, emphasizing the importance of code-based approaches for scalable, flexible AI actions. Prior work by Anthropic and others has shown that embedding tools as APIs within a sandbox environment can significantly reduce context size and improve efficiency.
Perplexity’s innovation lies in re-architecting its own search stack into atomic primitives, a move that requires substantial engineering effort and could be difficult for others to replicate without similar infrastructure.
“Search as Code transforms how AI models control retrieval, enabling bespoke pipelines that adapt to complex tasks.”
— Thorsten Meyer, AI researcher at Perplexity

A Simple Guide to Retrieval Augmented Generation
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Independent Validation and Broader Adoption Unclear
While Perplexity reports impressive benchmark results, these are based on proprietary tests and a new, internally developed dataset. Independent replication by third parties is not yet available, and the performance on broader, real-world tasks remains to be seen. Questions also remain about the scalability of SaC and its integration into existing AI systems, as well as whether other organizations can replicate the engineering effort required to re-architect their search stacks similarly.
Verification, Replication, and Industry Adoption
Next steps include independent validation of SaC’s performance through external benchmarks and real-world use cases. Researchers and industry players will likely test the approach in diverse environments to assess scalability and robustness. Additionally, further development may focus on integrating SaC into broader AI platforms, and Perplexity might release open-source tools or APIs to facilitate adoption. Monitoring how competitors respond with similar innovations will also be key to understanding SaC’s long-term impact.
Key Questions
What is Search as Code (SaC)?
Search as Code is a framework that allows AI models to generate, customize, and execute retrieval pipelines dynamically by assembling atomic search primitives as code, rather than relying on fixed search APIs.
How does SaC improve search for AI agents?
SaC provides greater control and flexibility, enabling AI agents to tailor search strategies on the fly, which can lead to higher accuracy and efficiency in complex, multi-step tasks.
Are the benchmark results from Perplexity confirmed by independent sources?
No, the results are based on proprietary tests. Independent validation is needed to confirm SaC’s performance claims across broader applications.
Can other companies implement similar search architectures?
While technically feasible, re-architecting search stacks into atomic primitives requires significant engineering effort, which may limit immediate adoption outside of organizations with substantial resources.
What are the main challenges remaining for SaC’s adoption?
Key challenges include validation of performance outside of proprietary benchmarks, integration into existing AI workflows, and demonstration of scalability in diverse, real-world scenarios.
Source: ThorstenMeyerAI.com