Perplexity Launches Search as Code for Faster Agent Search
Perplexity introduced Search as Code — a new search architecture for agents.
Instead of the classic loop of tool calls, the model generates Python code that works directly with the search stack.
Available in the Perplexity Agent API and now used by default in Computer.
What this enables:
• Parallel execution of many search queries
• Deduplication of results
• Filtering and merging of data
• Ranking results before they enter the model’s context
According to Perplexity, classic tool calling suffers from high latency, manual execution-flow management, and cluttering the context window with intermediate data.
Search as Code was tested on DSQA, BrowseComp, HLE, WideSearch, and WANDR.
The system either matched or outperformed competitors on all five benchmarks.
On DSQA, it scored 0.871 versus 0.815 for Anthropic’s solution, while the task execution cost was almost half.
An interesting idea. Instead of calling search step by step, the agent first writes a search program and then executes it.