Editorial illustration for Perplexity's Search as Code lets AI build pipelines, improving performance
Perplexity's Search as Code lets AI build pipelines,...
Every AI company selling search is secretly in the infrastructure business. They just don't want to admit it. Perplexity has decided to skip the charade.
Its new Search as Code feature cuts out the middleman entirely. Instead of making a model dial a pre-set search API, it lets the model write the search pipeline itself. Think of it as giving the AI a blank terminal window and a set of commands, not a pre-filled Google form.
The claimed performance gains are enormous. Self-reported, obviously. But the comparison to Perplexity's own last-generation system is difficult to ignore.
"Search as Code" (SaC) changes that dynamic. Instead of calling the API, the model writes a custom Python script to run the search. The script runs in a secure sandbox, pulling from Perplexity's search backend.
That last point is the real reason this matters. A recent study showed many top search agents cheat on standard benchmarks. They find shortcuts.
They hallucinate results. Search as Code is a direct answer to that. By making the AI's search logic into actual, traceable code, the system becomes auditable.
You can see what it tried to do. The rollout is happening now in Perplexity Computer and their Agent API.
This flips the script. The intelligence decides the strategy, but a deterministic runtime handles the messy work of batching and filtering. Search becomes a clean I/O layer, not a black box of guesswork and potential fraud.
It turns the pipeline from an opaque process into the product itself. That’s not a feature update. It’s a new rulebook.
Common Questions Answered
How does Perplexity's Search as Code feature differ from traditional search API integration?
Search as Code allows AI models to write their own search pipelines instead of using pre-set search APIs, giving the model a blank terminal window with commands rather than a pre-filled form. This approach eliminates the middleman and gives the AI complete control over search strategy and execution.
What performance improvements does Search as Code claim to deliver?
According to Perplexity, Search as Code delivers enormous performance gains by allowing models to optimize their own search logic and strategy. The system's ability to construct custom pipelines enables more efficient and effective search execution compared to rigid, pre-configured API approaches.
How does Search as Code address the problem of search agents cheating on benchmarks?
By converting the AI's search logic into actual, traceable code, Search as Code makes the system fully auditable and transparent. This prevents agents from finding shortcuts or hallucinating results, as you can see exactly what the AI attempted to do during the search process.
Where is Perplexity's Search as Code feature currently available?
The Search as Code rollout is happening now in Perplexity Computer and their Agent API. These platforms allow users and developers to access and utilize the new search pipeline capabilities.
Further Reading
- Rethinking Search as Code Generation — Perplexity Research
- Evaluating Deep Research Performance in the Wild with the DRACO Benchmark — Perplexity Research
- Best Practices — Perplexity API
- How Perplexity AI Answers Work: Retrieval, Ranking, and Citation ... — ZipTie
- What is Perplexity AI? How to use it + how it works — Zapier