让大模型任务流程可复用,通过提取可读的步骤模板。
Credo: Reusable Declarative Primitives for Agentic Workflows

- 从复杂代码中提取可复用的声明式操作单元
- 保存每步的元信息和来源,支持后续快速生成新流程
- 适合需要反复构建智能任务流程的研究者与开发者
大型语言模型应用依赖于模型本身及其运行框架:即决定每次调用输入、调用次数及可信答案的程序。如今,可通过搜索候选程序发现高效框架,但结果是难以理解的命令式代码,其逻辑步骤、运行信号、执行决策和提示策略均隐含且任务特定,导致新任务必须重新搜索。然而,这些搜索所得框架蕴含大量知识,如有效逻辑步骤、关键信号、适应性执行策略和成功提示方法,却因嵌入在无结构的命令式代码中而无法查看或复用,且缺乏溯源与元数据。Credo 通过恢复已搜索框架的结构化声明式描述,为每个提取的原子操作打上相关元数据,并建立带溯源的目录。编译器可据此绑定存储的原子操作,为新任务生成框架而无需重新搜索。本文展示了初步成果,并提出研究议程,如基于成本的声明式目录编译及模型与工作负载变化下的目录维护,数据库领域对此有天然优势。
原文摘要 · Abstract (English)
An LLM application depends on both a model and a harness: the program that determines what each call sees, how many calls to make, and which answers to trust. Coding agents can now discover strong harnesses by searching over candidate programs, but the resulting artifact is an opaque block of imperative code whose logical steps, runtime signals, physical execution decisions, and prompt strategies remain implicit and task-specific, forcing subsequent tasks to start the harness search process from scratch. The potential for reuse, however, is substantial. A searched harness encodes significant knowledge, such as the logical steps that work, the signals that matter, the physical operator decisions that adapt execution, and the prompt strategies that are effective, yet this knowledge is buried in imperative code with no inspectable or reusable structure, nor does it carry any provenance or metadata. Credo addresses this problem by recovering a structured declarative description of a searched harness, tagging each extracted primitive with relevant metadata, and cataloguing all of it with provenance. A compiler can then bind stored primitives to generate harnesses for new tasks without having to start the search over from scratch. This paper provides preliminary results demonstrating the potential of our approach and lays out a related research agenda that the database community is well-positioned to tackle, including cost-based compilation over declarative catalogs and catalog maintenance under model and workload drift.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。