Making Failure Safe: A Constrained, Verifiable Agent Framework for Open-Web Data Collection
Making Failure Safe: A Constrained, Verifiable Agent Framework for Open-Web Data Collection
让失败变得安全:一种用于开放网络数据采集的受限、可验证智能体框架
LLMs and agents can generate web scrapers from natural-language requirements, but direct generation remains unreliable because of dependency errors, broken selectors, schema mismatches, and heterogeneous page structures. 大语言模型(LLM)和智能体可以根据自然语言需求生成网页爬虫,但直接生成的结果往往不可靠,原因在于依赖项错误、选择器失效、模式不匹配以及页面结构的多样性。
We propose a constrained, verifiable agent framework that shifts LLM output from free-form code to typed JSON collector configurations, combining a six-type collector taxonomy, template and utility-function constraints, static Airflow DAG execution, rule-based quality checking, and structured feedback correction. 我们提出了一种受限且可验证的智能体框架,将 LLM 的输出从自由格式的代码转变为类型化的 JSON 采集器配置。该框架结合了六种类型的采集器分类法、模板与实用函数约束、静态 Airflow DAG 执行、基于规则的质量检查以及结构化的反馈修正机制。
Experiments on 138 tasks show that the taxonomy supports description-based requirement typing, while confirming that stable instantiation requires completing source, field, and execution constraints beyond the initial description. 在 138 项任务上的实验表明,该分类法支持基于描述的需求类型化,同时也证实了要实现稳定的实例化,除了初始描述外,还需要补全来源、字段和执行约束。
On 80 independently source-verified tasks, the framework runs with zero execution-stage LLM tokens and the lowest average wall-clock time, trading moderate one-shot quality for a reusable, deterministic, and verifiable execution path suited to repeated scheduled collection. 在 80 项经过独立来源验证的任务中,该框架在执行阶段无需消耗任何 LLM Token,且平均运行时间最短。它以适度的单次执行质量为代价,换取了一条适用于重复定时采集的可复用、确定性且可验证的执行路径。
These results position the framework as a reusable, low-cost, and verifiable execution path for repeated open-web data collection. 这些结果表明,该框架可作为一种可复用、低成本且可验证的执行路径,用于重复性的开放网络数据采集。