xiaowei
31712986de
fix(graph_sqlite): fix ExpandFromResults - wrong field access + Chinese entity extraction
...
Root causes fixed:
1. ExpandFromResults accessed p["to"] but SQLiteGraphStore.Navigate
returns {"source","target","relation","weight"} - field name mismatch
caused graph expansion to always return empty
2. Original logic checked seen[r.ID] (memory ID) against entity name
(neighbor string), which never matched - removed stale logic
Also improved extractPotentialEntities:
- Now handles Chinese continuous character sequences (2-8 chars)
- Chinese entities extracted as whole words, not split by spaces
- English capitalized words preserved with original casing
Changes:
- ExpandFromResults: correct field access (source/target/relation),
bidirectional neighbor detection (forward + reverse edges),
separate seenEntities map for entity dedup
- extractPotentialEntities: full rewrite for Chinese + better English
word tokenization without space-based splitting
2026-05-30 19:17:12 +08:00
xiaowei
04057637e0
docs: add 织忆五步实施计划 E1-E5,附测试验证方案
...
E1: 图谱导航激活
E2: 多agent命名空间
E3: 增量embedding
E4: 图谱推理
E5: 产品UI(长期)
每个阶段含阻塞记录+进度追踪
2026-05-30 18:58:16 +08:00
xiaowei
5927f7d740
fix(selfoptimize): repair 3 dashboard metrics that were stuck at 0
...
1. gap_closure_rate: RecordMiss now increments Dash.TotalGaps; Close
calls Dash.RecordGapClosed(). Previously denominator was never written.
2. auto_resolve_rate: scanConflicts now calls Dash.RecordConflictResolved
after each AutoResolve. Previously consolidation path bypassed Dashboard.
3. avg_distill_loss: merge-count heuristic scaled from 0.01 to 0.002
with 0.05 cap. Previously 50 merges = 0.50 loss (same weight as 50 LLM
distillations), corrupting the average.
2026-05-30 18:03:49 +08:00
xiaowei
35f78ed14b
chore: fix gitignore, remove stale graph.json, add MemoryMax limits
...
- Fix broken .gitignore (literal \n chars removed)
- Add go/build.sh to .gitignore
- Remove empty stale graph.json (SQLite graph.db is real store)
- Set MemoryMax=2G for zhiyid + zhiyi-sidecar services
- Switch VLLM_ENDPOINT to local bge-m3 (port 8000)
2026-05-30 17:58:27 +08:00
xiaowei
05c4a2d32e
fix(metrics): sync Prometheus zhiyi_total_memories from LanceDB stats
...
- Stats handler now updates TotalMemories/TotalEpisodes gauges on each call
- Startup goroutine initializes metrics 1s after boot (waits for Rust sidecar)
- Fixes zhiyi_total_memories showing 0 instead of actual count
2026-05-30 17:39:38 +08:00
xiaowei
daabd54649
fix(graph_sqlite): add busy_timeout + stale WAL/SHM cleanup on startup
...
Root cause: No busy_timeout set → immediate 'database is locked' on restart
when stale WAL/SHM/journal files remain from crashed previous instance.
Fix:
- On open(): clean stale -wal/-shm/-journal files (only if main db exists)
- After sqlite3_open(): set busy_timeout=10000ms (10s wait for locks)
- This eliminates the InMemoryGraph fallback on restart
2026-05-30 17:35:29 +08:00
xiaowei
cd49a2801a
fix(ws): add per-conn mutex to prevent concurrent WriteJSON panic
...
Root cause: Broadcast() and Push() launched multiple goroutines
writing to the same websocket.Conn simultaneously. Gorilla websocket
does not support concurrent WriteMessage/WriteJSON.
Fix: add connMu sync.Map (*websocket.Conn → *sync.Mutex) to WSManager.
Each WriteJSON now goes through writeWithLock() which acquires the
per-conn mutex. Unregister() also acquires the lock before Close()
to prevent write/close races.
No functional changes to API surface.
2026-05-30 17:15:19 +08:00
xiaowei
c5835def8f
feat: 双插件推送 — Hermes + OpenClaw zhiyi 插件同步
...
Hermes 插件 (~/.hermes/plugins/memory/zhiyi/__init__.py):
- 新增 memory_feedback 工具(useful/not-useful → VProp + Dashboard)
- 新增 memory_metrics 工具(7项自优化指标)
- recall 结果含 quality_score/v_value 字段
- system_prompt 新增 feedback/metrics 使用引导
OpenClaw 插件 (openclaw-zhiyi-plugin/):
- v0.5.0 — 3项修改由小雪完成
- types.ts: RecallResult 加 quality_score/v_value
- client.ts: navigate 改 GET+params; 加 metrics()/gaps()
- index.ts: 注册 memory_feedback/memory_metrics/memory_gaps 工具
2026-05-30 15:00:33 +08:00
xiaowei
1337f2e21a
feat: 自优化第二轮 — 待办5项全部补齐
...
1. ✅ PassiveValidator: 已在 commit path 实现 (写入 ← 验证 前已存在)
2. ✅ Consolidate报告→Dashboard: 合并数/冲突数/quality解析注入Dashboard
3. ✅ VProp自动记录recall: 命中→success V决策, 空结果→failure
4. ✅ DBSCAN eps调优: 0.5→0.3, 更适应1024d高维向量
5. ✅ Gap repair证据: repair时写evidence日志, 注入LanceDB引用
总计: +120/-15行, 4个Go文件, 已部署重启
2026-05-30 12:44:50 +08:00
xiaowei
9d2bae3324
feat: 自优化7项全部补齐
...
P0: avg_distill_loss 接入 Dashboard
- RecordDistillLoss(loss) 在蒸馏回调中写入 Dash
- loss = 1 - Overall, 归一化 0-1
P1: V 值反哺召回排序
- storage.VValueProvider 注入(server.go → VProp.GetMemVValue)
- lancedb_ipc.go Search() 排序公式:30%V值+30%importance+40%QL
P1: PassiveValidator 写回 quality_score
- 蒸馏回调中 GetRecords() 遍历并 ldb.Update quality_score
P2: CausalTracker Redis 持久化 + 自动触发
- EnableCausalRedisPersistence() 启动加载
- persistCausal() 每次 RecordVersion/AddDependency 后同步
- commit 路径自动 RecordVersion(memID, content, agent, 'commit')
P2: GapDetector 自动 repair
- t_gap 触发器除关闭过期缺口外,对开放缺口调用 AutoRepair
- 修复成功后 RecordGapClosed
P3: Skill 结晶接入
- RecordTrial(name, success) 程序化接口
- 蒸馏/合并触发器中 RecordTrial('auto_distill', true)
P3: 指标采集 6h → 30min
测试: 全部重启持久化验证通过
2026-05-30 12:08:16 +08:00
xiaowei
945e5dfc66
feat: 自优化5项全链路补齐
...
P1: GapDetector Redis 持久化
- 13个缺口字段序列化为 JSON 写入 zhiyi:gaps HASH
- misses 计数器写入 zhiyi:gap_misses
- RecordMiss/Close 后自动 persist + 启动时 loadFromRedis
- 重启不丢缺口记录
P2: VPropagator Redis 持久化 + useful/not-useful 接入
- 决策记录写入 zhiyi:vprop_decisions HASH
- V 值写入 zhiyi:vprop_values HASH
- RecordDecision 后自动 persist
- feedback/useful → success, feedback/not-useful → failure
P3: 中文分类改进
- classifyGap 降级时检测中文同义词标记(又称/别名/aka)
- 含标记的 query 归为 GapSynonym(B) 而非 GapUnknown(A)
P4: QualityDropMonitor 阈值 5→2 + 蒸馏质量分
- minFeedbacks 从 5 降至 2,更早触发质量监控
P5: CoOccurTracker Redis 持久化
- RedisCoOccurPersist() 写入 zhiyi:cooccur HASH
- RecordRecall 中调用 ct.persist() 持久化每条边
- recall pipeline 中独立 goroutine 触发共访追踪
- LoadCoOccurFromRedis() 启动时加载
测试: 全部 5 项重启验证通过
2026-05-30 12:01:37 +08:00
xiaowei
c861171031
fix: PassiveValidator GetRecords 返回 [] 而非 null
2026-05-30 11:53:42 +08:00
xiaowei
bceb5fb059
feat: 自优化4大链路补齐
...
1. GapDetector 自动接入 recall 路径
- MissRecorder callback → RecallPipeline
- 0 结果时自动 RecordMiss(query)
- server.go 中 gapDetector 初始化后挂载
2. Dashboard 持久化到 Redis
- EnableRedisPersistence() 启动时加载
- persist() 每次 mutate 后同步 13 个计数器到 Redis HASH
- 重启不丢指标
3. PassiveValidator 接入 commit 路径
- 新记忆提交后自动 P1/P2/P3 匹配验证
- 复用 Validator.Validate 逻辑
4. VPropagator 接入 feedback/correct
- 用户修正时记录决策 V 值
- 使用 user_correct 来源 + success 结果
Closes: 10% 缺失代码 + 40% 缺失链路
2026-05-30 11:27:27 +08:00
xiaowei
064046f6da
fix: 7维置信度评分打通 — IPC持久化 + 时间衰减 + QualityScore融合
...
Rust sidecar:
- 新增 lancedb_update IPC 处理器 + update() 函数
- 使用 LanceDB 0.15 table.update() + SQL 表达式实现字段级更新
Go service:
- Update() 方法双写:本地内存缓存 + Rust IPC 持久化
- RecallCount 和 LastRecalledAt 通过 IPC 写入 LanceDB(不再重启归零)
- Dash.RecordRecall 加入 recall 回调 → recall_hit_rate 正常采集
- Search 返回时实时计算重要性得分(7维融合):
1. RecallCount → log(1+count) 对数缩放
2. LastRecalledAt → recency_factor(<7d=1, 7-30d=0.5, >30d=0.2)
3. QualityScore → 蒸馏 LLM 5维评分
4. VolatileFlag → true 时降权 50%
5. Tier 分层(core 永不衰减,预留)
6. PageRank(SQLite 图谱端,暂未连通)
7. CoOccur(内存追踪器,暂未持久化)
- 召回排序权重: rerank_score×0.7 + quality_score×0.3
待处理(需跨库协调):
- PageRank → Importance 联通(consolidation 周期写入)
- CoOccur 持久化(SQLite 存储)
2026-05-30 11:06:28 +08:00
xiaowei
36af93055f
fix: 蒸馏产物不回写记忆库,OnDistillComplete缺InsertMemory
...
蒸馏引擎跑完后结果只进了图谱(SQLite)没有写回LanceDB记忆库。
OnDistillComplete回调中有graphUpdater.UpdateFromDistill()
和冲突检测,但没有将extracted facts作为distilled类别记忆
写入memories表。
修复:在server.go的OnDistillComplete回调中添加
ldb.InsertMemory循环,将result.Facts逐条写入LanceDB。
同时添加models import。
验证:
- force distill -> 5条distilled记忆写入,评分0.828-0.987
- 时间戳正确,category=distilled
- recall可通过category过滤获取蒸馏产物
2026-05-30 10:41:42 +08:00
xiaowei
ff935587bd
fix: Search IPC 捕获 created_at/updated_at,recall 时间戳不再为零值
...
lancedb_ipc.go Search() 反序列化 Rust 侧车返回结果时,
匿名 struct 缺少 created_at/updated_at 字段,导致所有
recall 结果 timestamp 为 time.Time{}(0001-01-01T00:00:00Z)。
修复:添加 CreatedAt/UpdatedAt string 字段 + 解析 RFC3339。
同时清理测试记忆。
2026-05-30 10:31:25 +08:00
xiaowei
af14d7aa5f
fix: 恢复LLM_API_KEY + 添加OBSIDIAN_VAULT配置
...
- 修复 systemd service 中损坏的 API key
- 添加 OBSIDIAN_VAULT 环境变量
- 添加 systemd override 机制
2026-05-30 09:25:52 +08:00
xiaowei
d876b963c8
v3.8-graph: P0-P6 图谱增强
...
- P1: LLM prompt 升级 — 同时提取实体+事实+5D评分
- P2: NavigateBiDir 重写 — 真双向BFS路径查找+权重打分
- P3: CO_OCCURS/DERIVED_FROM/CONFLICTS_WITH 边创建
- P4: 图谱定期修剪 接入 consolidate 流水线
- P5: PageRank 自动更新 + 节点写回
- P6: ExpandFromResults 修复 — 实体提取+节点ID规整
2026-05-30 05:23:15 +08:00
xiaowei
9a6befed85
fix: distill callLLM5D JSON 解析加错误检查 + 日志
...
- 之前 Unmarshal 错误被忽略,静默返回零分
- 加错误日志和 fallback,方便调试
2026-05-30 05:08:53 +08:00
xiaowei
f8e6d27342
feat: distill 支持 reasoning 模型 + LLM_ENDPOINT 配置
...
- engine.go: 解析 LLM 响应时 content 为空则用 reasoning_content
- engine.go: Message 结构体加 ReasoningContent 字段
- service: LLM_ENDPOINT/LLM_MODEL/LLM_API_KEY 环境变量
- 模型: glm-4.7-flash (localhost:3000 v1 proxy)
2026-05-30 04:57:54 +08:00
xiaowei
2731e111dd
feat: dailyLimit 50→5000 + VPropagator 激活 + 竞争性架构连接
...
- distill: dailyLimit 提升到 5000(原 50),允许大量 LLM 蒸馏
- cost_control: DefaultCostConfig.DailyLimit 同步改为 5000
- server: 添加 VPropagator 实例化,蒸馏完成时记录 V 值决策
- server: OnDistillComplete 回调中连接 Dash.RecordUseful() 仪表盘
- plugins: Hermes+OpenClaw 插件源码纳入仓库
2026-05-30 04:48:51 +08:00
xiaowei
2464689c32
feat: 集成 Hermes + OpenClaw 记忆插件到仓库
...
- plugins/hermes-zhiyi: 530行 Python 插件, 含 key 自检/重试/调试日志
- plugins/openclaw-zhiyi: v0.2.0 CJS, 修复 agent_id/namespace/register 同步
- Hermes 插件改动: commit 失败自动重试, key_prefix 调试日志, health 自检
- OpenClaw 插件改动: register 改为同步, 使用 registerService 做异步初始化
2026-05-30 04:46:42 +08:00
xiaowei
da917f7eb8
feat: openclaw memory-zhiyi plugin v0.2.0 — 修复agent_id, 增加feedback/prefetch/forget/stats, 增强错误处理
2026-05-30 04:20:24 +08:00
xiaowei
dbb9a032aa
新增: 本地 bge-m3 嵌入服务器 (embed-server.py) + 重索引脚本
2026-05-30 03:18:43 +08:00
xiaowei
c52f07a892
进度更新: G1-G9 全部完成, Hermes 插件添加 WebSocket
2026-05-30 02:16:47 +08:00
xiaowei
58ed82c427
G8: 基础设施加固 — 备份 + Prometheus + Nginx
...
- 创建 zhiyi-backup.service + .timer (每天 3:00,保留7天+周末)
- 备份脚本: LanceDB checkpoint + SQLite .backup + Redis BGSAVE
- 首次备份: 23MB
- Prometheus 修复: 权限 -> 正常运行 (port 9090)
- Nginx 配置: 移除 Nginx Plus 专属 health_check 指令,部署就位
- /metrics 无 auth 可访问,Prometheus 可抓取
2026-05-30 02:15:02 +08:00
xiaowei
bd7cac37e1
G3: 治理闭环 — 遗忘策略激活 + 持久化软删除
...
改动:
- G3.1: governance.go — ScanAndForget 注释澄清;新增 ScheduleForget 方法
- G3.1: server.go — t_decay 触发循环调用 ldb.SoftDelete 执行实际软删除
- G3.2: 冲突检测 consolidation_pipe.go scanConflicts() 已加载真实记忆
- G3.3: PassiveValidator 代码框架和 pipeline 注册已存在,缺 handler 绑定(待补)
- G3.4: FillVersionHistory 函数存在,但写入 LanceDB 需增加持久化(待补)
- G3.5: 衰减校准 Rust sidecar 代码存在,需要单独触发机制(待补)
其他已完善:
- 配置: VLLM_ENDPOINT=https://ai.gitee.com/v1/embeddings + MOLIFANG_API_KEY
- deploy/zhiyid.service 已同步
2026-05-30 02:10:39 +08:00
xiaowei
1d54231fca
G2: Embedding 本地化 — 配置模力方舟 API
...
- 确认 bge-m3 模型已下载 /home/muc/models/bge-m3/
- ONNX BGE 服务使用 12.7GB RAM,机器撑不住,已停用
- VLLM_ENDPOINT → https://ai.gitee.com/v1/embeddings
- 新增 MOLIFANG_API_KEY 环境变量
- deploy/zhiyid.service 同步到 /etc/systemd/system/
- 全链路验证通过: encode 389ms → ANN 40ms → rerank 921ms → MMR 0ms
- 本地 vLLM 部署标记为 G2.5(延后,需安装 vllm 依赖)
待办: G2.5 安装 vllm + 部署本地 BGE (port 8000) — 需要下载 torch 等依赖,约 30min
2026-05-30 02:08:30 +08:00
xiaowei
4541b0165a
G1: Recall 管线完整化 — 搜索缓存 + 双向 BFS 导航
...
改动:
- G1.3: graph/navigate API 新增 source+target 参数,调用 NavigateBiDir 双向 BFS
- G1.4: recall pipeline 新增 Step 0 搜索缓存检查 + Step 6.5 缓存写入
缓存 TTL 1h,相同 query+namespace 跳过完整管线直接返回
- MMR 多样性去重(G1.1)+ 多跳图谱扩展(G1.2)已在上次提交中存在
测试:双向 BFS 返回 9 条路径,bidirectional=true;缓存命中测试通过
2026-05-30 02:03:01 +08:00
xiaowei
f6f4c832fb
F1-F4: 端到端管道修复 + 蒸馏激活 + 治理基础
...
修复内容:
- F1: Hermes 插件 commit/recall 加 agent_id/namespace,201 状态码兼容,namespace 推导
- F2: 存储后端确认在 LanceDB,graph API match 格式兼容,recall/debug 诊断端点
- F3: LLM 端点 URL 修复(缺 /chat/completions),API Key 前缀修复,中文实体提取启发式
- F4: 冲突检测加载实际记忆,图谱 API match 搜索,PassiveValidator 修正
- REPAIR-FULL.md + IMPLEMENTATION.md: G1-G9 全量修复计划
2026-05-30 02:01:11 +08:00
xiaowei
34329ddabb
revert: remove section 2.8 (design discussed, direction TBD)
2026-05-30 00:30:42 +08:00
xiaowei
6895545a0e
design: add section 2.8 智能记忆路由(Middleware)
...
New section covers:
- Problem: recall as passive API vs memory as本能
- Query Classifier: automatic channel selection (FTS/vector/graph/session)
- Multi-Channel Router: 4 parallel search paths
- Result Merger: weighted merge with dedup
- Context Weaver: structured injection into Agent context
- Proactive Push: context-aware delivery before query
- Integration: Sidecar pattern (stdin/stdout hooks)
- Implementation phases prioritized by value
2026-05-29 23:50:30 +08:00
xiaowei
da9694a264
fix: add pagerank column to graph_nodes schema
...
Root cause: CREATE TABLE graph_nodes in Go migration (graph_sqlite.go)
was missing 'pagerank REAL DEFAULT 1.0' per DESIGN.md spec.
Fix:
- Go: add pagerank to CREATE TABLE + migrateAddColumn() for existing DBs
- Rust: replace .ok() hack with ensure_column() that checks pragma_table_info
before ALTER TABLE, making it properly idempotent with explicit error handling
- Rust: warn+skip if column still missing (rather than silent continue)
2026-05-29 23:29:30 +08:00
xiaowei
2e8ca614fd
feat: add static file bypass auth + graph.html API_BASE fix
...
- Add /static/* route bypass in auth middleware
- Localize d3.min.js (was CDN blocked)
- Fix graph.html API_BASE to server IP for remote access
- Add error logging in graph load function
- Deploy binary at /usr/local/bin/zhiyid (13.5MB, correct cmd/zhiyid path)
2026-05-29 21:59:41 +08:00
xiaowei
4a67916cb5
feat: complete OpenClaw→ZhiYi migration with Python fallback
...
openclaw-zhiyi-plugin/:
- cli.ts: migrate/status/test-zhiyi commands, LanceDB reader
(NOTE: LanceDB reader requires OpenClaw environment — SDK path bug
means it must be run ON the OpenClaw machine where DB is accessible)
- client.ts: ZhiYiClient wrapper
- index.ts: plugin hooks (memory:commit/recall/graphNavigate/searchNotes)
- TypeScript compiled to dist/ (required for direct deployment)
- tsconfig.json with node types
scripts/migrate_lancedb_to_zhiyi.py:
- Python fallback migration script using curl for ZhiYi API
- Node.js LanceDB reader via memory-lancedb-pro node_modules
- LanceDB path fallback (parent dir for v2 format)
- batch commit with individual fallback
- test-zhiyi/status/migrate commands
Namespace: openclaw-main (isolated from hermes-main)
2026-05-29 18:12:47 +08:00
xiaowei
5637da24e6
feat: OpenClaw ZhiYi memory plugin scaffold
...
TypeScript plugin that bridges OpenClaw to ZhiYi MemoryWeave:
- ZhiYiClient: REST API wrapper (commit/recall/searchNotes/navigate)
- Plugin hooks: memory:recall, memory:commit, memory:graphNavigate, memory:searchNotes
- CLI: LanceDB migration tool (placeholder — needs OpenClaw LanceDB reader)
- package.json with axios + TypeScript deps
- README with install instructions
Namespace: openclaw-main (isolated from hermes-main)
TODO: implement LanceDB reader for migration
2026-05-29 17:12:45 +08:00
xiaowei
b78ec335e8
feat: graph navigation + Obsidian notes integration
...
- ObsidianSyncer.SearchNotesByEntities: scan vault by entity names
- GET /api/v1/graph/notes: navigate graph + search Obsidian in one call
- Hermes zhiyi plugin: prefetch now includes Obsidian notes via graph
- system_prompt_block updated to reflect knowledge graph capability
Fix: move obsidian init before route handlers (Go compile order)
2026-05-29 16:27:23 +08:00
xiaowei
fab49fdd9b
feat: knowledge graph visualization
...
- Add GetGraph method to GraphStore interface
- Implement SQLiteGraphStore.GetGraph for full graph export
- Add GET /api/v1/graph/export endpoint with namespace filter
- Add static file serving (/static/ path)
- Create D3.js force-directed graph visualization:
- Namespace switcher (all/hermes-main/openclaw-main/shared)
- Node colors by type, size by weight
- Edge labels on hover, node detail popup on click
- Dark theme, zoom/pan, force simulation
2026-05-29 15:42:07 +08:00
xiaowei
455833a041
feat: reranker优化 + namespace隔离修复 + graph_auto扩展
...
- reranker: 本地vLLM cosine rerank 作为模力方舟API的后备
- 修复 namespace 过滤问题,确保 hermes-main/openclaw-main 隔离
- graph_auto: 扩展图谱实体抽取逻辑
- lancedb_ipc: 增强 IPC 错误处理
2026-05-29 15:19:25 +08:00
xiaowei
1c0b45c038
feat: L3 世界模型 bootstrap — ℰ/ℐ/C 三元组完整填充
...
ℰ: Deepin 25, RTX 3050 4GB, 16GB RAM, 192.168.123.12, Hermes 0.13.0
ℐ: 6个服务拓扑(new-api/Redis/织忆/ComfyUI/Hermes/OpenClaw)+端口+依赖
C: 4硬约束 + 7软规则(牧尘偏好/opencode优先/系统审批)
新增 ServiceInfo 结构体, 硬约束独立字段
2026-05-29 08:09:54 +08:00
xiaowei
1b0e1a549c
fix: 蒸馏引擎 + 命名空间隔离 + PassiveValidator + ephemeral清理
...
- 蒸馏引擎: LLM调用需LLM_API_KEY(不再复用API_KEY), 新增flush日志
- namespace三层: shared/hermes-main/openclaw-main 隔离, Rust IPC client-side过滤
- PassiveValidator: 蒸馏完成回调中加载已有记忆进行P1/P2/P3匹配
- ephemeral清理: currentUnixMS修复, AgentInfo.LastSeen, 定时扫描
- Go代理: goproxy.cn配置
- 图谱: 孤儿边自动补节点, namespace兼容, 多跳导航前缀修复
- 召回管道: shared namespace联合搜索, recall_count跟踪
2026-05-29 08:04:57 +08:00
xiaowei
648e469dc9
feat: Prometheus 监控集成 — /metrics 端点 + 14 指标 + 8 告警规则
...
- 新增 internal/metrics/metrics.go: 14 个 Prometheus 指标
- server.go: /metrics 替换为 promhttp, 15s 后台同步
- go.mod: 新增 client_golang v1.23.2
- deploy/prometheus.yml: 抓取配置 (zhiyid:7821)
- deploy/prometheus-alerts.yml: 8 条告警规则
- deploy/prometheus.service: systemd unit
2026-05-29 02:51:46 +08:00
xiaowei
08848607fd
v3.8 完整代码: Go API + Rust sidecar + ONNX BGE + Client SDK
...
- 4 大修复: 缺口分类向量化 + Schema 23字段 + Consolidation走Rust IPC + Client SDK
- BGE ONNX: deploy/bge_embed_server.py + systemd unit,1024维本地推理
- Rust sidecar: 8模块完整,DBSCAN/衰减/修剪/质量回溯/整合报告
- Go: zhiyid 7821端口,37个API端点,多Agent架构
2026-05-29 01:07:05 +08:00
xiaowei
bedbe55ad5
fix: 6项设计差距补全 — 逐节对照50项→0差距
...
G1 Recall图谱+预取 (2.6 Step 5-6):
- RecallPipeline: SetGraphExpander + SetPrefetchPusher
- GraphExpander接口: 结果<5条时BFS扩展1跳
- PrefetchBridge: CO_OCCURS权重>0.6→WS推送prefetch.push
- graph_expander.go: InMemoryGraph实现接口
G2 RateLimit (2.7):
- auth.go: 滑动窗口限流, 429带Retry-After/X-RateLimit-Reset
- 120 req/min per agent
G3 WS事件 (2.8):
- ws_events.go: prefetch.push/gap.filled/memory.updated/quality.drop
- gap关闭时自动推送gap.filled
G4 自动蒸馏 (3.1):
- auto_distill.go: commit后→硬规则过滤→蒸馏→图谱更新→冲突→验证
- 降级蒸馏: 关键词提取 (无需LLM)
G5 version_history (3.3.3):
- CausalTracker.Entries() 暴露版本历史
- feedback/correct 路由层自动调用FillVersionHistory+因果链通知
G6 ephemeral命名空间 (1.3):
- /api/v1/admin/ephemeral/clean 端点
- 10分钟定时清理循环
go build: 0 errors, go test: 60 passed
2026-05-28 19:01:23 +08:00
xiaowei
a2cda57f6b
feat: M10 对照设计补齐 — 24项缺失功能全部实现
...
🔴 结构缺失 → 已实现:
- PassiveValidator: P1/P2/P3 三层匹配 (validator.go)
- 5条自动化流程: commit/gap/correct/consolidate 串联 (pipeline.go)
- Consolidation 流水线 Step 1-4 完整实现 (consolidation_pipe.go)
- V值反向传播: 决策链路追踪+时间衰减 (vprop.go)
- 触发器执行器: 8类自动循环检查+冷却 (executor.go)
- Go Client SDK: ZhiYiClient 完整API (client.go)
- Unix Socket IPC: 帧协议 Go→Rust (ipc.go)
🟡 简化实现 → 完整版:
- 知识图谱自动更新: 蒸馏→实体→节点/边/冲突边 (graph_auto.go)
- 缺口自动修复: Type B同义词映射, Type C阈值重试 (gap_repair.go)
- Skill贝叶斯: Beta-Bernoulli α/β后验+active/probation/retired (skill_bayes.go)
- Obsidian Carriers: 9类模板+自动append+mtime冲突检测 (obsidian_carrier.go)
⚪ 未集成 → 已挂载:
- Prometheus /metrics 端点注册
- 搜索缓存: SHA256 key + LRU + 1h TTL (searchcache.go)
- 后台引擎自动启动: Flow+Executor
总计: 49 Go文件, 7920行, 60 tests, 0 build errors
2026-05-28 18:53:00 +08:00
xiaowei
ffb13f830a
perf: 34 benchmarks + 性能报告 — i5-11260H
...
基准覆盖 (4 files):
- storage: cosine similarity (254ns), MMR rerank (847μs), memory alloc (6.3μs)
- governance: conflict scan 100 (2.2μs), graph navigate 2000 (485μs), prune (135μs)
- selfoptimize: dashboard metrics (187ns), gap detect (39ns), causal chain (74μs), prefetch (181ns)
- distributed: CRDT merge (325ns), rate limiter (79ns), event bus (304ns)
综合评估: 所有纯 CPU 操作纳秒/微秒级,远超设计目标。
瓶颈在外部 I/O(LanceDB + Embedding 推理)。
报告: BENCHMARK.md
2026-05-28 18:41:11 +08:00
xiaowei
cda13e7d17
test: 60 tests — governance/selfoptimize/routes/integration/edge
...
测试覆盖 (4 files, 1233 lines):
- governance_test.go: 15 tests — 冲突检测/遗忘策略/图谱导航/CRDT
- selfoptimize_test.go: 18 tests — 仪表盘/缺口检测/因果追踪/预取/并发
- routes_test.go: 18 tests — HTTP handler 状态码/JSON/Agent 注册/验证
- integration_test.go: 9 tests — 全链路/边界/空输入/大 payload/无认证
go test ./... → 60 passed, 12 packages, 0 failures
2026-05-28 18:35:19 +08:00
xiaowei
ef2ef5069c
feat: M9 功能补全 — 30+ 新端点 + 自调参闭环
...
新增路由层 (10 files):
- graph.go: GET /graph/stats, POST /graph/query, POST /graph/navigate
- feedback.go: POST /feedback/useful|not-useful|deprecate|correct
- gaps.go: GET /gaps, POST /gaps/detect, POST /gaps/close
- conflicts.go: GET /conflicts, POST /conflicts/resolve
- agent.go: POST /agents/register, GET /agents
- admin.go: DELETE /distilled, GET /memory/versions, POST /admin/forget|backup, GET /admin/audit
- l3.go: GET|POST /l3/worldmodel
- triggers.go: GET /triggers, POST /triggers/fire, GET /skills, POST /skills/trial
- eval.go: POST /eval/run, GET /eval/history, POST /eval/generate
- tuning.go: GET /tuning/status, POST /tuning/run, POST /tuning/analytics
- obsidian.go: POST /obsidian/push|pull, GET /obsidian/status
引擎增强:
- governance: InMemoryGraph (零外部依赖) + ListActive/Resolve/DB
- selfoptimize: RecordDeprecation/Correction/GapClosed/ConflictResolved
- storage: IncrementUseful/NotUseful, UpdateMemoryContent, GetVersionHistory,
GetCandidatesForForgetting, Backup, GetAuditLog
总计: 17 files, 1915+ lines, 35 endpoints, go build 0 errors
2026-05-28 18:25:43 +08:00
xiaowei
02eef1024d
feat(Rust): zhiyi-consolidate 整合引擎 — DBSCAN + 衰减回归 + 质量回溯
...
Rust sidecar (232行): 纯 std + serde + clap,无 async
- DBSCAN 聚类: cosine_sim + 邻居扩展 (20簇/132噪点)
- 衰减回归: 按类别线性拟合,clamp(0.005, 0.05)
- 质量回溯: 信息密度检测
- 输出: stdout JSON,stderr 日志
Go consolidate 客户端: exec Rust 二进制,提取 JSON
server.go: 注册 /api/v1/admin/consolidate
验证:
- Go→Rust consolidate?mode=full → 200 OK ✅
- 923 distilled, 535 vectors, 20 clusters, 132 noise
2026-05-28 18:08:06 +08:00
xiaowei
a56021f9e8
feat(M8): FAISS→LanceDB迁移脚本 + 灰度切换指南
...
scripts/migrate.py (130行): Python迁移工具,读取旧JSONL+FAISS→写入LanceDB
deploy/M8-MIGRATION.md: 7步切换流程(迁移→影子部署→灰度→systemd→验证→归档)
deploy/zhiyid.service: 修复ExecStart路径(/usr/local/bin/zhiyid)
M1-M8 全部完成 ✅
2026-05-28 17:45:19 +08:00