Perplexity Agent API adds Code Mode: model writes JS to call tools in parallel

AravSrinivas · x · 2026-12-04

Arav Srinivas of Perplexity argues standard tool calling treats the LLM like a slow, expensive for-loop: every search, page fetch, or API call forces a full model round-trip and dumps raw payloads (HTML, transcripts, JSON) into the context window. A wide research task burns dozens of forward passes and fills working memory with raw text just to gather inputs.

Perplexity's Agent API now adds Code Mode (programmatictoolcalling): instead of calling tools one JSON turn at a time, the model writes a short JavaScript script that runs tools in parallel, processes the outputs, and returns only what it needs back into the context.

Related event: Perplexity CEO Explains Code Mode Design Philosophy(4 posts)→

Original post →

More from coding & agent

coding & agent channel →