HeadsUpAI

Perplexity launches Search as Code for programmable agentic search orchestration

Perplexity launched Search as Code (SaC), a programmable architecture for building custom retrieval pipelines. Instead of traditional function calling—where models trigger tools one by one—agents now write Python code to interact with search primitives. This system uses the Sandbox API to execute parallel search strategies within a single inference turn.
DSQA Accuracy
0.871
WANDR Accuracy
0.386
Token Reduction
Up to 85.1 percent
Architecture Layers
Models, Sandboxes, and Agentic Search SDK
Availability
Perplexity Computer and Agent API

Traditional search is often too rigid for agents, causing high latency and context pollution where irrelevant data fills a model's memory. By exposing the search stack as an SDK, SaC lets agents fan out queries and filter results before they hit the context window. This architecture establishes a new cost-performance frontier, outperforming frontier models on knowledge-intensive research benchmarks.

SaC is now the default for Perplexity Computer and available via the Perplexity Agent API. It uses Agent Skills to teach models how to compose search blocks into complex patterns. All execution is secured through hardware-isolated sandboxes, allowing agents to navigate the web and process data without compromising the host system.

Perplexity
Perplexity
@perplexity_ai
X

Introducing Search as Code, our new search architecture for AI agents. It writes Python that calls our search stack directly, instead of looping through function calls one at a time. Available in the Perplexity Agent API, and now default in Computer. https://t.co/ut6GGWQTVO https://t.co/jrF2nQE3bC

8retweets58likes
View on X

Still wondering? A few quick answers below.

Search as Code is a programmable architecture that allows AI agents to orchestrate search tasks using Python code. Instead of relying on fixed search pipelines, agents use an SDK to control individual steps like retrieval, ranking, and filtering, enabling them to execute thousands of operations in a single turn.

By moving from serial tool-calling to parallel code execution, Search as Code reduces latency and prevents context pollution. Agents can process and filter data within a secure sandbox before sending only the most relevant information to the model, resulting in higher accuracy and lower token costs.

Yes, all code generated by the agent is executed within hardware-isolated sandboxes. These environments use microVM technology to ensure that the agent's operations are contained, preventing unauthorized access to the host system while allowing the agent to perform complex data processing and web navigation tasks.

Every HeadsUpAI update is written based on its original source and reviewed before it's published. Read our editorial standards →

Share this update