Operations Runbooks as Knowledge
Operations procedures that drive command-line tools — deploying, rotating a cache, checking a service — can be written as knowledge articles and then used directly through an Agent conversation. The procedure is documented and usable in one place: people read it on the site, and a knowledge service Agent reads the runbook, runs the commands in its runtime and reports back when you ask.
Follow our "restart a stuck consumer" runbook for the payments cluster and tell me what you find before changing anything.How such an Agent is set up is in Building a Knowledge Service.
Getting the procedure into the knowledge base
Pick the source that matches where the procedure lives today:
- Notes for procedures that only exist in people's heads or chat threads. Save the steps as a note — original text, verbatim excerpts or a labeled summary — and the Agent turns it into a reader-facing article. Proposals stay proposals; the article does not turn them into facts. See Notes and Conversation Summaries.
- Existing docs in the repository for runbooks and authored Skills already kept next to the code, such as under
docs/or.agents/skills/. Link them as repository content: they keep evolving with the code, and Context references them instead of producing them again. See Linking Existing Docs and Skills. - Document sources for runbooks maintained in a document system; see Document Directories and Lark Documents.
Add our on-call runbooks under docs/runbooks as repository content, and save the steps from this thread as a note for the cache-flush procedure.Write each procedure as concrete steps: the commands, the expected output, how to tell success from failure, and when to stop and ask a person.
If a Skill published elsewhere already covers the commands, link it from the article instead of copying its steps, by declaring it as an entrance; see External Entrances. An entrance is navigation only, so a conclusion that must stay traceable still needs its own source.
Variables, not values
Configure the environment variables a procedure needs in the Agent runtime. The knowledge names the variables only — never their values. Credentials stay on the server side and never enter knowledge, prompts or replies, so a procedure is safe to publish in a package or on a site.
Keeping runbooks current
When a procedure changes, update its source and ask the Agent to update the knowledge; it revises the affected article. If the source is right but the article misleads, revise only that page; see Revising a Page. When an article ends up more accurate than the document it came from, see Writing Back Upstream for keeping the two from drifting apart.
把运维手册写成知识
驱动命令行工具的运维流程——部署、轮换缓存、检查服务——可以写成知识文章,再直接通过 Agent 对话使用。流程的文档和使用集中在一处:人在站点上阅读它;当你提出请求时,知识服务 Agent 阅读运维手册,在自己的运行时中执行命令并汇报结果。
按我们的“重启卡住的消费者”运维手册处理 payments 集群,在做任何改动之前先告诉我你发现了什么。如何搭建这样的 Agent,见 构建知识服务。
把流程放进知识库
按流程目前所在的位置选择对应的来源:
- 笔记:适用于只存在于人脑或聊天记录中的流程。把步骤保存为笔记——原文、逐字摘录或带标注的摘要——再由 Agent 把它整理成面向读者的文章。提议仍是提议;文章不会把它们写成事实。参见 笔记与会话摘要。
- 仓库中已有的文档:适用于已经和代码放在一起的运维手册和自编 Skill,例如位于
docs/或.agents/skills/下的内容。把它们链接为仓库内容:它们随代码持续演进,Context 直接引用它们,不再重新生产。参见 链接已有的文档与 Skill。 - 文档来源:适用于在文档系统中维护的运维手册;参见 文档目录 和 飞书文档。
把 docs/runbooks 下的值班运维手册添加为仓库内容,并把这个讨论串里的步骤保存为缓存清空流程的笔记。把每个流程写成具体步骤:要执行的命令、预期输出、如何区分成功与失败,以及何时应停下来询问人。
如果别处发布的某个 Skill 已经涵盖这些命令,就在文章中链接它,而不是复制其中的步骤,做法是把它声明为入口;参见 外部入口。入口只用于导航,因此必须保持可追溯的结论仍需要有自己的来源。
只写变量,不写值
在 Agent 运行时中配置流程所需的环境变量。知识里只写变量名——绝不写它们的值。凭据保留在服务端,绝不进入知识、提示词或回复,因此流程可以放心地发布到知识包或站点中。
保持运维手册最新
流程变化时,更新它的来源,并让 Agent 更新知识;它会修订受影响的文章。如果来源没错而文章有误导,只修订那一页;参见 修订页面。当文章最终比它所依据的文档更准确时,参见 回写上游,避免两者逐渐脱节。