Open
Conversation
Add a Knowledge Base feature that allows users to mount local Markdown folders as memory search sources for OpenClaw, with Git-based bidirectional synchronization support. Main changes: - Add knowledge-base.ts backend module for config, Git ops, and OpenClaw memorySearch.extraPaths integration - Register 7 IPC handlers (select-folder, list, statuses, add, remove, set-git, sync) in ipc-handlers.ts - Expose knowledge base API methods in preload bridge - Add KnowledgeBasePage.tsx with folder selection, Git config, sync button, status display, and usage instructions - Add navigation item and route for /knowledge - Add KnowledgeBase types to electron.d.ts - Add knowledge-base-sync to OpenClawGuardedWriteReason - Add tooltip entries for knowledge base UI elements Key design decisions: - Use absolute paths in memorySearch.extraPaths instead of symlinks (OpenClaw ignores symlinks in extraPaths) - Auto-inject AGENTS.md instructions for AI to use memory_search - Smart Git remote resolution (match by URL > tracking upstream > single remote > fallback to origin) - Detect both uncommitted and unpushed changes for sync
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
新增知识库管理功能,允许用户将本地 Markdown 文件夹挂载为 OpenClaw 的
memorySearch.extraPaths记忆检索源,并支持通过 Git 进行双向同步(拉取远端更新 & 推送本地修改)。核心设计决策:
extraPaths(OpenClaw 会忽略软链接)AGENTS.md,引导 AI 使用memory_searchorigin变更类型
影响范围
electron/main/)knowledge-base.ts:知识库配置管理、Git 操作、extraPaths集成(+689 行)ipc-handlers.ts:注册 7 个 IPC Handler(select-folder、list、statuses、add、remove、set-git、sync)electron/preload/)index.ts:在 preload bridge 中暴露知识库 APIsrc/)src/pages/KnowledgeBasePage.tsx:文件夹选择、Git 配置、同步按钮、状态展示、使用说明(+451 行)src/App.tsx:新增/knowledge路由src/components/MainLayout.tsx:新增导航入口src/types/electron.d.ts:新增 KnowledgeBase 相关类型定义src/shared/openclaw-phase2.ts:新增knowledge-base-sync到OpenClawGuardedWriteReasonsrc/constants/tooltips.json:新增知识库 UI 元素 tooltip 文案测试
npm run typechecknpm testnpm run dev验证功能截图 / 录屏
补充说明
memorySearch.extraPaths需 OpenClaw 版本支持该配置项,否则挂载路径不生效