Skip to content

Choosing How to Add Material ​

Before the Agent can write anything, it needs to know which material it may read and cite. This subsection covers how to add each kind. Adding a source records what is in scope; it does not decide what to write — that comes later, in the work-start report.

Adding many sources is not the same as producing a large knowledge base. When the work spans more than 30 documents or needs real investigation of two or more repositories, the Agent plans it in stages first; see Planning Large Projects in Stages.

Which way fits your material ​

Your materialHow it is addedGuide
A code repository, or packages of a monorepoPinned to the commit the Agent readsCode Repositories
Local Markdown files or a documentation folderCaptured as a snapshot that pages citeDocument Directories
Lark documents and Wiki pagesCaptured with their images, sheets, attachments and other embedded resourcesLark Documents
Text you already hold: an excerpt, a decision, an observationSaved as a noteNotes and Conversation Summaries
Conclusions from an Agent conversationSaved as a conversation summaryNotes and Conversation Summaries
Docs and Skills kept in the same repository as the knowledge workspaceLinked and cited in place, not copiedLinking Existing Docs and Skills
Sites, Skills, repositories or packages readers should be able to reachDeclared as an entrance to link to, not read as evidenceExternal Entrances

If you are unsure, describe the material and what readers need from it; the Agent proposes the right kind and asks when the choice would change the scope.

Many sources in one request ​

You do not have to add sources one at a time. Name them all in one request:

text
Add ../billing-service as code, ../docs/user-guide.md as product documentation,
and this Wiki page: https://example.larkoffice.com/wiki/example-token

The Agent registers them together in one batch, so they do not interfere with each other. A long registration keeps its progress as it goes: if it is interrupted, ask the Agent to continue, and it resumes from where it stopped, checking each source again against what is already registered rather than trusting what was recorded before the interruption. Packages of the same monorepo can be named in the same request; each becomes its own source, registered by its directory inside the repository (see Code Repositories). The commands behind this are in CLI Commands.

If something fails ​

A failure keeps what already succeeded: sources before the failing one stay registered, and the Agent tells you which ones are done and which one failed, so you can fix that one and continue.

The whole request is checked before anything is registered. If an entry carries a field that its kind of source does not accept, nothing is registered and the error names the fields that kind does accept, so the Agent can correct the entry and submit the request again.

Only one registration can run in a knowledge workspace at a time. If the Agent is still busy with one, wait for it to finish instead of starting another. If a forced stop leaves the workspace blocked, ask the Agent to recover it before resuming.

选择添加材料的方式 ​

在 Agent 写任何内容之前,它需要知道可以阅读和引用哪些材料。本小节介绍如何添加每一类材料。添加来源只记录哪些内容在范围内;它并不决定要写什么,那是之后在 开工报告 中决定的。

添加大量来源并不等同于生产一个大型知识库。如果工作涉及超过 30 份文档,或需要对两个及以上仓库做实质性调研,Agent 会先把它分阶段规划;参见 分阶段规划大型项目。

哪种方式适合你的材料 ​

你的材料添加方式指南
代码仓库,或 monorepo 中的包固定到 Agent 读取的 commit代码仓库
本地 Markdown 文件或文档目录采集为供页面引用的快照文档目录
飞书文档和 Wiki 页面连同其中的图片、表格、附件和其他嵌入资源一起采集飞书文档
你手头已有的文字:摘录、决定、观察保存为笔记笔记与会话摘要
一次 Agent 对话得出的结论保存为会话摘要笔记与会话摘要
与知识工作区放在同一仓库中的文档和 Skill原地链接和引用,不复制链接已有的文档与 Skill
读者应能访问的站点、Skill、仓库或包声明为供链接的入口,不作为证据读取外部入口

如果不确定,描述一下材料以及读者需要从中得到什么;Agent 会提出合适的类别,并在这一选择会改变范围时询问你。

一次请求添加多个来源 ​

你不必逐个添加来源。在一次请求中把它们全部点名即可:

text
把 ../billing-service 作为代码,把 ../docs/user-guide.md 作为产品文档,
再加上这个 Wiki 页面:https://example.larkoffice.com/wiki/example-token

Agent 会在一个批次中一起登记它们,因此它们不会相互干扰。耗时较长的登记会随时保存进度:如果中断了,请 Agent 继续,它会从停下的地方恢复,并对照已登记的内容重新检查每个来源,而不是信任中断前的记录。同一个 monorepo 中的多个包可以在同一次请求中给出;每个包都会成为独立的来源,按它在仓库中的目录登记(参见 代码仓库)。其背后的命令见 CLI 命令。

出现失败时 ​

失败会保留已经成功的部分:失败项之前的来源保持已登记状态,Agent 会告诉你哪些已完成、哪一个失败了,以便你修复那一个后继续。

在登记任何来源之前,会先检查整个请求。如果某个条目带有该类来源不接受的字段,则不会登记任何来源,错误信息会列出该类来源接受的字段,以便 Agent 修正条目后重新提交请求。

一个知识工作区同一时间只能运行一次登记。如果 Agent 仍在忙于某次登记,请等待它完成,不要另起一次。如果强制停止导致知识工作区被阻塞,请先让 Agent 恢复它,再继续执行。