Perplexity unveils Search-as-Code, letting AI agents build search pipelines autonomously
The traditional blue link list, optimized for human browsing, has become a bottleneck for AI agents striving for efficiency. When handling complex research tasks, AI systems are forced into manual, multi-turn API calls with rigid term adjustments, suffering from architectural inflexibility and context windows cluttered with irrelevant information.
To overcome this, Perplexity introduced a new architecture: Search as Code (SaC). Instead of relying on pre-built monolithic search APIs, this approach lets AI models dynamically construct and execute custom search workflows using Python code.

The Three Core Architecture Layers
Perplexity's SaC architecture is organized vertically into three layers:
Model Layer (Top Layer): Handles complex task comprehension and devises high-level search strategies.
Safety Sandbox (Middle Layer): Offers a secure runtime for code execution, complete with a file system for intermediate state storage.
Intelligent Search SDK (Bottom Layer): Encapsulates atomic operations—retrieval, expansion, filtering, deduplication, re-ranking, and field parsing—into primitive functions, giving generated code component-level access to the search infrastructure.
This design allows AI agents to run parallel queries, programmatically discard irrelevant data, and feed only highly relevant, refined results into the context window—preserving thought continuity in long-form research tasks.
Real-World CVE Vulnerability Research: Performance Boost and Token Reduction
To validate the architecture in practice, Perplexity tested it on a demanding cybersecurity task: tracking 200 critical CVEs released from 2023 to 2025 and accurately extracting official advisories, affected software, and patched versions.

With SaC, the AI model autonomously created a three-stage script: first, it ran parallel, customized searches for different vendors (e.g., Mozilla, Google) based on their announcement formats; then it automatically scanned results, identified missing data, and performed targeted follow-up queries; finally, it used schema validation to ensure complete alignment of vulnerability records.
Results showed the system completed the task using 85% fewer tokens than standard pipelines. Across Perplexity's internal benchmarks (DSQA, BrowseComp, HLE, WideSearch, and the new breadth research benchmark WANDR), SaC topped four out of five, outperforming the old architecture significantly. On WANDR specifically, the relative improvement hit 45%.
Code as the New Operational Layer for AI
Industry reports suggest that writing code is increasingly the default method for AI agents to interact with the physical world. Traditional software follows deterministic instructions, while advanced large models reason in token space. The most powerful systems combine both: they use large models for strategy, leverage deterministic environments for batch processing and filtering, and treat the search infrastructure as an I/O layer.
Currently, the "Search as Code" feature is being rolled out in Perplexity Computer
Related article
U.S. Stocks Hit Historic Milestone as AI and Aerospace Giants Prepare for Trillion-Dollar Debut
Elon Musk, Sam Altman, and Dario Amodei, three titans of the technology sector, are advancing toward initial public offerings for their respective ventures. With SpaceX, OpenAI, and Anthropic—three industry behemoths nearing trillion-dollar valuation
Swedish AI Startup Lovable Eyes $13.2 Billion Valuation After Major Funding Round
As AI-driven coding tools gain traction, Swedish startup Lovable has secured a major funding round. The company aims to raise $3 billion, potentially boosting its valuation to $13.2 billion—double the $6.6 billion recorded last December. Menlo Ventur
Google Tests Remy AI Agent for Gemini as Focus Shifts to User Control
According to Business Insider, Google is testing Remy, a new AI personal agent for Gemini. This tool aims to execute tasks on behalf of users, streamlining both professional workflows and daily routines.Currently, Remy is undergoing testing in an int
Related Special Topic Recommendations
Comments (0)
0/500
The traditional blue link list, optimized for human browsing, has become a bottleneck for AI agents striving for efficiency. When handling complex research tasks, AI systems are forced into manual, multi-turn API calls with rigid term adjustments, suffering from architectural inflexibility and context windows cluttered with irrelevant information.
To overcome this, Perplexity introduced a new architecture: Search as Code (SaC). Instead of relying on pre-built monolithic search APIs, this approach lets AI models dynamically construct and execute custom search workflows using Python code.

The Three Core Architecture Layers
Perplexity's SaC architecture is organized vertically into three layers:
Model Layer (Top Layer): Handles complex task comprehension and devises high-level search strategies.
Safety Sandbox (Middle Layer): Offers a secure runtime for code execution, complete with a file system for intermediate state storage.
Intelligent Search SDK (Bottom Layer): Encapsulates atomic operations—retrieval, expansion, filtering, deduplication, re-ranking, and field parsing—into primitive functions, giving generated code component-level access to the search infrastructure.
This design allows AI agents to run parallel queries, programmatically discard irrelevant data, and feed only highly relevant, refined results into the context window—preserving thought continuity in long-form research tasks.
Real-World CVE Vulnerability Research: Performance Boost and Token Reduction
To validate the architecture in practice, Perplexity tested it on a demanding cybersecurity task: tracking 200 critical CVEs released from 2023 to 2025 and accurately extracting official advisories, affected software, and patched versions.

With SaC, the AI model autonomously created a three-stage script: first, it ran parallel, customized searches for different vendors (e.g., Mozilla, Google) based on their announcement formats; then it automatically scanned results, identified missing data, and performed targeted follow-up queries; finally, it used schema validation to ensure complete alignment of vulnerability records.
Results showed the system completed the task using 85% fewer tokens than standard pipelines. Across Perplexity's internal benchmarks (DSQA, BrowseComp, HLE, WideSearch, and the new breadth research benchmark WANDR), SaC topped four out of five, outperforming the old architecture significantly. On WANDR specifically, the relative improvement hit 45%.
Code as the New Operational Layer for AI
Industry reports suggest that writing code is increasingly the default method for AI agents to interact with the physical world. Traditional software follows deterministic instructions, while advanced large models reason in token space. The most powerful systems combine both: they use large models for strategy, leverage deterministic environments for batch processing and filtering, and treat the search infrastructure as an I/O layer.
Currently, the "Search as Code" feature is being rolled out in
U.S. Stocks Hit Historic Milestone as AI and Aerospace Giants Prepare for Trillion-Dollar Debut
Elon Musk, Sam Altman, and Dario Amodei, three titans of the technology sector, are advancing toward initial public offerings for their respective ventures. With SpaceX, OpenAI, and Anthropic—three industry behemoths nearing trillion-dollar valuation
Swedish AI Startup Lovable Eyes $13.2 Billion Valuation After Major Funding Round
As AI-driven coding tools gain traction, Swedish startup Lovable has secured a major funding round. The company aims to raise $3 billion, potentially boosting its valuation to $13.2 billion—double the $6.6 billion recorded last December. Menlo Ventur





Home






