arXiv:2606.11869cs.SEcs.AI2026-06

手把手教你怎么从零打造专用AI代理,端到端落地生产。

Agents All the Way Down; A Methodology for Building Custom AI Agents from Substrate to Production

  • 用LLM作为组件,分层构建工具、系统和提示缓存的底层框架。
  • 通过原型、打包成命令行工具、自动测试三步循环迭代开发。
  • 不依赖任何框架,适合单人快速构建可运维的专用智能体。

专用AI代理是嵌入应用内部、与自身数据和工具通信、具备独立安全边界与审计追踪的智能体。它们的核心差异在于任务适配性而非能力,由未来维护者亲自构建。当前尚无完整实践指南,相关技术分散于博客、播客和泄露的提示中。本文提出‘自底向上构建’方法论:两个前提条件(子基架构与可复用组件)一次性建立并长期保持;三个持续实践(用通用代理原型、将结果打包为命令行工具、以通用代理驱动行为测试)形成闭环迭代。该方法无需框架,已成功应用于开源LAMB平台的定制代理,仅用十天由一人配合AI编程完成并投入生产。其核心思想是多智能体协同即命令行组合。

原文摘要 · Abstract (English)

Custom AI agents areagents that live inside their own application, talk to their own data and tools, enforce their own security boundaries, and carry their own brand and audit trail. What separates them from the general-purpose tier is fit, not capability: each is built for one job, by the engineer who will maintain it. No published practice sets out how to build one end to end. The pieces are everywhere (function-calling APIs, the Model Context Protocol, code agents to pair with), but the practice that chains them lives in podcasts, blogs, and leaked system prompts. This paper writes that practice down as a methodology, Agents All the Way Down: two preconditions crossed once and kept, then three practices repeated for the agent's life. The preconditions are (P1) Substrate, the LLM as a software component, framed as tools, then system, then messages under prompt-caching; and (P2) Building blocks: function calling, MCP, CLI orchestration, the liteshell pattern, the agent loop, skills, characters, hooks, and scaffolding. The practices are (P3) prototype with a general-purpose agent; (P4) harvest, fold, and ship the result as a CLI, the Turtle pattern; and (P5) agent-tests-agent, in which a general-purpose agent drives it through behavioural scenarios, a complement to classical testing, not a replacement. The working loop is P3 to P4 to P5 and back, and one corollary falls out for free: multi-agent orchestration is just CLI composition. The methodology is framework-free by construction. It was distilled from the AAC, a custom agent for the open-source LAMB platform, built in about ten days by one developer with an AI pair-programmer and in production . We present it as a transferable practice, independent of any language or framework.

AI代理工程化自动化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。