TL;DR
Perplexity’s research team published a June 1, 2026 proposal called Search as Code, arguing that AI agents should assemble search pipelines from programmable primitives instead of relying on fixed search endpoints. The approach is backed by Perplexity-reported benchmark gains, but its novelty and real-world advantage outside the company’s tests remain open questions.
Perplexity’s research team published a June 1, 2026 proposal called Search as Code, arguing that AI agents need programmable search systems rather than fixed query-and-results engines, a shift that could affect how future AI products gather and verify information.
The company’s core claim is that conventional search endpoints were built around human-style queries: submit a query, receive a ranked result set, then repeat. Perplexity says that model breaks down when agents perform long-running tasks that may require hundreds or thousands of retrieval operations, filtering passes and verification steps.
Search as Code, or SaC, would expose search functions as atomic primitives through a Python SDK. In Perplexity’s description, an AI model acts as the control plane, writes code to combine those primitives, and runs the program in a sandbox with state across turns. The system can fan out searches, deduplicate results, extract structured records and verify evidence before sending only selected material back into the model’s main context window.
Perplexity reported strong internal results. In a CVE case study, the company said SaC identified and characterized more than 200 high-severity vulnerabilities with 100% accuracy while reducing token use from 288,700 tokens to 42,900. It said rival systems in the same test scored below 25%. Those figures are Perplexity’s reported results, not independent benchmark findings.
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
search engine API development kit
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
programmable search engine API kit
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 pipeline development toolkit
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Agents Need Better Retrieval Control
The proposal matters because agentic AI systems are increasingly judged not only by how well they reason, but by how reliably they gather the right evidence. If agents pull too much raw material into their context windows, costs rise and accuracy can suffer. If they depend on a fixed search pipeline, they may miss task-specific retrieval strategies.
Perplexity’s argument is that code gives agents a more flexible way to manage search work: generate many targeted queries, apply custom filters, preserve intermediate state and verify structured answers before producing a final response. That could be useful for research, compliance, security triage, market monitoring and other workflows where source quality and repeatable evidence matter.
Python SDK for search primitives
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
A Broader Code-Driven Shift
Perplexity is not presenting the idea in a vacuum. The supplied source material points to a wider movement since 2024 toward letting models write executable code rather than only issue one-off tool calls. Related work includes CodeAct, Hugging Face’s smolagents, Cloudflare’s Code Mode and Anthropic’s work on code execution with MCP.
What appears more specific to Perplexity is the search implementation: the company says it has rebuilt parts of the search stack into composable functions rather than simply placing an existing search API inside a shell. That distinction is central to its claim that Search as Code is more than ordinary tool use with a different interface.
“Search as Code”
— Perplexity research team
AI search pipeline programming tools
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Independent Proof Is Still Limited
Several points remain unsettled. The strongest numbers cited in the source material come from Perplexity’s own case study and benchmark suite, including WANDR, which the company introduced. Independent reproduction would be needed to judge whether the reported gains hold across different models, search providers, domains and evaluation methods.
It is also unclear how much of the advantage comes from the SaC architecture itself, how much comes from Perplexity’s underlying search infrastructure, and how much comes from tuning around benchmark tasks. The supplied material frames the core idea as directionally sound but not wholly new.
Benchmarks Will Face Outside Tests
The next test is whether developers and researchers can reproduce similar gains outside Perplexity’s own environment. Watch for third-party evaluations, integrations into agent frameworks, and comparisons against other code-execution approaches from AI labs and infrastructure providers.
If the approach proves durable, search providers may compete less on a single results page and more on programmable retrieval layers built for agents. If the gains narrow under outside testing, Search as Code may be seen as a strong implementation of a broader industry pattern rather than a distinct new category.
Key Questions
What did Perplexity announce?
Perplexity published a research proposal called Search as Code on June 1, 2026. It argues that AI agents should write code to assemble search workflows from smaller retrieval and verification primitives.
Is Search as Code proven to work better?
Perplexity reported major gains in its own tests, including lower token use and higher accuracy in a CVE case study. Those results have not been established here as independently verified.
Is the idea new?
The search-specific packaging appears to be Perplexity’s focus, but the broader pattern of models writing code to control tools has been developing through other projects since at least 2024.
Why would readers care?
If this approach works at scale, AI agents could gather evidence more cheaply, verify answers more reliably and handle long research tasks with less raw data pushed through their context windows.
Source: Thorsten Meyer AI