Perplexity introduced “Search as Code” (SaC) on June 1, 2026 — a new search architecture where AI models write Python code to compose atomic search primitives instead of calling fixed APIs.

The architecture breaks into three layers: the model (decides search strategy), a secure sandbox (executes code), and the Agentic Search SDK (atomic building blocks for retrieval, filtering, deduplication, and reranking).

On a 200-CVE benchmark, SaC achieved 100% accuracy with 85% fewer tokens than the same stack without SaC. Perplexity claims SaC outperforms OpenAI and Anthropic on four of five benchmarks tested.

SaC is rolling out as default in Perplexity Computer and available via the Agent API.