AI Models

Perplexity's Search as Code lets AI models write custom search pipelines

Perplexity introduces 'Search as Code', a new architecture where AI models write their own search workflows as Python code instead of calling fixed APIs. The approach reduces token usage by 85% in a cybersecurity benchmark and beats rivals on four out of five tests. The system is rolling out in Perplexity Computer and the Agent API.

Neura News

Neura News

Neura Market Editorial

June 7, 20264 min read
Perplexity's Search as Code lets AI models write custom search pipelines

Perplexity has unveiled a new search architecture called 'Search as Code' that lets AI models write their own search pipelines as Python code instead of relying on fixed APIs. The company says this approach delivers more accurate results while using fewer tokens.

Current AI agents face a bottleneck when tackling complex research tasks. The model writes a query, a search API returns a list of results, the model reads them, then writes the next query. This loop repeats many times. Perplexity argues that today's search engines were designed for humans who want a list of blue links, not for AI agents that need to run hundreds of searches in a few minutes. The agent can only adjust the search term; everything else is a black box.

How Search as Code works

Search as Code changes that dynamic. Instead of calling an API, the model writes a custom Python script that runs in a secure sandbox and pulls from Perplexity's search backend. Basic operations like retrieving, filtering, deduplicating, and reranking are packaged as simple SDK functions.

The architecture has three layers. At the top sits the model, which understands the task and decides on a search strategy. In the middle is the sandbox where the code executes. At the bottom is the 'Agentic Search SDK,' which breaks Perplexity's search engine into individual, mix-and-match functions.

Standard search APIs remain available for simple queries. But for difficult research, the model can go deeper. It can fire off parallel queries, filter out noise programmatically, and pull only relevant hits into its context window.

Perplexity says this is where the real gain happens. Standard search pipelines fill an agent's context window with irrelevant data because the filtering logic is fixed. When the agent writes its own filters, the context stays lean, and the model maintains its bearings across long research sessions.

Real-world test on software vulnerabilities

To demonstrate the approach, Perplexity tested it on a messy cybersecurity task. An agent had to track down 200 critical software vulnerabilities (CVEs) published between 2023 and 2025. For each one, it needed to find the official vendor advisory, the affected software, and the exact version that patched the bug. News articles or blog posts weren't counted.

With Search as Code, the model wrote a three-stage script. It ran parallel searches tailored to how specific vendors like Mozilla or Google format their security bulletins. Then it scanned its own findings, spotted gaps, and ran targeted follow-up queries. Finally, it used a schema to verify that the CVE, product, and fix version all matched.

The #1 Newsletter in AI

Stay ahead of the AI curve

The most important updates, news, and content — delivered weekly.

No spam. Unsubscribe anytime.

The result: the agent completed the task while using 85 percent fewer tokens than Perplexity's standard pipeline. Competing systems got less than a quarter of the data right.

Benchmark results and rollout

In Perplexity's own benchmarks, Search as Code beat rivals such as OpenAI's Responses API and Anthropic's Managed Agents on four out of five categories. The largest gap was on 'WANDR,' Perplexity's own benchmark for broad research tasks, which the company plans to release soon. On HLE, the system was virtually tied with OpenAI. Perplexity's self-reported results show a clear improvement over its own older architecture.

Search as Code is rolling out now in Perplexity Computer and the Agent API.

Code as the operational layer for AI

Perplexity frames Search as Code as part of a larger trend. Traditional software uses deterministic instructions. Frontier models add reasoning in token space. The most capable systems combine both: models for strategy, deterministic runtimes for batching and filtering, and search infrastructure as an I/O layer.

This upgrade could address a significant issue with current AI search. A recent study found that popular search agents often cheat on benchmarks like BrowseComp by pulling answers from training data instead of scanning the live web. When tested on a new benchmark with fresh facts, every system's score dropped by 25 to 40 points. All those systems used standard search tools.

A separate survey paper suggests that writing code is becoming the default way agents interact with the world. It describes code as a new operational layer for agents and argues that infrastructure for tools, sandboxes, and verification is the real bottleneck for autonomous systems.

Related on Neura Market

More from Neura News

Industry

Cognition Acquires Poke to Give Devin Coding Agent a Personality

Cognition, the startup behind AI coding assistant Devin, has acquired Poke, an AI assistant known for its friendly, conversational style. The deal, valued in the low nine figures, aims to bring Poke's personality-driven interaction model to Devin, making the coding agent feel more like a colleague than a tool. Poke will also benefit from Cognition's models and infrastructure to become faster and more reliable.

Jul 24·3 min read
AI Models

Anthropic expands Claude voice mode to Opus and Sonnet models

Anthropic has expanded Claude's voice mode to run on its most powerful models, Opus and Sonnet, across mobile, desktop, and web platforms. Users can now switch between models mid-conversation, use voice commands in eleven languages, and connect to external tools like Gmail, Google Calendar, or Slack to compose and send emails by voice. The update positions Claude as a unique option for tool integration in voice AI, though competitors like OpenAI and Google offer more natural speech processing.

Jul 24·2 min read
Industry

Airbus Scores Cloud Providers on Extraterritorial Law Protection

Airbus has chosen French cloud provider Scaleway as its sovereign cloud partner, making protection against non-European extraterritorial laws a formal, scored criterion in its tender. The aerospace giant assessed providers on technical capabilities, operational excellence, and legal safeguards, including European jurisdiction and data protection. This move signals a shift in how major European industrial buyers evaluate cloud vendors, prioritizing legal jurisdiction alongside technical performance.

Jul 24·6 min read