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
Apple Smart Glasses Could Debut at WWDC27, Highlighting Privacy Protection
Bloomberg’s Mark Gurman reports that Apple’s smart glasses, codenamed N50, are slated for a WWDC27 debut in June 2027, with a retail launch expected in autumn 2027. Originally targeted for late this year and early 2027, the device’s release has been
Inside Details Exposed About Next-Gen Gemini: Strained Computing Power, Internal Teams Disagreed on Development Priorities and Resource Allocation
Reports indicate that the launch of Google’s highly anticipated next-generation Gemini model has been pushed back. Internal disagreements over development priorities and resource allocation, combined with limited computing capacity and complex approv
OpenAI Dismisses Growth Slowdown Concerns, Says Multiple Business Units Accelerating
In response to external scrutiny regarding decelerating sales growth and missed internal benchmarks, AI leader OpenAI issued a confident statement on Tuesday, April 28. The company clarified that its consumer products and enterprise services are adva
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
Apple Smart Glasses Could Debut at WWDC27, Highlighting Privacy Protection
Bloomberg’s Mark Gurman reports that Apple’s smart glasses, codenamed N50, are slated for a WWDC27 debut in June 2027, with a retail launch expected in autumn 2027. Originally targeted for late this year and early 2027, the device’s release has been
Inside Details Exposed About Next-Gen Gemini: Strained Computing Power, Internal Teams Disagreed on Development Priorities and Resource Allocation
Reports indicate that the launch of Google’s highly anticipated next-generation Gemini model has been pushed back. Internal disagreements over development priorities and resource allocation, combined with limited computing capacity and complex approv
OpenAI Dismisses Growth Slowdown Concerns, Says Multiple Business Units Accelerating
In response to external scrutiny regarding decelerating sales growth and missed internal benchmarks, AI leader OpenAI issued a confident statement on Tuesday, April 28. The company clarified that its consumer products and enterprise services are adva





Home






