Perplexity Launches Search as Code for Faster Agent Search
Perplexity’s Search as Code lets agents generate Python to run parallel queries, dedupe, filter, and rank results—cutting latency and costs on benchmarks.
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.
Comments
Weekly digest
The best of vibe coding, AI agents and open source — once a week, no spam.
Related articles
All articlesHow to Build AI Agent Wrappers: Tools, Memory, Safety & Orchestration
Practical guide to turning LLMs into agents with wrappers: tool execution, memory, context gathering, safety, planning, sandboxes, and multi-agent design.
Charlie Marsh Boosts OpenAI Codex CLI Startup Speed by 25x
Rust and Python developer Charlie Marsh optimized OpenAI Codex CLI startup, achieving a 25x speed increase and near-instant launch.
CodeFormer: AI Face Restoration and Photo Enhancement in Python
CodeFormer restores and enhances faces in old or damaged photos, with colorization, inpainting, and Real-ESRGAN background upscaling. Python tool.