The "blue link list" designed for human browsing is becoming a bottleneck for AI agents to work efficiently. When handling complex research tasks, AI can only perform multi-round, manual workshop-style API calls by rigidly adjusting search terms, facing pain points such as architectural rigidity and context windows being filled with irrelevant information.
To break through this limitation, Perplexity recently launched a new architecture called "Search as Code" (SaC). This technology no longer lets models call ready-made, monolithic search APIs, but instead allows AI models to dynamically build and run custom search workflows in the form of Python code.

Three Core Architecture Layers
Perplexity's SaC architecture is vertically stacked into three layers:
Model Layer (Top Layer): Responsible for understanding complex tasks and developing high-level search strategies.
Safety Sandbox (Middle Layer): Provides a runtime environment for the code and includes a file system for storing intermediate states.
Intelligent Search SDK (Bottom Layer): Packages atomic-level operations such as retrieval, expansion, filtering, deduplication, re-ranking, and field parsing into basic primitive functions, granting generated code component-level access to search infrastructure.
This design enables AI agents to execute queries in parallel, programmatically filter irrelevant information, and extract highly refined relevant results into the context window, ensuring continuity of thought in long-text research tasks.
Real-World Test on CVE Vulnerability Research: Performance Boost and Token Reduction
To verify the performance of this architecture in the real world, Perplexity conducted a test on a complex professional cybersecurity task: tracking 200 critical software vulnerabilities (CVEs) released between 2023 and 2025, and accurately extracting official announcements, affected software, and fixed versions.

With SaC support, the AI model autonomously wrote a "three-stage script": first, running parallel customized searches for different vendors' (such as Mozilla, Google) announcement formats; then automatically scanning results, capturing missing information, and conducting targeted supplementary queries; finally, using Schema validation to ensure complete alignment of vulnerability data.
The test results showed that the system achieved the task with 85% fewer tokens consumed compared to traditional standard pipelines. In Perplexity's own benchmarking sets (including DSQA, BrowseComp, HLE, WideSearch, and the newly introduced breadth research benchmark WANDR), SaC topped four out of five tests, achieving significant performance improvements over the old architecture. Particularly on the WANDR benchmark, the relative improvement reached as high as 45%.
Code Becomes the New Operational Layer for AI
Industry reports indicate that writing code is gradually becoming the default way for AI agents to interact with the physical world. Traditional software relies on deterministic instructions, while cutting-edge large models reason in token space, and the most powerful systems often combine both — that is, using large models to develop strategies, utilizing deterministic environments for batch processing and filtering, and treating the search infrastructure as an input/output (I/O) layer.
Currently, the "Search as Code" feature is being rolled out in
