Skip to content

Migrating an Existing Knowledge Base ​

If you already have knowledge — an LLM-maintained wiki, a documentation folder, another knowledge workspace or a published knowledge package — you do not have to start from nothing. Create a knowledge workspace, describe what exists, and let the Agent research it and plan the move. You review a research report and the PLAN before anything is written.

An existing base usually crosses the threshold for a staged plan, so the Agent works through context-plan: it settles your purpose and constraints, studies each collection, proposes how to bring each one in, and then runs the stages one at a time, each with its own work-start report. See Planning Large Projects in Stages for how stages are sized and reviewed, and Cold-Starting a Knowledge Base for getting the first sources in.

The migration prompt ​

Once the workspace exists, start with:

text
Research what Context can do, then plan bringing in our existing knowledge:

- Where it lives today, who maintains it, and whether it stays maintained there:
- How it is produced today (scripts, prompts, and so on):
- Content that must keep its wording, and structure that must not change:
- Who reads the result, and whether different readers need separate packages:
- Historical Q&A or an evaluation question set, to show how the knowledge is used

Write a research report, continue up to the PLAN and pause. I will review the
approach and the stages.

Answer what you know; "not decided yet" is fine and is recorded as an open decision. The last item matters most: real questions tell the Agent what the knowledge is for, and they become your evaluation set later.

What the research tells you ​

For each collection the Agent works out:

  • What kind it is — a mirror of other documents with a summary layer, a raw archive, a wiki written from code, a team's maintained first-hand pages, or a published package — and who maintains it.
  • Where it really comes from — the documents and repositories its pages were built from, which of them the workspace already has, and what is unique to the collection.
  • How accurate it is — about ten concrete claims checked against code at a fixed revision, each consistent, partly consistent, inconsistent or unverifiable, with problems grouped into written wrong and went stale.
  • What it changes — where its topics would sit in your navigation, conflicts with existing articles, and which articles each package would hold.

The research report opens with the conclusions: the recommendation per collection with its benefit next to its cost. The analysis, scores and evidence follow.

Choosing how each collection comes in ​

Each collection, or each part of one, gets its own approach, scored against your answers with feasibility, effort and risk shown next to the score:

ApproachWhen it fitsWhat happens to the original
Produce articles from itThe knowledge should be rewritten for your readers and checked against code; a wiki written from code points to the questions that matterCan be archived once the workspace maintains the topic
Register the original upstreamThe collection mirrors or summarizes documents you can register directly; the author's own judgments become notesThe summary layer can stop being maintained
Keep pages as writtenA team's pages must keep their wording, but should be placed in your sections and checked against code. See Keeping Pages as WrittenMaintained where it is
Follow a published versionAnother team publishes the content as versions (a documentation repository or a knowledge package). See Published and Archived CollectionsFollows the publisher
Leave it where it isIt serves Agents working in its own repository, or only needs a linkMaintained where it is

For each collection you also choose between following the upstream — registered with fixed versions, so routine updates track it — and absorbing it once: the files come in as a document source that keeps its folders, the author's judgments become notes, and the source is frozen when the original is archived.

Packages and navigation are independent. A package selects its articles by path or by explicit list, so it needs no top-level section of its own. Content that belongs only in a package goes under a hidden group in the knowledge map: it stays out of the website menus but remains in the package and LLM Docs. See Knowledge Packages.

Material that stays where it is can still be connected:

  • Document directories — register a folder of existing documents as a source so its contents are captured and cited. See Document Directories.
  • Same-repository docs and Skills — documents and authored Skills already kept in the same repository are registered as repository content; the originals stay where they are and Context references them instead of migrating them. See Linking Existing Docs and Skills.
  • External entrances — content elsewhere that pages should link to, declared without downloading or capturing it. See External Entrances.

Skills, agents and scripts a collection carries are not knowledge; publish them through your Agent host's Skill distribution instead of packaging them.

Switch over after you have measured ​

Keep the old knowledge base running until the new one is proven. Run the same question set against both and compare quality, time and tool calls, as described in Evaluating Your Knowledge Base.

迁移已有知识库 ​

如果你手里已经有知识,比如 LLM 维护的 wiki、文档目录、另一个知识工作区或已发布的知识包,就不必从零开始。先创建知识工作区,说明已有哪些内容,再让 Agent 调研并规划迁移。正式写作之前,你会先审阅调研报告和 PLAN。

已有知识库的规模通常够得上分阶段计划,所以 Agent 会用 context-plan 来做:先确认你的目的和约束,逐个调研资料集,为每个资料集提出接入方式,再一个阶段一个阶段地推进,每个阶段都有自己的确认开工报告。阶段怎么划分、怎么审核,见分阶段规划大型项目;第一批来源怎么接入,见知识库冷启动。

迁移提示词 ​

工作区建好后,可以这样开始:

text
先调研 Context 能做什么,再规划如何接入我们已有的知识:

- 知识现在放在哪里、由谁维护,以后是否还在原处维护:
- 目前怎么生产这些知识(脚本、提示词等):
- 哪些内容的措辞必须保持不变,哪些结构不能改:
- 谁会阅读结果,不同读者是否需要各自的知识包:
- 历史问答或评测题集,用来说明这些知识平时怎么被使用

写一份调研报告,做到 PLAN 后暂停。方案和阶段划分由我来审阅。

知道多少答多少;“还没定”也可以,会记为待定事项。最后一项最重要:真实的问题能让 Agent 明白这些知识拿来做什么,之后也能直接当作评测题集。

调研会告诉你什么 ​

对每个资料集,Agent 会弄清楚:

  • 它属于哪一类:别处文档的镜像加摘要、原始归档、根据代码写成的 wiki、团队自己维护的一手页面,还是已发布的知识包;以及由谁维护。
  • 它真正的出处:页面依据的是哪些文档和仓库,其中哪些工作区里已经有了,哪些内容只有这个资料集才有。
  • 它准不准确:在固定版本的代码上核对十条左右的具体说法,每条判为一致、部分一致、不一致或无法核实;有问题的再分成写错和过时两类。
  • 它会带来哪些变化:相关主题会放在导航的什么位置,和已有文章有哪些冲突,每个知识包会收录哪些文章。

调研报告开头就是结论:每个资料集的建议,收益和成本并排列出。分析、评分和证据放在后面。

为每个资料集选择接入方式 ​

每个资料集(或资料集的每个部分)各自选择接入方式。Agent 会对照你的回答给每种方式打分,并在旁边列出可行性、工作量和风险:

方式适用情况原资料之后怎么办
据此产出文章知识需要为你的读者重写,并与代码核对;根据代码写成的 wiki 能告诉你哪些问题重要工作区接手维护这个主题后即可归档
登记原始上游资料集只是镜像或总结了别处的文档,可以直接登记那些文档;作者自己的判断整理成笔记摘要部分可以不再维护
原样纳入页面团队的页面必须保留原有措辞,但要放进你的目录并与代码核对。参见原样纳入页面继续在原处维护
跟进已发布的版本内容由其他团队按版本发布(文档仓库或知识包)。参见按版本发布与即将归档的资料随发布方更新
留在原处它服务的是在自己仓库里工作的 Agent,或者只需要一个链接继续在原处维护

对每个资料集,你还要决定是持续跟进上游(按固定版本登记,由例行更新跟上新版本),还是一次性吸收(把文件作为保留文件夹结构的文档来源接入,作者的判断整理成笔记,原资料归档后冻结这个来源)。

知识包和导航互不依赖。知识包按路径或明确列出的清单挑选文章,所以不需要单独的顶层目录。只放在知识包里的内容,挂在知识地图的隐藏分组下:网站菜单里看不到,但知识包和 LLM Docs 里都有。参见知识包。

留在原处的资料也可以接入:

  • 文档目录:把已有文档所在的文件夹登记为来源,采集后引用其中的内容。参见文档目录。
  • 同一仓库里的文档和 Skill:已经在同一仓库中的文档和自己编写的 Skill 登记为仓库内容,原文件不动,Context 直接引用而不迁移。参见链接已有的文档与 Skill。
  • 外部入口:页面只需要链接到别处的内容时,只做声明,不下载也不采集。参见外部入口。

资料集里附带的 Skill、Agent 和脚本不属于知识,应通过 Agent 宿主的 Skill 分发渠道发布,不要打进知识包。

先评测,再切换 ​

新知识库验证通过之前,旧知识库继续保留。用同一套题集分别测试两者,比较回答质量、耗时和工具调用次数,方法见评测知识库效果。