fuli-context 0.5.0 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/README.md +370 -202
  2. package/README.zh-CN.md +448 -0
  3. package/compose.graphiti.yml +6 -6
  4. package/dist/web/assets/AboutPage-DXh7Fwxt.css +1 -0
  5. package/dist/web/assets/AboutPage-qeO_vm0T.js +1 -0
  6. package/dist/web/assets/ConnectionsPage-CBHAdZXT.css +1 -0
  7. package/dist/web/assets/ConnectionsPage-DO0GR9Xg.js +1 -0
  8. package/dist/web/assets/KnowledgeInspector-Bjhdu2mf.css +1 -0
  9. package/dist/web/assets/KnowledgeInspector-DEW5lA1m.js +1 -0
  10. package/dist/web/assets/KnowledgeOrganizerPage-BkM568Ld.js +1 -0
  11. package/dist/web/assets/KnowledgeOrganizerPage-Cx1w1jb2.css +1 -0
  12. package/dist/web/assets/KnowledgePage-BAT4aZIm.js +1 -0
  13. package/dist/web/assets/KnowledgeWorkspace-DyGtBz--.js +4 -0
  14. package/dist/web/assets/OverviewPage-CmCcDCAs.js +1 -0
  15. package/dist/web/assets/PersonalProfilePage-C42mwKN8.js +1 -0
  16. package/dist/web/assets/{PersonalProfilePage-S8ZcG2LU.css → PersonalProfilePage-CdmEzyvZ.css} +1 -1
  17. package/dist/web/assets/PersonalProjectsPage-BwaXR62K.js +1 -0
  18. package/dist/web/assets/PublicProjectsPage-egKBulOq.js +1 -0
  19. package/dist/web/assets/ReviewPage-B3vnZ6gn.js +1 -0
  20. package/dist/web/assets/SearchableSelect-ih69qbcS.js +1 -0
  21. package/dist/web/assets/SettingsPage-C6ouU0sR.css +1 -0
  22. package/dist/web/assets/SettingsPage-oLE8mNs5.js +1 -0
  23. package/dist/web/assets/_plugin-vue_export-helper-BDNMzG2s.js +1 -0
  24. package/dist/web/assets/console-DE40hXGC.js +1 -0
  25. package/dist/web/assets/fuli-logo-Bu9WBuQe.js +1 -0
  26. package/dist/web/assets/fuli-logo-ER1wQ8Kk.png +0 -0
  27. package/dist/web/assets/i18n-CDxBs1sz.js +5 -0
  28. package/dist/web/assets/identity-BCxb1mcy.js +1 -0
  29. package/dist/web/assets/index-BzhNfzU_.js +2 -0
  30. package/dist/web/assets/index-CCOGfZzE.css +1 -0
  31. package/dist/web/assets/model-CCMdt10Q.js +1 -0
  32. package/dist/web/assets/paths-DwHeiGMT.js +1 -0
  33. package/dist/web/assets/useMinimumLoadingDisplay-BpCyBeko.css +1 -0
  34. package/dist/web/assets/useMinimumLoadingDisplay-HdI7XAmu.js +1 -0
  35. package/dist/web/assets/vue-router-Drfl1F8i.js +1 -0
  36. package/dist/web/index.html +9 -6
  37. package/docs/external-knowledge-architecture.md +279 -0
  38. package/examples/external-knowledge/markdown-folder.mjs +235 -0
  39. package/graph-provider/fuli_graph/app.py +57 -1
  40. package/graph-provider/fuli_graph/graph_models.py +3 -0
  41. package/graph-provider/fuli_graph/graph_query.py +62 -16
  42. package/graph-provider/fuli_graph/knowledge_review.py +657 -0
  43. package/graph-provider/fuli_graph/knowledge_review_models.py +133 -0
  44. package/graph-provider/fuli_graph/knowledge_search.py +51 -4
  45. package/graph-provider/fuli_graph/models.py +19 -0
  46. package/graph-provider/fuli_graph/runtime.py +15 -0
  47. package/graph-provider/fuli_graph/store_knowledge.py +2 -1
  48. package/graph-provider/pyproject.toml +1 -1
  49. package/npm-shrinkwrap.json +5 -407
  50. package/package.json +7 -5
  51. package/skills/capturing-session-knowledge/SKILL.md +24 -4
  52. package/skills/flreview/SKILL.md +100 -0
  53. package/skills/flreview/agents/openai.yaml +6 -0
  54. package/src/agent-tools/graph-definitions.js +81 -6
  55. package/src/agent-tools/graph-handlers.js +12 -0
  56. package/src/cli/command-registry.js +3 -3
  57. package/src/cli/local-runtime-command.js +51 -28
  58. package/src/cli/local-runtime-options.js +14 -8
  59. package/src/cli/setup-agent-selection.js +12 -12
  60. package/src/cli/setup-command.js +41 -18
  61. package/src/cli/shell-argument.js +10 -0
  62. package/src/cli/uninstall-command.js +17 -15
  63. package/src/cli/update-command.js +38 -30
  64. package/src/external-knowledge/catalog.js +61 -0
  65. package/src/external-knowledge/conflict-policy.js +58 -0
  66. package/src/external-knowledge/connected-search.js +166 -0
  67. package/src/external-knowledge/connectors/custom.js +133 -0
  68. package/src/external-knowledge/connectors/feishu.js +461 -0
  69. package/src/external-knowledge/connectors/mcp.js +438 -0
  70. package/src/external-knowledge/connectors/notion.js +307 -0
  71. package/src/external-knowledge/connectors/retrieval-api.js +222 -0
  72. package/src/external-knowledge/document-mapping.js +151 -0
  73. package/src/external-knowledge/graph-projection.js +17 -0
  74. package/src/external-knowledge/index.js +8 -0
  75. package/src/external-knowledge/registry.js +91 -0
  76. package/src/external-knowledge/runtime.js +68 -0
  77. package/src/external-knowledge/safe-diagnostic.js +14 -0
  78. package/src/external-knowledge/service.js +811 -0
  79. package/src/graphiti/agent-knowledge-workflows.js +7 -2
  80. package/src/graphiti/federated-application.js +68 -42
  81. package/src/graphiti/knowledge-item-role.js +21 -0
  82. package/src/graphiti/knowledge-review.js +43 -0
  83. package/src/graphiti/project-profile-mapping.js +32 -0
  84. package/src/graphiti/provider-client.js +22 -1
  85. package/src/graphiti/source-marker.js +54 -3
  86. package/src/graphiti/task-knowledge-recall.js +250 -0
  87. package/src/http/api-router.js +23 -108
  88. package/src/http/external-knowledge-api-router.js +104 -0
  89. package/src/http/graph-api-router.js +12 -1
  90. package/src/http/request-policy.js +1 -1
  91. package/src/local-runtime/lifecycle.js +26 -15
  92. package/src/mcp/create-mcp-server.js +4 -1
  93. package/src/mcp/instructions.js +7 -7
  94. package/src/mcp/tool-annotations.js +6 -0
  95. package/src/mcp/tool-result.js +1 -0
  96. package/src/server/application-lifecycle.js +2 -11
  97. package/src/server/blocked-ports.js +11 -0
  98. package/src/server.js +36 -17
  99. package/src/setup/agent-installation-status.js +2 -1
  100. package/src/setup/agents.js +2 -1
  101. package/src/setup/claude-code-config.js +2 -1
  102. package/src/setup/codex-bootstrap.js +12 -7
  103. package/src/setup/container-runtime.js +25 -21
  104. package/src/setup/graph-runtime.js +148 -56
  105. package/src/setup/node-runtime.js +3 -3
  106. package/src/setup/options.js +2 -4
  107. package/src/setup/paths.js +18 -3
  108. package/src/setup/review-skill-adapters.js +49 -0
  109. package/src/setup/setup.js +26 -2
  110. package/src/setup/uninstall.js +4 -2
  111. package/src/system/resource-monitor.js +317 -0
  112. package/src/system/runtime-settings.js +131 -0
  113. package/src/system/system-service.js +119 -0
  114. package/README.en.md +0 -336
  115. package/dist/web/assets/ConnectionsPage-CCKWm-6p.js +0 -1
  116. package/dist/web/assets/KnowledgeInspector-BZkB2wJn.js +0 -1
  117. package/dist/web/assets/KnowledgeInspector-CrGYxEob.css +0 -1
  118. package/dist/web/assets/KnowledgeOrganizerPage-CZAF_OlN.css +0 -1
  119. package/dist/web/assets/KnowledgeOrganizerPage-DlvcLwlL.js +0 -1
  120. package/dist/web/assets/KnowledgePage-CNQXd15y.js +0 -1
  121. package/dist/web/assets/KnowledgeWorkspace-CXPE4GCD.js +0 -4
  122. package/dist/web/assets/OverviewPage-ul7g7HXh.js +0 -1
  123. package/dist/web/assets/PersonalProfilePage-CC40Pw2L.js +0 -1
  124. package/dist/web/assets/PersonalProjectsPage-CPIEcShD.js +0 -1
  125. package/dist/web/assets/PublicProjectsPage-C700sR7z.js +0 -1
  126. package/dist/web/assets/ReviewPage-7MDDUDgA.js +0 -1
  127. package/dist/web/assets/console-B_Ena2DS.js +0 -5
  128. package/dist/web/assets/fuli-logo-DGuyqchQ.png +0 -0
  129. package/dist/web/assets/identity-CjBwYSMX.js +0 -1
  130. package/dist/web/assets/index-CpLDx3of.css +0 -1
  131. package/dist/web/assets/index-DAzeFJSc.js +0 -2
  132. package/dist/web/assets/model-C-5RVIJ2.js +0 -1
  133. package/dist/web/assets/paths-BkULqmGI.js +0 -1
  134. package/dist/web/assets/vue-router-DnD3hUm7.js +0 -1
  135. package/src/agent/candidate-read-service.js +0 -53
  136. package/src/agent/context-pack-service.js +0 -83
  137. package/src/agent/public-read-policy.js +0 -39
  138. package/src/agent/public-read-service.js +0 -69
  139. package/src/agent/read-projection.js +0 -107
  140. package/src/agent/search-service.js +0 -61
  141. package/src/agent/space-boundary.js +0 -33
  142. package/src/app/bootstrap.js +0 -8
  143. package/src/app/create-application.js +0 -143
  144. package/src/app/state-service.js +0 -38
  145. package/src/candidates.js +0 -78
  146. package/src/classifier.js +0 -63
  147. package/src/cli/command-arguments.js +0 -14
  148. package/src/context-pack.js +0 -206
  149. package/src/extractor.js +0 -77
  150. package/src/fact-history.js +0 -39
  151. package/src/facts/fact-service.js +0 -89
  152. package/src/http/bounded-json-array.js +0 -19
  153. package/src/http/lens-route.js +0 -50
  154. package/src/ingestion.js +0 -161
  155. package/src/lens/lens-correction-service.js +0 -81
  156. package/src/lens/lens-fact-writer.js +0 -85
  157. package/src/lens/lens-input.js +0 -62
  158. package/src/lens/lens-query-projection.js +0 -87
  159. package/src/lens/lens-query-ranking.js +0 -62
  160. package/src/lens/lens-query.js +0 -143
  161. package/src/lens/lens-resource-projection.js +0 -93
  162. package/src/lens/lens-resource-selection.js +0 -45
  163. package/src/lens/lens-resource-service.js +0 -103
  164. package/src/lens/lens-search-query.js +0 -122
  165. package/src/lens/lens-service.js +0 -183
  166. package/src/models.js +0 -44
  167. package/src/observer.js +0 -83
  168. package/src/project-rules.js +0 -33
  169. package/src/publication/outbox-service.js +0 -46
  170. package/src/publication/publication-envelope-schema.js +0 -75
  171. package/src/publication/publication-envelope.js +0 -37
  172. package/src/publication/publication-policy.js +0 -82
  173. package/src/publication/publication-service.js +0 -48
  174. package/src/router.js +0 -58
  175. package/src/runtime-options.js +0 -138
  176. package/src/security/episode-visibility.js +0 -14
  177. package/src/security/fact-visibility.js +0 -15
  178. package/src/security/source-metadata-policy.js +0 -8
  179. package/src/storage/episode-evidence-preview.js +0 -100
  180. package/src/storage/fact-search-order.js +0 -18
  181. package/src/storage/file/episode-evidence.js +0 -37
  182. package/src/storage/file/episode-index.js +0 -59
  183. package/src/storage/file/fact-search.js +0 -60
  184. package/src/storage/file-store.js +0 -437
  185. package/src/storage/migrate.js +0 -128
  186. package/src/storage/migrations/001-initial.sql +0 -83
  187. package/src/storage/migrations/002-storage-integrity.sql +0 -113
  188. package/src/storage/record-validation.js +0 -46
  189. package/src/storage/snapshot-defaults.js +0 -54
  190. package/src/storage/sqlite/candidates-repository.js +0 -84
  191. package/src/storage/sqlite/episode-evidence-repository.js +0 -154
  192. package/src/storage/sqlite/episode-privacy-sql.js +0 -33
  193. package/src/storage/sqlite/episodes-repository.js +0 -52
  194. package/src/storage/sqlite/fact-search-repository.js +0 -162
  195. package/src/storage/sqlite/facts-repository.js +0 -146
  196. package/src/storage/sqlite/imports-repository.js +0 -39
  197. package/src/storage/sqlite/mapper.js +0 -84
  198. package/src/storage/sqlite/open-database.js +0 -15
  199. package/src/storage/sqlite/outbox-repository.js +0 -103
  200. package/src/storage/sqlite/snapshot-repository.js +0 -69
  201. package/src/storage/sqlite/spaces-repository.js +0 -52
  202. package/src/storage/sqlite/subscriptions-repository.js +0 -54
  203. package/src/storage/sqlite-store.js +0 -159
  204. package/src/storage/stable-json.js +0 -24
  205. package/src/storage/store-port.js +0 -20
  206. package/src/store.js +0 -2
package/README.md CHANGED
@@ -1,198 +1,335 @@
1
- # 复利(Fuli)
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/JevonsCode/fuli/main/web/assets/brand/fuli-logo.png" alt="Fuli logo" width="72" />
3
+ </p>
2
4
 
3
- [English](README.en.md)
5
+ <h1 align="center">Fuli</h1>
4
6
 
5
- 复利是一个面向 AI Agent 的本地优先协作上下文图谱。它把人与 AI 在项目中产生的、经得起
6
- 复用的知识、经验、决策理由和偏好组织成有来源、有作用域、有时间关系的资产,让 Codex、
7
- Claude Code 和 Cursor 在后续任务中少重复学习一次。
7
+ <p align="center">
8
+ English · <a href="README.zh-CN.md">简体中文</a>
9
+ </p>
8
10
 
9
- 复利不是聊天记录仓库,也不试图建立一个替代人的“人格模型”。AI 负责检索、提醒、归纳和
10
- 执行;人始终保留最终判断权。
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/fuli-context"><img src="https://img.shields.io/npm/v/fuli-context?style=flat&logo=npm&label=fuli-context" alt="npm version" /></a>
13
+ <a href="https://www.npmjs.com/package/fuli-context"><img src="https://img.shields.io/npm/dm/fuli-context?style=flat" alt="npm downloads" /></a>
14
+ <a href="LICENSE"><img src="https://img.shields.io/npm/l/fuli-context?style=flat" alt="license" /></a>
15
+ </p>
11
16
 
12
- 当前 npm 包是个人版:个人知识、图数据库和管理界面都运行在本机。团队共享 Provider 是
13
- 独立部署的服务单元,不会把个人品味、个性或判断偏好发布到公共层。
17
+ Fuli is a local-first collaboration context graph for AI agents. It turns reusable knowledge,
18
+ experience, decision rationale, and preferences from human–AI project work into assets with
19
+ provenance, scope, authority, and temporal history. Codex, Claude Code, and Cursor can then reuse
20
+ those assets in later tasks instead of relearning the same context.
14
21
 
15
- ## 项目理念
22
+ Fuli is not a transcript archive, and it is not an attempt to build a personality model that
23
+ replaces human judgment. AI retrieves, summarizes, warns, and executes; humans retain final
24
+ authority.
16
25
 
17
- ### 1. 衡量复用价值,而不是知识数量
26
+ ## npm packages
18
27
 
19
- 复利的核心问题是:
28
+ | Package | Status | Intended use |
29
+ | --- | --- | --- |
30
+ | [`fuli-context`](https://www.npmjs.com/package/fuli-context) | Available | Personal edition; personal knowledge, the graph database, and the management UI all run locally |
31
+ | Fuli Server npm package | In development | A separate server for team-shared deployments; not yet published |
20
32
 
21
- > 如果没有 Fuli,Agent 是否需要重新学习一条已经确认、仍然有效且与当前任务相关的信息?
33
+ `fuli-context` is currently the only available npm package. The shared layer never contains
34
+ personal taste, personality, or judgment preferences.
22
35
 
23
- 节点数、对话数和图谱规模不是成功指标。真正需要验证的是:历史资产能否在正确的项目、时间
24
- 和权威边界内被再次使用,并减少重复解释、修正和返工。
36
+ ## Philosophy
25
37
 
26
- ### 2. 每个任务都检查价值,但不强迫每个任务沉淀
38
+ ### 1. Measure reuse value, not knowledge volume
27
39
 
28
- 一次任务可能产生:
40
+ Fuli is built around one question:
29
41
 
30
- - 可复用知识:API 约定、Runbook、发布方式或项目约束;
31
- - 经验:为什么某个做法有效或失败;
32
- - 决策轨迹:候选方案、人的选择、理由和后续验证;
33
- - 判断辅助:偏好、原则、品味或个性倾向。
42
+ > Without Fuli, would the agent have to relearn information that is confirmed, still valid, and
43
+ > relevant to the current task?
34
44
 
35
- 也可能只有临时输出、猜测或一次性选择。此时正确结果是 `retain_nothing`。复利要求每个任务
36
- 结束前做一次知识价值检查,并不是把每次聊天都变成长久记忆。
45
+ Node count, transcript count, and graph size are not success metrics. The product succeeds when a
46
+ past collaboration asset is reused within the correct project, time, provenance, and authority
47
+ boundaries—and reduces repeated explanation, correction, or rework.
37
48
 
38
- ### 3. 人的权威高于 Agent 的重复判断
49
+ ### 2. Review every task; do not retain every task
39
50
 
40
- AI 可以发现候选、指出冲突、建议公共化,也可以在得到授权后处理延迟冲突;它不能仅凭语义
41
- 相似、重复出现或自己的判断伪造人工确认。公共知识提升和有风险的项目写入必须先预览,再由
42
- 明确的人类选择触发一次性、原子执行。
51
+ A task may produce:
43
52
 
44
- ### 4. 先组装上下文,再按需取证
53
+ - reusable knowledge such as API conventions, runbooks, release procedures, or constraints;
54
+ - experience explaining why an approach worked or failed;
55
+ - a decision trace with options, a human choice, rationale, and later validation;
56
+ - judgment aids such as preferences, principles, taste, or personality tendencies.
45
57
 
46
- Fuli 不会在会话开始时把全部历史塞给模型。入口阶段只加载当前任务实际生效的个人全局偏好
47
- 和精确项目偏好;详细知识由 Agent 根据任务按需检索。只有真正影响回答、实现或决策的知识
48
- 才记录为一次使用,单纯检索不会增加权重。
58
+ It may also produce only disposable output, a guess, or a one-off choice. In that case,
59
+ `retain_nothing` is the correct result. Every task should perform a knowledge-value checkpoint, but
60
+ not every task must become stored knowledge.
49
61
 
50
- ### 5. 保留知识演化,而不是覆盖历史
62
+ ### 3. Human authority outranks agent repetition
51
63
 
52
- 旧方案可能在当时正确,后来因条件变化被替代。Fuli 保存来源、确认权威、时间、理由、修订、
53
- 替代和负面证据,让 Agent 能解释“现在应该用什么”以及“为什么过去曾经不同”。负面反馈会
54
- 降低相关内容的排序或触发复核,但不会静默抹掉历史。
64
+ An agent may discover candidates, surface conflicts, recommend promotion, or resolve a deferred
65
+ conflict when explicitly authorized. It may not turn semantic similarity, repetition, or its own
66
+ judgment into human confirmation. Shared-knowledge promotion and sensitive project mutations use a
67
+ preview followed by an explicit, one-time, atomic action.
55
68
 
56
- ### 6. 公共知识归属上级,项目差异留在子项目
69
+ ### 4. Assemble context, then retrieve evidence on demand
57
70
 
58
- 例如,酒店和机票项目可以只保存自己的 PRD、配置和领域规则,把共同的本地运行、Mock、测试
59
- 和发布方式收敛到活动平台项目:
71
+ Fuli does not inject the complete history at session start. The entry step always loads effective
72
+ personal-global preferences and preferences from one exactly matched project. When the current task
73
+ signals that a stable prior fact, method, URL, decision, release, deployment, or authentication
74
+ runbook may matter, the same step also performs a small bounded recall from that project and its
75
+ authorized knowledge sources. The agent uses focused on-demand search when more evidence is needed.
76
+ Retrieval alone is not usage; a usage event is recorded only when an item materially affects an
77
+ answer, implementation, or decision.
78
+
79
+ ### 5. Preserve evolution instead of overwriting history
80
+
81
+ An old approach may have been correct under earlier conditions and later replaced. Fuli preserves
82
+ provenance, confirmation authority, time, rationale, revisions, supersession, and negative evidence
83
+ so an agent can explain both what applies now and why the past was different. Negative feedback may
84
+ lower rank or trigger review, but it never silently erases history.
85
+
86
+ ### 6. Put shared knowledge in the parent; keep differences in each child
87
+
88
+ For example, hotel and flight projects can keep their own PRDs, configuration, and domain rules,
89
+ while a parent activity-platform project owns shared local-run, mock, test, and deployment runbooks:
60
90
 
61
91
  ```text
62
- 活动平台(父项目:共享 Runbook)
63
- ├── 酒店项目(子项目:酒店 PRD / 配置 / 覆盖项)
64
- └── 机票项目(子项目:机票 PRD / 配置 / 覆盖项)
92
+ Activity platform (parent: shared runbooks)
93
+ ├── Hotel project (child: hotel PRD / configuration / overrides)
94
+ └── Flight project (child: flight PRD / configuration / overrides)
65
95
  ```
66
96
 
67
- Agent 在酒店项目工作时先搜索酒店本地知识,再沿显式的 `PART_OF` 或
68
- `USES_KNOWLEDGE_FROM` 关系向上搜索允许继承的知识,最多两跳。同稳定键的子项目内容覆盖
69
- 父项目内容;普通 `RELATED_TO` 关系不会扩大作用域,项目级个人偏好也不会向下继承。
97
+ When an agent works in the hotel project, it searches hotel-local knowledge first, then follows
98
+ explicit outgoing `PART_OF` or `USES_KNOWLEDGE_FROM` relationships to authorized sources, up to two
99
+ hops. A child item with the same stable key overrides an inherited item. Generic `RELATED_TO`
100
+ relationships do not expand scope, and project-scoped personal preferences are not inherited.
70
101
 
71
- 多个子项目中相似的内容只会形成公共化候选。当前聚类是词法启发式信号,不是语义等价证明;
72
- 必须由人选择规范项、重复项、上级项目和理由后,才能原子提升。
102
+ Similar items from multiple children create only a common-knowledge candidate. Current clustering
103
+ is a lexical heuristic, not proof of semantic equivalence. A human must select the canonical item,
104
+ duplicates, parent project, and rationale before an atomic promotion can occur.
73
105
 
74
- ### 7. 本地优先,公开层不包含个人模型
106
+ ### 7. Local first; no personal model in the shared layer
75
107
 
76
- 个人图谱默认留在本机。Fuli 保存结构化、可复用的知识,不保存整段会话、凭据、临时日志或
77
- 原始命令输出。团队共享层只承载经过确认、具有上下文和来源的项目或领域知识,不包含个人的
78
- 品味、个性和判断偏好。
108
+ The personal graph stays local by default. Fuli stores structured reusable knowledge, not raw
109
+ transcripts, credentials, temporary logs, or command output. The team-shared layer contains only
110
+ confirmed project or domain knowledge with context and provenance—not personal taste, personality,
111
+ or judgment preferences.
79
112
 
80
- ## Agent 交互时序
113
+ ## Agent interaction sequence
81
114
 
82
- 下面是日常任务的简化时序。更完整的项目继承、使用计数、写入预览和来源标记流程见
83
- [智能体调用时序图](acceptance/智能体调用时序图.md)。
115
+ This is the simplified lifecycle for a normal task. The Chinese
116
+ [detailed sequence diagram](acceptance/智能体调用时序图.md) also covers inheritance, usage counting,
117
+ write previews, and source markers.
84
118
 
85
119
  ```mermaid
86
120
  sequenceDiagram
87
121
  autonumber
88
- actor U as 用户
122
+ actor U as User
89
123
  participant A as Agent
90
- participant L as 生命周期接入
124
+ participant L as Lifecycle integration
91
125
  participant F as Fuli MCP
92
- participant G as 本地图谱
93
-
94
- U->>A: 在当前项目提交任务
95
- alt Claude Code(Hook 强制)
96
- L->>F: UserPromptSubmit → begin_task_context
97
- F-->>A: 生效偏好、项目和任务令牌
98
- else Codex / Cursor(Prompt fallback)
99
- A->>F: get_collaboration_preferences(projectPath)
100
- F-->>A: 生效偏好和精确项目
126
+ participant G as Local graph
127
+
128
+ U->>A: Submit a task in the current project
129
+ alt Claude Code (hook-enforced)
130
+ L->>F: begin_task_context(projectPath, taskPrompt)
131
+ F-->>A: Preferences, exact project, bounded recall, and task token
132
+ else Codex / Cursor (prompt fallback)
133
+ A->>F: get_collaboration_preferences(projectPath, taskPrompt)
134
+ F-->>A: Preferences, exact project, and bounded recall
101
135
  end
102
136
 
103
- opt 任务依赖历史知识
104
- A->>F: search_current_project_knowledge
105
- F->>G: 先查子项目,再查获授权的上级
106
- G-->>A: 有界正文、状态、来源和历史
107
- opt 知识实际影响结果
137
+ A->>A: Inspect task_knowledge_recall
138
+ opt Historical context is needed and recall did not answer it
139
+ A->>F: search_current_project_knowledge with focused queries
140
+ F->>G: Search child first, then authorized parents
141
+ G-->>A: Bounded content, status, provenance, and history
142
+ opt Knowledge materially affects the result
108
143
  A->>F: record_knowledge_usage
109
144
  end
110
145
  end
111
146
 
112
- A->>A: 完成实现、验证或回答
113
- opt 产生决策、反证或失效证据
114
- A->>F: 记录理由或知识反馈
147
+ A->>A: Complete the implementation, validation, or answer
148
+ opt The task creates a decision, contradiction, or stale signal
149
+ A->>F: Record rationale or knowledge feedback
115
150
  end
116
151
  A->>F: checkpoint_task_knowledge
117
- alt 有少量可复用候选
152
+ alt A small durable candidate batch exists
118
153
  F->>G: capture_candidates
119
- else 没有值得长期保留的内容
154
+ else Nothing should be retained
120
155
  F-->>A: retain_nothing
121
156
  end
122
157
 
123
- alt Claude Code Stop Hook
158
+ alt Claude Code Stop hook
124
159
  L->>F: verify_task_checkpoint
125
- F-->>L: 已检查才允许结束
126
- else Prompt fallback Agent
127
- Note over A,F: 遵循同一契约,但宿主不能确定性阻止漏检
160
+ F-->>L: Allow stop only after review
161
+ else Prompt-fallback agent
162
+ Note over A,F: Same contract, but the host cannot deterministically block a missed review
128
163
  end
129
- A-->>U: 返回结果与实际使用的 Fuli 来源
164
+ A-->>U: Return the result and any Fuli sources actually used
130
165
  ```
131
166
 
132
- ## 当前能力与证据边界
133
-
134
- 已经由实现和自动化测试覆盖的核心机制包括:
135
-
136
- - 本地个人空间、精确项目作用域和选择性上级继承;
137
- - 偏好确认、延迟冲突处理、修订历史和来源标记;
138
- - 任务入口、任务末尾知识检查,以及 Claude Code 的入口 / Stop Hook;
139
- - 决策选项、决策理由和首次记录时附带的验证结果;
140
- - 知识使用事件、负面反馈和内容代际隔离;
141
- - 公共知识候选发现,以及预览令牌保护的原子提升。
142
-
143
- 仍需与“已经证明”区分的内容:
144
-
145
- - `FULI_ALIGNMENT_BENCHMARK.md` 中 A/B 阈值是验收约定;只有完成足量、同条件的真实配对任务
146
- 后,才能声称 Fuli 已降低重复解释或返工;
147
- - Benchmark 的测试项目和对话是明确标注的 **MOCK / 合成数据**,不是用户或生产数据;
148
- - 当前决策工具可在首次记录时附带验证,但还没有面向既有 `Decision` 单独追加不可变验证结果
149
- 的专用入口;
150
- - Claude Code 具备确定性的生命周期 Hook;Codex 和 Cursor 当前是 Prompt fallback,不能把两者
151
- 表述为同等强制能力。
152
-
153
- ## 安装
154
-
155
- 准备:
156
-
157
- - Node.js 24.12 或更高版本;
158
- - Docker Compose v2;Docker Desktop 或 Rancher Desktop 均可;
159
- - 至少约 4 GB 可供容器使用的内存。
160
-
161
- 全局安装并初始化:
167
+ ## Read-only external knowledge
168
+
169
+ One knowledge-base connection can be bound to one or more existing personal projects without
170
+ granting Fuli write access to the source. Each target keeps independent retrieval mode, sync
171
+ cursor, and error state. The Connections page supports multi-project assignment, connection
172
+ checks, manual synchronization, disconnection, and a per-project conflict switch.
173
+
174
+ | Connector | Read path | Current boundary |
175
+ | --- | --- | --- |
176
+ | MCP | Resources `list/read`; configured `search` / `fetch` tools | Default; HTTPS or loopback HTTP, plus stdio |
177
+ | Notion | Page Markdown and Data Source queries | Current `2026-03-11` API; explicit page or data-source IDs |
178
+ | Feishu / Lark | Wiki nodes, search, and Docx raw content | Docx text only; search may require a user access token |
179
+ | RAG Retrieval API | Dify-compatible external-knowledge retrieval contract | Live only; for compatible endpoints or adapters in front of systems such as RAGFlow |
180
+ | Trusted custom code | Local ESM `sync` / `retrieve` contract | Explicitly installed trusted code, not a sandbox |
181
+
182
+ <a id="connect-external-knowledge"></a>
183
+
184
+ ### Connect one or more knowledge bases to a project
185
+
186
+ One personal project can have multiple knowledge connections, and one connection can target
187
+ multiple personal projects. Each submission adds a connection instead of replacing an existing
188
+ one. Source configuration is stored once, while retrieval mode, synchronization state, and errors
189
+ are isolated per target. Use Bind projects on an existing connection to add or remove targets.
190
+
191
+ 1. Create or confirm the target under Personal projects.
192
+ 2. If the source needs a token, set it in the environment that starts Fuli, then start or restart
193
+ the service. The binding stores only the environment-variable name. For example, run
194
+ `export PROJECT_KB_TOKEN='...'` and then `fl restart`.
195
+ 3. Open `http://127.0.0.1:2727/connections`. Under External knowledge, enter a connection name,
196
+ connector, one or more bound projects, and retrieval mode.
197
+ 4. For MCP HTTP, enter the server URL and optional token environment-variable name. For MCP stdio,
198
+ enter its command and arguments. For Notion, enter the token environment-variable name and Page
199
+ IDs or Data Source IDs. For Feishu/Lark, enter the token environment-variable name, region, and
200
+ an explicit Space ID, root-node token, or node tokens. For RAG Retrieval API, enter a
201
+ Dify-compatible endpoint, knowledge-base IDs, and an optional token environment-variable name.
202
+ A custom connector takes a trusted local ESM module and source JSON.
203
+ 5. Select Add connection and then Check. A successful `mirror` or `hybrid` binding can be synced;
204
+ a `live` binding reads its source when an Agent query runs.
205
+ 6. After creation, use Bind projects to add or remove projects and select a mode per project.
206
+
207
+ The project graph shows an External knowledge source node and a Uses external knowledge edge for
208
+ each assignment. This is a read-only projection of connection configuration. Live bodies are still
209
+ retrieved only when an Agent invokes `search_connected_knowledge`; showing the node does not mirror
210
+ content locally.
211
+
212
+ Retrieval modes differ as follows:
213
+
214
+ - `live`: read the third party at query time without storing a body mirror in Fuli; the source must
215
+ be available.
216
+ - `mirror`: manually mirror read-only content into the bound personal project and query the graph.
217
+ - `hybrid`: use both the local mirror and live source results; recommended when the connector
218
+ supports both capabilities.
219
+
220
+ Bindings support `live`, `mirror`, and `hybrid` modes. Mirror content is written only to the bound
221
+ personal project as `observed`, `pending`, `restricted`, local-only knowledge. Credentials are read
222
+ from named environment variables and are not stored in binding JSON. Source writes are never part
223
+ of the connector contract. Documents that look like credential material are skipped individually,
224
+ reported by count, and never enter the graph or Agent context.
225
+
226
+ <a id="external-knowledge-conflict-policy"></a>
227
+
228
+ ### Conflict policy
229
+
230
+ The conflict policy is stored per personal project and applies across that project's personal
231
+ graph, all external bindings, and explicitly selected public projects:
232
+
233
+ - Ask in the Agent conversation is the default. The Agent presents conflicting content, source,
234
+ and scope separately so the user can choose.
235
+ - Allow an Agent decision lets the Agent select the stronger or fresher source for the current
236
+ response and requires it to explain the basis. It never confirms, invalidates, overwrites, or
237
+ writes back any knowledge.
238
+
239
+ From the project directory, an Agent can be asked: `Search the current project and connected knowledge bases for the payment callback contract; list conflicting sources and ask me to decide.`
240
+
241
+ `search_connected_knowledge` keeps personal-graph evidence, each external binding, and explicitly
242
+ selected public projects as separate source sets. Public-project aggregation is **Beta**. When an
243
+ Agent finds a material conflict, the default policy is to show it in the conversation and ask the
244
+ user; the optional Agent-decision policy applies to the current response only and cannot confirm,
245
+ invalidate, or rewrite any source. Direct external-to-public binding, reviewed public promotion,
246
+ scheduled sync, webhooks, and full deletion reconciliation remain **TODO**.
247
+
248
+ See the [external-knowledge architecture and connector contract](docs/external-knowledge-architecture.md).
249
+
250
+ ## Current capabilities and evidence boundaries
251
+
252
+ Core mechanisms covered by implementation and automated tests include:
253
+
254
+ - a local personal space, exact project scope, and selective parent inheritance;
255
+ - preference confirmation, deferred conflict resolution, revision history, and source markers;
256
+ - bounded task-prompt recall, focused on-demand retrieval, and material-usage auditing;
257
+ - task entry and completion checkpoints, plus Claude Code entry and Stop hooks;
258
+ - decision options, rationale, and validation results supplied during initial capture;
259
+ - knowledge-usage events, negative feedback, and content-generation isolation;
260
+ - persistent scoped knowledge reviews with pause/resume watermarks;
261
+ - common-knowledge discovery and preview-token-protected atomic promotion;
262
+ - read-only multi-project MCP, Notion, Feishu/Lark, Dify-compatible RAG Retrieval API, and trusted-code bindings with connected retrieval.
263
+
264
+ The following must not be presented as already proven:
265
+
266
+ - the A/B thresholds in `FULI_ALIGNMENT_BENCHMARK.md` are acceptance conventions; claims that Fuli
267
+ reduces explanation or rework require a sufficiently large set of controlled, real paired tasks;
268
+ - benchmark projects and conversations are explicitly labeled **MOCK / synthetic data**, not user or
269
+ production data;
270
+ - the decision tool can include validation during initial capture, but it does not yet expose a
271
+ dedicated operation for appending immutable validation results to an existing `Decision`;
272
+ - Claude Code has deterministic lifecycle hooks; Codex and Cursor currently use prompt fallback and
273
+ must not be described as equally enforced;
274
+ - selected public projects in connected retrieval are Beta; external-to-public promotion and
275
+ background delta synchronization are not implemented.
276
+
277
+ ## Installation
278
+
279
+ Requirements:
280
+
281
+ - Node.js 24.12 or later;
282
+ - Docker Compose v2 through Docker Desktop, Rancher Desktop, or another compatible runtime;
283
+ - approximately 4 GB of memory available to the containers.
284
+
285
+ Install globally and initialize:
162
286
 
163
287
  ```bash
164
288
  npm install --global fuli-context
165
289
  fuli setup
166
290
  ```
167
291
 
168
- `fuli setup` 会先展示操作计划并请求确认,然后检查容器运行时、初始化本机
169
- Graphiti / Neo4j、创建个人空间、安装配套 Agent Skills,并为检测到的 Agent 注册 `fuli`
170
- MCP。默认只连接个人 Provider,不会模拟团队共享服务。
292
+ `fuli setup` first shows its plan and asks for confirmation. It then checks the container runtime,
293
+ initializes local Graphiti / Neo4j, creates a personal space, installs the companion Agent Skills,
294
+ and registers the `fuli` MCP with detected agents. The default setup connects only the personal
295
+ Provider; it does not simulate a team-shared service.
171
296
 
172
- 初始化完成后:
297
+ Open the management UI after setup:
173
298
 
174
299
  ```bash
175
300
  fuli open
176
301
  ```
177
302
 
178
- 管理界面默认位于 `http://127.0.0.1:2727`。
303
+ The default URL is `http://127.0.0.1:2727`.
304
+
305
+ The Settings page manages all seven local Fuli ports, LAN access, automatic capture, Agent access,
306
+ UI language, and the resource refresh interval. Run `fuli restart` after saving port or LAN changes;
307
+ the refresh interval applies immediately. The same page polls real memory and disk usage for the
308
+ management service, Providers, Neo4j, application files, and local data. Memory is sampled on every
309
+ poll; disk usage is sampled at most once per minute, with separate timestamps. Missing container metrics
310
+ are shown as partial instead of being replaced with mock values. Browser-tab memory and shared
311
+ container-VM overhead are excluded from the Fuli total.
179
312
 
180
313
  ## CLI
181
314
 
182
- 全局安装提供两个等价命令:`fuli` 和短别名 `fl`。
315
+ The global package provides two equivalent commands: `fuli` and the short alias `fl`.
316
+ CLI help, prompts, status output, and errors are always in English and do not follow the web or
317
+ system locale. User data such as paths and space names is displayed unchanged.
183
318
 
184
- | 命令 | 用途 |
319
+ | Command | Purpose |
185
320
  | --- | --- |
186
- | `fuli setup [选项]` | 初始化 Provider、管理界面、Agent 接入和 Skills;可重复执行 |
187
- | `fuli start [选项]` | 启动本机服务 |
188
- | `fuli stop [--data-dir DIR]` | 停止服务并保留数据 |
189
- | `fuli restart [选项]` | 重启本机服务 |
190
- | `fuli status [--json]` | 查看服务状态 |
191
- | `fuli open` | 打开管理界面 |
192
- | `fuli update [setup 选项]` | 更新 npm 包并刷新本机接入 |
193
- | `fuli uninstall [--yes]` | 清理 Agent 接入和服务,保留知识数据 |
194
-
195
- 常用示例:
321
+ | `fuli --help` / `fuli -h` | List every public command and its available options |
322
+ | `fuli --version` / `fuli -v` | Print the installed Fuli CLI version |
323
+ | `fuli setup [options]` | Initialize the Provider, UI, agent integrations, and Skills; safe to rerun |
324
+ | `fuli start [options]` | Start the Provider and UI, optionally opening a browser, rebuilding containers, or enabling LAN access |
325
+ | `fuli stop [--data-dir DIR]` | Stop services without deleting data |
326
+ | `fuli restart [options]` | Restart local services using the same runtime options as `start` |
327
+ | `fuli status [--json] [--data-dir DIR] [--port PORT]` | Show UI, personal graph, and shared-service status; `--json` emits machine-readable output |
328
+ | `fuli open [--data-dir DIR]` | Open the current management UI in the default browser |
329
+ | `fuli update [setup options]` | Update the npm package and refresh local integrations |
330
+ | `fuli uninstall [--yes] [--data-dir DIR]` | Remove agent integrations and services while preserving knowledge data and Neo4j volumes |
331
+
332
+ Common commands:
196
333
 
197
334
  ```bash
198
335
  fuli --version
@@ -202,115 +339,146 @@ fuli start --lan
202
339
  fuli stop
203
340
  ```
204
341
 
205
- `start`、`restart` 和 `setup` 支持 `--data-dir DIR`、`--personal-space NAME`、
206
- `--port PORT` 等选项。`start` 和 `restart` 还支持显式的 `--lan`:管理界面会监听
207
- 私有 IPv4 局域网地址,并在终端输出可访问地址、用户名 `fuli` 和本次启动生成的临时访问
208
- 口令。默认启动仍只监听 `127.0.0.1`;内部 Provider、Neo4j Browser 和 Bolt 不会随
209
- `--lan` 开放。局域网模式使用 HTTP Basic Auth,只适合可信家庭或办公 Wi-Fi,不等同于
210
- HTTPS 公网部署。
342
+ `start` and `restart` accept `--data-dir DIR`, `--personal-space NAME`, `--port PORT`, `--open`,
343
+ `--rebuild`, `--lan`, and `--no-lan`. When port or LAN flags are omitted, the saved Settings values
344
+ are used. LAN mode listens on private IPv4 addresses and prints the reachable URLs, the
345
+ `fuli` username, and a temporary access code generated for that start. The default remains
346
+ loopback-only; internal Providers and Neo4j ports are never exposed by `--lan`. LAN mode uses
347
+ HTTP Basic Auth and is intended only for trusted home or office Wi-Fi, not public deployment.
211
348
 
212
- `setup` 还支持:
349
+ `setup` and `update` accept:
213
350
 
214
- | 选项 | 用途 |
351
+ | Option | Purpose |
215
352
  | --- | --- |
216
- | `--yes` | 跳过确认,适合无人值守执行 |
217
- | `--codex-only` | 只接入 Codex |
218
- | `--skip-agents` | 不修改 Agent 配置或 Skills |
219
- | `--no-start` | 初始化 Provider,但不启动管理界面 |
220
- | `--personal-only` | 只使用个人 Provider;默认模式 |
221
- | `--with-dev-public` | 同时启动开发用公共 Provider,仅用于开发或联调 |
222
-
223
- 更新:
353
+ | `--yes` | Skip confirmation for unattended setup |
354
+ | `--codex-only` | Configure Codex only |
355
+ | `--data-dir DIR` | Use a specific data and configuration directory |
356
+ | `--personal-space NAME` | Set the personal-space name; defaults to `Personal` |
357
+ | `--port PORT` | Set the management UI port; defaults to `2727` |
358
+ | `--skip-agents` | Do not change agent configuration or Skills |
359
+ | `--no-start` | Initialize the Provider without starting the UI |
360
+ | `--personal-only` | Use only the personal Provider; this is the default |
361
+ | `--with-dev-public` | Start a development shared Provider for local integration work only |
362
+
363
+ Update:
224
364
 
225
365
  ```bash
226
366
  fuli update
227
367
  ```
228
368
 
229
- 更新会先确认不会降级,再停止旧服务、安装 `fuli-context@latest` 并刷新 Agent 接入。
230
- 既有知识、配置备份和 Neo4j 数据卷会保留。使用过自定义 setup 选项时,更新时应继续传入
231
- 相同选项。
369
+ The update flow verifies that it will not downgrade the installation, stops the old services,
370
+ installs `fuli-context@latest`, and refreshes agent integrations. Existing knowledge, configuration
371
+ backups, and Neo4j volumes remain intact. Reuse any custom setup options during updates.
232
372
 
233
- 卸载:
373
+ Uninstall:
234
374
 
235
375
  ```bash
236
376
  fuli uninstall
237
377
  npm uninstall --global fuli-context
238
378
  ```
239
379
 
240
- 自动卸载不会永久删除个人图谱,避免误删。重新安装后可以继续使用原数据。
380
+ Automated uninstall does not permanently delete the personal graph, which allows a later install to
381
+ reuse the same data.
241
382
 
242
- ## Agent 接入与主要工具
383
+ ## Agent integrations and primary tools
243
384
 
244
- Fuli 为支持的 Agent 安装 `capturing-session-knowledge` 和 `grilling-project` Skills。Claude
245
- Code 使用 `UserPromptSubmit` 和 `Stop` Hook 接入任务生命周期;Codex 的用户级
246
- `AGENTS.md` 与 Cursor 指令使用 Prompt fallback。偏好正文始终以本机 Fuli 为唯一来源,
247
- 不会复制到 Agent 配置中。
385
+ Fuli installs the `capturing-session-knowledge`, `grilling-project`, and `flreview` Skills for
386
+ supported agents. `/flreview` asks FULI for ranked candidates, then the invoking Agent generates a
387
+ fresh interactive review artifact. FULI remains the durable source of truth and write surface; no
388
+ permanent review tab or one-question-at-a-time chat flow is required.
389
+ Claude Code uses `UserPromptSubmit` and `Stop` hooks for the task lifecycle. Codex's user-level
390
+ `AGENTS.md` and Cursor instructions use prompt fallback. Preference content remains in local Fuli as
391
+ the single source of truth and is not copied into agent configuration.
248
392
 
249
- | 工具 | 用途 |
393
+ | Tool | Purpose |
250
394
  | --- | --- |
251
- | `begin_task_context` | Hook 入口:创建任务令牌并返回生效上下文 |
252
- | `get_collaboration_preferences` | Fallback 入口:读取全局与精确项目偏好 |
253
- | `search_current_project_knowledge` | 子项目优先、按授权关系向上检索 |
254
- | `search_knowledge_graph` | 在明确的有界范围内执行更通用的查询 |
255
- | `record_knowledge_usage` | 记录真正影响结果的引用或应用 |
256
- | `record_knowledge_feedback` | 保存拒绝、验证失败、冲突或过时证据 |
257
- | `record_decision_trace` | 保存选择、被拒方案、理由和可选初始验证 |
258
- | `capture_session_knowledge` | 批量写入少量、结构化的候选知识 |
259
- | `checkpoint_task_knowledge` | 以 `capture_candidates` 或 `retain_nothing` 结束知识检查 |
260
- | `discover_common_knowledge_candidates` | 只读发现可能属于上级项目的公共候选 |
261
- | `preview_common_knowledge_promotion` | 预览人类确认的公共知识提升 |
262
- | `apply_common_knowledge_promotion` | 使用一次性令牌原子执行提升 |
263
- | `resolve_deferred_preference_conflict` | 在实际需要时处理已授权给 AI 的冲突 |
264
-
265
- ## 隐私与安全边界
266
-
267
- - 个人知识写入本机 Provider;
268
- - Agent 归纳结构化知识,不保存原始会话;
269
- - Token、Cookie、私钥、凭据、私人联系信息、临时日志和原始命令输出不得进入图谱;
270
- - Graphiti 远程 LLM 路径被禁用,当前嵌入在本机计算;
271
- - 搜索按个人空间和项目范围限定,不默认混入所有项目;
272
- - 公共提升需要可审计的人工确认,Agent 自己的使用证据最多晋级为
273
- `agent_confirmed`;
274
- - Fuli 不是实时监控或 Git 服务,实时状态应从对应系统重新读取。
275
-
276
- ## 本机服务
277
-
278
- | 服务 | 默认地址 |
279
- | --- | --- |
280
- | 个人 Neo4j Browser / Bolt | `127.0.0.1:7474` / `127.0.0.1:7687` |
281
- | 个人 Provider | `127.0.0.1:8787` |
282
- | Fuli 管理界面 | `127.0.0.1:2727` |
283
-
284
- 需要同一 Wi-Fi 下的其他设备访问时,执行 `fuli start --lan`。若当前已经以本机模式运行,
285
- 命令会安全重启管理界面并保持 Provider 与图谱数据不变。退出局域网模式可执行
286
- `fuli restart`;再次进入局域网模式会更换临时访问口令。
287
-
288
- 如果端口被占用、Docker Compose 不可用或容器引擎未启动,setup 会在修改 Agent 配置前停止
289
- 并报告原因。
290
-
291
- ## 验收与源码开发
395
+ | `begin_task_context` | Hook entry: resolve the task, run bounded recall when signaled, and create a task token |
396
+ | `get_collaboration_preferences` | Fallback entry: read effective preferences and bounded task recall |
397
+ | `search_current_project_knowledge` | Search the child first, then authorized knowledge sources |
398
+ | `search_knowledge_graph` | Run a general query within an explicit bounded scope |
399
+ | `search_connected_knowledge` | Search the graph, project-bound read-only sources, and selected public projects without merging provenance |
400
+ | `record_knowledge_usage` | Record a citation or application that materially affected the result |
401
+ | `record_knowledge_feedback` | Preserve rejection, failed validation, contradiction, or stale evidence |
402
+ | `record_decision_trace` | Store options, rejected alternatives, rationale, and optional initial validation |
403
+ | `capture_session_knowledge` | Store a small structured batch of durable candidates |
404
+ | `checkpoint_task_knowledge` | Complete review with `capture_candidates` or `retain_nothing` |
405
+ | `discover_common_knowledge_candidates` | Read-only discovery of possible parent-project knowledge |
406
+ | `preview_common_knowledge_promotion` | Preview a human-confirmed promotion |
407
+ | `apply_common_knowledge_promotion` | Apply the preview atomically with a one-time token |
408
+ | `resolve_deferred_preference_conflict` | Resolve an AI-deferred conflict only when a task needs it |
409
+ | `start_knowledge_review` | Start or resume an exact personal review scope |
410
+ | `list_knowledge_review_candidates` | Rank candidates by time, conflicts, weight, and cross-session repetition |
411
+ | `record_knowledge_review_progress` | Save keep, update, invalidate, skip, or defer outcomes |
412
+ | `finish_knowledge_review` | Pause, or complete and advance the next-review watermark |
413
+
414
+ ## Privacy and safety boundaries
415
+
416
+ - Personal knowledge is written to the local Provider.
417
+ - Agents distill structured knowledge instead of storing raw transcripts.
418
+ - Tokens, cookies, private keys, credentials, private contact details, temporary logs, and raw command
419
+ output must not enter the graph.
420
+ - Graphiti's remote-LLM path is disabled; embeddings are currently computed locally.
421
+ - Searches are bounded by personal space and project scope instead of mixing every project.
422
+ - External connectors never write to third-party sources; raw credentials are rejected from stored
423
+ binding configuration.
424
+ - Shared promotion requires auditable human confirmation. Agent usage evidence can promote an item
425
+ only as far as `agent_confirmed`.
426
+ - Fuli is not a real-time monitoring or Git service; current state must be read from the relevant
427
+ source system.
428
+
429
+ ## Local services
430
+
431
+ | Service | Default loopback address | Availability |
432
+ | --- | --- | --- |
433
+ | Fuli management UI | `127.0.0.1:2727` | Always |
434
+ | Personal Provider | `127.0.0.1:8787` | Always |
435
+ | Personal Neo4j Browser / Bolt | `127.0.0.1:8060` / `127.0.0.1:7687` | Always |
436
+ | Development shared Provider | `127.0.0.1:8788` | `--with-dev-public` only |
437
+ | Development shared Neo4j Browser / Bolt | `127.0.0.1:7475` / `127.0.0.1:7688` | `--with-dev-public` only |
438
+
439
+ These seven ports can be changed in Settings. Provider and Neo4j bindings remain loopback-only even
440
+ when the management UI is started in LAN mode.
441
+
442
+ To access the UI from another device on the same Wi-Fi, run `fuli start --lan`. Starting LAN mode
443
+ from a loopback-only runtime safely restarts only the management UI and preserves Provider and
444
+ graph data. Disable LAN in Settings and run `fuli restart`, or run `fuli restart --no-lan`, to return
445
+ to loopback-only mode. Starting LAN mode again rotates the temporary access code.
446
+
447
+ If a port is occupied, Docker Compose is unavailable, or the container runtime is not running,
448
+ setup stops before modifying agent configuration and reports the cause.
449
+
450
+ ## Acceptance and development
292
451
 
293
452
  - [Alignment Benchmark](FULI_ALIGNMENT_BENCHMARK.md)
294
- - [中文验收索引](acceptance/README.md)
295
- - [知识检索与确认流程图](acceptance/知识检索与确认流程图.md)
453
+ - [Chinese acceptance index](acceptance/README.md)
454
+ - [Knowledge retrieval and confirmation diagrams](acceptance/知识检索与确认流程图.md)
455
+ - [Read-only external-knowledge architecture](docs/external-knowledge-architecture.md)
296
456
 
297
457
  ```bash
298
458
  npm install
299
459
  npm test
300
460
  npm run test:package
461
+ npm run test:external-knowledge:live
301
462
  ```
302
463
 
303
- Provider 验证:
464
+ The external-knowledge live test temporarily downloads two public official documentation
465
+ repositories, validates read-only synchronization and retrieval, then removes the complete
466
+ temporary directory. It is network-dependent and is not part of the default test suite.
467
+
468
+ Provider validation:
304
469
 
305
470
  ```bash
306
- python3 -m compileall -q graph-provider/fuli_graph
307
- python3 -m pytest -q graph-provider/tests
471
+ python3.12 -m venv .venv
472
+ . .venv/bin/activate
473
+ python -m pip install "./graph-provider[dev]"
474
+ python -m compileall -q graph-provider/fuli_graph
475
+ python -m pytest -q graph-provider/tests
308
476
  docker compose -f compose.graphiti.yml config --quiet
309
477
  ```
310
478
 
311
- `npm run test:package` 会构建前端、生成真实 npm tarball、安装到隔离的全局前缀,并验证
312
- `fuli` / `fl`、版本号、帮助信息和 Web UI。测试源码、QA 截图和内部设计文档不会进入 npm
313
- 包。
479
+ `npm run test:package` builds the web UI, creates a real npm tarball, installs it into an isolated
480
+ global prefix, and verifies `fuli` / `fl`, version output, help output, and the packaged UI. Tests,
481
+ QA screenshots, and internal design documents are excluded from the npm package.
314
482
 
315
483
  ## License
316
484