diff --git a/assets/docs/en/ARCHITECTURE.md b/assets/docs/en/ARCHITECTURE.md index 127c651..6bd40b2 100644 --- a/assets/docs/en/ARCHITECTURE.md +++ b/assets/docs/en/ARCHITECTURE.md @@ -90,8 +90,8 @@ Setting `ctx.Response` at any stage jumps to `after_output`. RelevanceContext — In-memory events[] + JSON persistence Append: Each input, CleanTemplateText → three-branch vector(textForVector) agent→Response, user→Input, cold_storage→Input+Response - StaticEmbedder pretrained word embedding / TF-IDF fallback - Prune: StaticEmbedder CosineSimilarity, keep topK + last 10 + Vector layers: unified multimodal space (primary, with fingerprint) → StaticEmbedder word embedding → TF-IDF (fallback) + Prune: DenseCosine (compared only within the same fingerprint) → StaticEmbedder CosineSimilarity fallback; keep topK + last 10 ├── Keep → timeline → chronologically sorted → system prompt └── Low score → Document layer archive (original timestamp) Save: 5s debounce write to disk @@ -99,7 +99,7 @@ Setting `ctx.Response` at any stage jumps to `after_output`. ↓ Prune archive ↑ LLM active recall ② Document (File Memory) - DocStore — JSON files + shared StaticEmbedder vector space with Context (fallback: TF-IDF InvertedIndex) + DocStore — JSON files + dense vectors (unified multimodal space; dense_fp must match the current space fingerprint or the doc is recomputed; fallback: StaticEmbedder / TF-IDF InvertedIndex) Write: Prune archive / doc_commit / Graph snapshot (syncGraphToDocs) Read: ├── Auto-inject: Query(input, top3) → similarity summary under same vector space → [Related Memory Docs] → system prompt (read-only) diff --git a/assets/docs/zh/ARCHITECTURE.md b/assets/docs/zh/ARCHITECTURE.md index aaa9459..8e9f771 100644 --- a/assets/docs/zh/ARCHITECTURE.md +++ b/assets/docs/zh/ARCHITECTURE.md @@ -90,8 +90,8 @@ eventLoop() → processTextInput() RelevanceContext — 内存 events[] + JSON持久化 Append: 每次输入, CleanText → 三分支向量(textForVector) agent事件→Response, 用户事件→Input, cold_storage→Input+Response - StaticEmbedder 预训练词嵌入 / TF-IDF 回退 - Prune: StaticEmbedder CosineSimilarity, 保留 topK + 最近10条 + 向量层级:统一多模态空间(主,带 fingerprint)→ StaticEmbedder 词嵌入 → TF-IDF(回退) + Prune: DenseCosine(仅同指纹才比较)→ 退化 StaticEmbedder CosineSimilarity;保留 topK + 最近10条 ├── 保留 → timeline → 按时间排序 → system prompt └── 低分 → Document 层归档 (原始时间戳) Save: 5s debounce 写盘 @@ -99,7 +99,7 @@ eventLoop() → processTextInput() ↓ Prune 归档 ↑ LLM 主动召回 ② Document (文件记忆) - DocStore — JSON文件 + 与 Context 共享的 StaticEmbedder 向量空间(兜底: TF-IDF InvertedIndex) + DocStore — JSON文件 + 稠密向量(统一多模态空间;dense_fp 须与当前空间同指纹,不符即重算;兜底: StaticEmbedder / TF-IDF InvertedIndex) 写入: Prune归档 / doc_commit / Graph快照(syncGraphToDocs) 读取: ├── 自动注入: Query(input, top3) → 同一向量空间下相似度摘要 → 【相关记忆文档】→ system prompt (只读)