Perplexity adds Code Mode to Agent API: JS scripts call tools in parallel, cutting cost up to 53%
AravSrinivas · x · 2026-12-04
Perplexity CEO Arav Srinivas announced Code Mode (programmatictoolcalling) for the Agent API: instead of one JSON tool call per turn, the model writes a short JavaScript script that fans out tool calls in parallel, processes outputs, and returns only what's needed into context.
- Standard tool calling treats the LLM like a slow, expensive for-loop: every search/fetch forces a full round-trip and dumps raw HTML/transcripts/JSON into the context window
- Code Mode moves deterministic glue work (parallel fan-out, branching, dedup, filtering, writing raw files to disk) outside the context window
- Srinivas's OS analogy: LLM as CPU, context as scarce RAM, tools as I/O; QuickJS + execwait moves the agent loop closer to an OS kernel
- All enabled tools (websearch, fetchurl, financesearch, MCP servers, sandbox files, shell) are exposed via a single typed tools. interface
- An earlier June attempt (Search as Code/pplxsdk) ran Python in Linux containers; the new approach embeds a QuickJS WebAssembly runtime directly in the agent loop
Official Soft Recall benchmark: ultra tier with Code Mode hits 89.4% accuracy at $10.30 per task (–53% vs $21.71); xhigh 80.5% at $3.85 (–47%); high 47.7% at $0.38 (+2.9 pts). Same models, better accuracy and lower cost.
Related event: Perplexity Code Mode Cuts Task Costs by Up to 53% While Boosting Accuracy(4 posts)→
More from coding & agent
- Claude Code 2.1.336 changelog: enterprise Admin Console hooks, Bedrock proxy sign-in — ClaudeCodeLog · 2026-12-04
- Analysis of 47,000 Company Disclosures: 100 Vendors Capture 70% of AI Stack Mentions — hrishikamath · 2026-12-04
- GitHub launches public preview of SHA-256 Git repositories, a more secure default-to-be — 0xkarasy · 2026-12-04
- Datadog engineers watch Luna and Claude Opus play RollerCoaster Tycoon — dylan_ebert_ · 2026-12-04
- Claude only reads secondhand page summaries — Elicit's fix: give the model full texts — jungofthewon · 2026-12-04
- "One ephemeral environment per command or test": why median cloud env lifetime is under a minute — charliermarsh · 2026-12-04