/** * 模块: 知识库语料(KB Corpus) * * 设计原则(非侵入 + 职责分离): * - 把 huo15-openclaw-openai-knowledge-base 技能的**共享知识库** wiki 挂为 * 龙虾原生 memory 的 corpus supplement(corpus="kb")。 * - 只读源:扫描 ~/.openclaw/kb/shared/wiki/*.md,不写入。 * - 与 enhance-memory 解耦: * L2 enhance-memory:结构化「规则/为什么」(短条目) * L3 KB wiki:长文档「事实/资料」(整篇 MD) * - 不处理 agent-scope kb(那是 per-agent 私有,不跨 agent 共享,不入 corpus)。 * * Public API 对接(openclaw 2026.4.11): * api.registerMemoryCorpusSupplement(supplement) — 单参 */ import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; export interface KbCorpusConfig { enabled?: boolean; /** 共享 KB 根目录,默认 ~/.openclaw/kb/shared */ sharedKbPath?: string; /** 相关性阈值(0-1),低于此分数不返回,默认 0.3(KB 门槛低于 memory) */ threshold?: number; /** 单次 search 最多返回几条,默认 5 */ maxResults?: number; debug?: boolean; } export declare function registerKbCorpus(api: OpenClawPluginApi, options?: KbCorpusConfig): void;