Search as code
Traditional search treats retrieval as a monolith: a model issues a query, the search engine runs a predefined pipeline, and the model consumes the processed results. That contract breaks down for agents working on complex, open-ended tasks — it produces coarse context, wastes the model’s domain knowledge, and forces naturally parallel work through a serial interface. Search as Code is Perplexity’s answer: expose the search stack as composable primitives that agents orchestrate through generated code. The agent controls retrieval, ranking, filtering, fan-out, and rendering directly, keeps intermediate state in the runtime instead of model context, and consumes only the information that matters. The Perplexity Search SDK brings this approach to your own agents and applications. It provides the Search API’s real-time ranked web results and query-relevant page snippets as Python primitives, with built-in concurrency, provenance, and checkpointing for retrieval-heavy workflows.Built for agents
The SDK is agents-first: it is designed to be driven by coding agents, not learned from prose documentation. The canonical usage reference is the SDK’s Agent Skill, which covers installation, authentication, the full method surface, workflow patterns, and known pitfalls:pplx-search-sdk Agent Skill
Install this skill into your coding agent and let the agent write the integration.
Related products
- If search is one call inside a broader Perplexity integration, use the Perplexity SDK.
- For other languages, or when you want a plain HTTP contract, use the Search API directly.