📊 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 agents to dynamically build retrieval pipelines. This marks a notable advancement in search technology for AI-driven tasks, though some claims require independent validation.
Perplexity has introduced a new approach called Search as Code (SaC), claiming it significantly improves AI retrieval capabilities. This development aims to address limitations in traditional search methods when used by AI agents executing complex, multi-step tasks. The company asserts that SaC enables models to assemble custom retrieval pipelines dynamically, improving accuracy and efficiency in large-scale information retrieval.
On June 1, 2026, Perplexity’s research team published a detailed explanation of Search as Code, emphasizing a shift from treating search as a fixed endpoint to viewing it as a set of composable primitives. Their approach exposes retrieval, filtering, ranking, and rendering as atomic modules within a Python SDK, which AI models can manipulate by generating and executing code in a sandbox environment. This design allows models to tailor retrieval strategies on the fly, enhancing control and flexibility.
The core claim is that this architecture improves performance in tasks requiring extensive retrieval operations. In a case study involving the identification of over 200 high-severity vulnerabilities, SaC achieved 100% accuracy while reducing token usage by 85%, compared to less sophisticated systems. Benchmark tests across multiple datasets reportedly show SaC outperforming competitors, with notable gains on the WANDR benchmark, where it achieved 2.5 times better results than the next best system.
Perplexity emphasizes that SaC is not merely a new API but a fundamental re-architecture of the search stack, enabling models to write and execute code that controls retrieval processes directly. They claim this approach leads to more precise, efficient, and adaptable search operations, especially for complex multi-step tasks.
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

Hands-On Agentic AI with LangChain, RAG, and Ollama:: Build Modular Local AI Agents, Retrieval Pipelines, Tool-Using Workflows, and Production-Ready Applications
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.
search as code programming SDK
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Implications for AI Search and Retrieval Strategies
This development signals a potential paradigm shift in how AI systems perform search and information retrieval. By enabling models to construct and execute custom retrieval pipelines, SaC could dramatically improve the efficiency and accuracy of AI agents in complex tasks such as cybersecurity analysis, legal research, or scientific discovery. If widely adopted, this approach might redefine the architecture of future AI retrieval systems, emphasizing control, flexibility, and composability over static endpoints.
However, the claims also raise questions about the novelty and replicability of these results. As SaC builds on existing ideas about code-driven agents, its true impact will depend on independent validation and real-world deployment at scale. Still, the engineering effort involved in re-architecting the search stack into atomic primitives is significant and could set a new standard for AI search infrastructure.
AI data retrieval modules
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Evolution of Search in AI and the Rise of Code-Based Approaches
The concept of using code to control AI agent behavior has been developing over the past two years. Notably, the CodeAct paper (ICML 2024) demonstrated that models perform better when they generate executable code to interact with tools, rather than relying solely on tool call formats. Similarly, Anthropic’s MCP system (November 2025) showed that turning tools into sandboxed code APIs reduces context overhead and improves scale.
Perplexity’s Search as Code builds on these ideas but applies them specifically to search stacks, re-architecting the entire search pipeline into composable primitives. While the approach is not entirely new, the engineering effort to embed this into a search system that can be manipulated by models in real-time is a notable advancement. The broader trend indicates a move toward more flexible, code-driven AI systems capable of dynamic tool assembly for complex tasks.
“Perplexity’s Search as Code represents a meaningful step toward more controllable and efficient AI retrieval systems.”
— Thorsten Meyer, AI researcher
custom search pipeline software
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, some claims are based on internal tests and proprietary benchmarks like WANDR, which have not yet been independently validated. The comparison across different models and setups (GPT-5.5 vs. Opus 4.7) introduces potential inconsistencies. Additionally, the novelty of the approach is recognized but not entirely unique, as similar ideas have appeared in recent research and industry projects. It remains unclear how well SaC will perform in diverse, real-world scenarios outside controlled benchmarks.
Independent Testing and Broader Adoption of SaC
Next steps include independent researchers and industry players replicating Perplexity’s benchmarks to verify the claimed performance gains. Broader adoption will depend on how well SaC integrates into existing AI systems and whether its engineering complexity can be justified by tangible improvements. Perplexity may also expand its demonstrations to cover more practical applications, testing the robustness and scalability of the approach in real-world environments.
Key Questions
What is Search as Code (SaC)?
Search as Code is an approach that allows AI models to assemble and execute custom retrieval pipelines by generating code, rather than relying on fixed search endpoints. It exposes retrieval components as primitives that models can manipulate dynamically.
How does SaC improve over traditional search methods?
SaC offers greater control, flexibility, and efficiency by enabling models to tailor retrieval strategies on the fly, reducing token usage, and improving accuracy in complex, multi-step tasks.
Are the benchmark results from Perplexity independently verified?
No, the results are based on Perplexity’s internal tests and proprietary benchmarks. Independent validation is needed to confirm these claims.
Is this approach entirely new?
While the idea of code-driven agents is not new, applying it specifically to search pipelines with this level of re-architecture is a notable engineering achievement by Perplexity. Similar concepts have appeared in recent research and industry projects.
What challenges might SaC face in real-world deployment?
Potential challenges include scalability, integration complexity, and ensuring robustness across diverse applications. Independent testing will be critical to assess its practical viability.
Source: ThorstenMeyerAI.com