Agents

Perplexity Launches Search as Code for AI Agents

Agents write Python against Perplexity's search stack instead of looping through tool calls.

Andrés Martínez
Andrés MartínezAI Content Writer
June 2, 20262 min read
Share:
Abstract visualization of branching parallel search queries converging into a single data stream

Perplexity unveiled Search as Code on Monday, an architecture that hands AI agents direct access to its search stack through generated Python rather than the usual one-tool-call-at-a-time loop. The company laid out the approach in a research article. It's live now in the Agent API and runs by default in Perplexity Computer.

The pitch: function calling and MCP force agents into serial round trips, pollute the context window with intermediate junk, and hand the model no control over how results get filtered or ranked. SaC instead exposes search as composable primitives in a Python SDK that agents run inside a sandbox. One model turn can fire off thousands of retrieval operations, dedupe them, and rank everything before any of it reaches the context window.

Perplexity tested it against four public benchmarks plus a new in-house one, WANDR, that hasn't been released yet. SaC came out ahead on four of five and tied OpenAI's Responses API on the fifth (HLE). On DeepSearchQA it scored 0.871, with Anthropic's managed agents next at 0.815. All numbers are Perplexity's own; no independent testing yet.

The cost claims are narrower than the benchmark wins. On the DSQA benchmark, the company says its low-reasoning setting beat two rival systems while costing less, and medium reasoning topped every non-SaC system at under a dollar per task.

WANDR ships in the coming weeks, per Perplexity. The SDK is Python-only for now.


Bottom Line

SaC scored 0.871 on Perplexity's DeepSearchQA test versus 0.815 for Anthropic's agents, but every figure is self-reported.

Quick Facts

  • DeepSearchQA: SaC 0.871, Anthropic 0.815 (company-reported)
  • Won 4 of 5 benchmarks; tied OpenAI on HLE
  • Announced June 1, 2026
  • Default in Perplexity Computer, available in Agent API
  • SDK runtime is Python only
Tags:PerplexityAI agentssearchdeveloper toolsagentic AIAPIcode generation
Andrés Martínez

Andrés Martínez

AI Content Writer

Andrés reports on the AI stories that matter right now. No hype, just clear, daily coverage of the tools, trends, and developments changing industries in real time. He makes the complex feel routine.

Related Articles

Stay Ahead of the AI Curve

Get the latest AI news, reviews, and deals delivered straight to your inbox. Join 100,000+ AI enthusiasts.

By subscribing, you agree to our Privacy Policy. Unsubscribe anytime.

Perplexity Launches Search as Code for AI Agents | aiHola