AI觉醒星球
Awakening is here
Knowledge File / AI技能杠杆
2026-06-07 0 浏览 会员

趋势解读:Perplexity's "Search as Code" lets AI models write,评估 LLM Agent 表现

Perplexity推出"Search as Code"新架构,让AI模型编写Python脚本来执行搜索,而非调用固定API,在复杂研究任务中可降低85%的token使用量,并显著提升准确率。

SOURCE / AI技能杠杆 MIN / 9 ACCESS / 会员 POST / 2026-06-07 18:28:33

原贴

查看原文
作者:Jonathan Kemper 来源站点:the-decoder.com 原贴时间:

原文

Instead of calling a ready-made search API, models in Perplexity's new "Search as Code" architecture write their own search workflows as Python code. The company promises more precise results and lower token usage. Anyone who's watched an AI agent tackle a complex research task has seen the same pattern. The model writes a query, a search API returns a list of results, the model reads them, and then writes the next query. This loop repeats, often many times in a row. Perplexity calls this a bottleneck in a new technical report. Today's search engines were built for humans who want a neat list of blue links, but for an AI agent trying to run hundreds of searches in a few minutes, that setup is too rigid. The agent can only tweak the search term; everything else is a black box. "Search as Code" (SaC) changes that dynamic. Instead of calling the API, the model writes a custom Python script to run the search. The script runs in a secure sandbox, pulling from Perplexity's search backend. Basic operations like retrieving, filtering, deduplicating, and reranking are packaged as simple SDK functions. The architecture breaks down into three layers. At the top sits the model, which understands the task and decides on a search strategy. In the middle is the sandbox where the code runs. At the bottom is the "Agentic Search SDK," which breaks Perplexity's search engine into individual, mix-and-match functions. Standard search APIs are still there for quick questions. But for tough research, the model can go much deeper. It can fire off parallel queries, filter out the noise programmatically, and pull only relevant hits into its context window. According to Perplexity , that's where the win is. Standard search pipelines stuff an agent's context window with junk because the filtering logic is locked in. When the agent writes its own filters, the context stays lean, and the model keeps its bearings across long research sessions. To show how this works in the real world, Perplexity tested it on a messy cybersecurity task. An agent had to track down 200 critical software vulnerabilities (CVEs) published between 2023 and 2025. For each one, it needed to find the official vendor advisory, the affected software, and the exact version that patched the bug. News articles or blog posts didn't count. With SaC, the model wrote a three-stage script. It ran parallel searches tailored to how specific vendors like Mozilla or Google format their security bulletins. Next, it scanned its own findings, spotted the gaps, and ran targeted follow-up queries. Finally, it used a schema to verify that the CVE, product, and fix version all lined up. It worked. Perplexity says the agent nailed the task while using 85 percent fewer tokens than its standard pipeline. Competing systems got less than a quarter of the data right. Perplexity claims SaC beat rivals like OpenAI's Responses API and Anthropic's Managed Agents on four out of five benchmarks. The biggest gap was on "WANDR," Perplexity's own benchmark for broad research tasks, which it plans to release soon. Of course, take self-reported benchmarks with a grain of salt, but the comparison against Perplexity's own older architecture shows a clear, massive leap in performance. Perplexity frames SaC as part of a bigger trend. Traditional software relies on deterministic instructions. Frontier models add reasoning in token space. The most capable systems combine both: models for strategy, deterministic runtimes for batching and filtering, and search infrastructure as an I/O layer.

中文翻译

在Perplexity的新"Search as Code"架构中,模型不调用现成的搜索API,而是编写自己的搜索工作流程作为Python代码。该公司承诺更精确的结果和更低的token使用量。

任何看过AI智能体处理复杂研究任务的人都会看到同样的模式。模型编写一个查询,搜索API返回结果列表,模型读取它们,然后编写下一个查询。这个循环重复,往往连续多次。

Perplexity在一份新技术报告中称此为瓶颈。今天的搜索引擎是为想要整齐蓝色链接列表的人类构建的,但对于试图在几分钟内运行数百次搜索的AI智能体来说,这种设置过于僵化。智能体只能调整搜索词;其他一切都是黑箱。

"Search as Code"(SaC)改变了这一动态。不是调用API,而是模型编写一个自定义Python脚本来运行搜索。该脚本在安全沙箱中运行,从Perplexity的搜索后端拉取数据。检索、过滤、去重和重排序等基本操作被封装为简单的SDK函数。

该架构分为三层。顶层是模型,它理解任务并决定搜索策略。中间是运行代码的沙箱。底层是"Agentic Search SDK",它将Perplexity的搜索引擎拆分为独立的、可混合匹配的函数。

标准搜索API仍然存在,用于快速问题。但对于困难的研究,模型可以深入得多。它可以同时发起并行查询,以编程方式过滤掉噪音,并将相关结果拉入上下文窗口。据Perplexity称,这就是胜利所在。

标准搜索管道会因过滤逻辑被锁定而用垃圾填满智能体的上下文窗口。当智能体编写自己的过滤器时,上下文保持精简,模型在长时间的研究过程中保持方向感。

为了展示这在现实世界中的效果,Perplexity在一个混乱的网络安全任务上进行了测试。一个智能体必须追踪200个2023年至2025年间发布的严重软件漏洞(CVE)。对于每个漏洞,它需要找到官方供应商公告、受影响的软件以及修补该漏洞的确切版本。新闻报道或博客文章不算数。

使用SaC,模型编写了一个三阶段脚本。它针对Mozilla或Google等特定供应商的安全公告格式运行了定制化的并行搜索。接下来,它扫描自己的发现,发现缺口,并运行针对性的后续查询。最后,它使用一个模式验证CVE、产品和修复版本是否全部对齐。

它成功了。Perplexity称智能体完成了任务,同时比其标准管道少用了85%的token。竞争系统获得不到四分之一的数据正确。Perplexity声称SaC在五个基准测试中的四个上击败了OpenAI的Responses API和Anthropic的Managed Agents等竞争对手。最大的差距在"WANDR"上,这是Perplexity自己为广泛研究任务设置的基准,计划很快发布。

当然,对于自我报告的基准要持保留态度,但与Perplexity自己旧架构的比较显示出了清晰、巨大的性能飞跃。Perplexity将SaC视为更大趋势的一部分。传统软件依赖于确定性指令。前沿模型在token空间中添加推理。最强大的系统结合两者:模型负责策略,确定性运行时负责批处理和过滤,搜索基础设施作为I/O层。

核心信息

Perplexity推出"Search as Code"新架构,让AI模型编写Python脚本来执行搜索,而非调用固定API,在复杂研究任务中可降低85%的token使用量,并显著提升准确率。

  • Perplexity推出Search as Code架构,模型自写搜索脚本
  • 相比传统API,SaC降低85% token消耗
  • 在CVE追踪任务中准确率远超竞品
  • 代表推理+确定性代码结合的趋势
  • 沙箱运行代码,平衡灵活性与安全性
试看内容

成为会员查看完整内容

你已经看到了这篇内容的前置整理,剩余深度部分仅对会员开放。

详细解读 信息差价值 参考来源
成为会员查看完整内容
上一篇 趋势解读:OpenAI says "chat is dead" and plans to,解读最新 AI 进展 下一篇 趋势解读:ChatGPT's new Lockdown Mode lets you disable web,提升开发者接入体验