# Perplexity lets AI agents write code to call its search stack

By Steven Van · 2026-06-06

The "Search as Code" architecture lets developers script multi-step searches in Python instead of chaining repeated function calls.

Perplexity has introduced Search as Code, a new architecture that lets AI agents write Python to call its search stack directly, rather than looping through repeated function calls.

The change is aimed at developers building on [Perplexity](<https://creatorstoolbox.com/tools/perplexity>)'s search infrastructure, letting an agent express a multi-step search as a single script instead of many round trips.

![](<https://pbs.twimg.com/media/HJvxG6jaEAEQj2j.png>)

![Perplexity](<https://www.google.com/s2/favicons?domain=perplexity.ai&sz=128>)

Perplexity

AI-powered answer engine — ask anything and get cited, real-time answers from across the web.

[View Perplexity →](<https://creatorstoolbox.com/tools/perplexity>)

[Read Perplexity lets AI agents write code to call its search stack on Creators Toolbox](<https://creatorstoolbox.com/blog/perplexity-search-as-code>)

---
Canonical source: https://creatorstoolbox.com/blog/perplexity-search-as-code
