docs: fix documentation-source mismatches across all doc files

- Go version: 1.19+/1.21+ → 1.25+ (matches go.mod)
- document/doc.go → document/document.go (actual filename)
- PluginSDK: 3 channels → 4 channels (add RegisterOutputChannel)
- InjectInput/InjectInterrupt: 3 params → 4 params (add eventType)
- RegisterChannel: document agentIO.Device interface requirement
- Architecture: remove non-existent snapshot/tokenizer dirs, add skill/meta
- Architecture: fix double internal/internal/sdk, fix Jaccard threshold
- Adapter: add http_get/http_post Lua VM built-ins
- Knowledge: 4-layer → 3-layer memory, CGO for go-sqlite3 not overlayfs
- Code structure tree: fix sdk/ and lua/adapters/ path consistency
This commit is contained in:
root
2026-07-16 23:17:55 +08:00
parent 121a2edbc5
commit dd01388e76
11 changed files with 64 additions and 36 deletions

View File

@ -123,8 +123,8 @@ TF-IDF 是贯穿三层记忆的核心算法,在 4 个独立位置以不同方
| 位置 | 文件 | 用途 | 算法 |
|------|------|------|------|
| Context Prune | `context.go:162` | 裁剪低相关性上下文事件 | CosineSimilarity(queryVec, evt.Vector) |
| DocStore Query | `document.go:205` | 从文档记忆召回相关内容 | InvertedIndex + CosineSimilarity |
| Context Prune | `context.go:161` | 裁剪低相关性上下文事件 | CosineSimilarity(queryVec, evt.Vector) |
| DocStore Query | `document.go:198` | 从文档记忆召回相关内容 | InvertedIndex + CosineSimilarity |
| Indexer 实体搜索 | `indexer.go:149` | 从Graph召回相关实体 | InvertedIndex + CosineSimilarity |
| 实体相似度检测 | `agent.go:2297` | 检测Graph中相似实体 | Bigram Jaccard (>0.75 → consolidation) |
@ -136,7 +136,7 @@ TF-IDF 是贯穿三层记忆的核心算法,在 4 个独立位置以不同方
### Document 层
`internal/memory/document/doc.go``Store`
`internal/memory/document/document.go``Store`
- 消费即删模式:`doc_query` 检索到后删除
- TF-IDF 索引 character bigram + 倒排
@ -185,7 +185,7 @@ TF-IDF 是贯穿三层记忆的核心算法,在 4 个独立位置以不同方
selfInputCh → LLM 判断合并/跳过
```
实体冲突检测启发式bigram Jaccard > 0.5),走 `selfInputCh` 内部通道LLM 最终判断是否合并。
实体冲突检测启发式bigram Jaccard > 0.75`selfInputCh` 内部通道LLM 最终判断是否合并。
## 知识库
@ -366,7 +366,7 @@ internal/
│ ├── agentcli/ — PTY 终端
│ ├── healthcheck/ — 健康检查
│ └── pluginmgr/ — 插件管理器
├── internal/sdk/ — PluginSDK 定义
├── sdk/ — PluginSDK 定义
│ ├── plugin.go — Plugin 接口 + PluginSDK
│ ├── memory.go — MemoryAPI
│ ├── knowledge.go — KnowledgeAPI
@ -376,7 +376,7 @@ internal/
│ ├── graph.go — SQLite 图数据库
│ ├── indexer.go — 图→向量索引
│ ├── vector/store.go — TF-IDF 向量引擎
│ ├── document/doc.go — 文档记忆
│ ├── document/document.go — 文档记忆
│ ├── text/text.go — 文本日志
│ └── pipeline/ — 蒸馏器
├── knowledge/knowledge.go — 知识库
@ -387,6 +387,8 @@ internal/
├── events/bus.go — 事件总线
├── tracker/ — OverlayFS 变更追踪
├── supervisor/ — 守护进程管理
├── snapshot/快照
└── tokenizer/ — 中文分词 (jieba 包装)
├── skill/ Skill 插件管理
│ └── manager.go — Skill 加载/匹配
└── meta/ — 元信息
└── meta.go — Agent 元数据
```