小怡
2e04adf054
perf(recall): 累积延迟更新治理写放大 — 读路径零逐条写 + 单事务批量落盘 (t_8496e8b6)
...
根因: recall 读路径对每条结果同步 lancedb.Update,LanceDB MVCC 每次提交=1 版本
实测 15 版本/分钟 / _versions 17.7G(真实数据 22M)
改动:
- Go: 新增 RecallWriteBuffer(窗口合并+阈值触发+优雅退出落盘);recall.go 读路径改 Record();RustLanceDBClient.UpdateRecallBatch
- Rust: lancedb_update_batch IPC — 按 delta 分组,每组一次 update(`recall_count + delta` + id IN (...)) 提交
- 单测 6 个 + IPC 端到端版本计数测试;bench_test.go 修 NewReranker 签名失配(阻塞包测试)
实测: 批量 3 条 → 1 个版本;逐条 3 次 → 3 个版本 (lance 不支持 CASE WHEN,已按 delta 分组规避)
2026-09-12 17:57:31 +08:00
小唯
1bf23c42e8
fix(stats): count_rows filter 类型修正 Option<&str> -> Option<String>
...
f6c4383 的 count_rows(Some("is_deleted = true")) 编译失败(E0308: 此 lance 版本
签名 Option<String>)。修正为 .to_string()。实测 stats tombstone_count=830
(memories 表 is_deleted=true 行数, 之前恒 0)。
2026-09-06 09:25:27 +08:00
小唯
f6c4383f98
fix(stats): tombstone_count 统计源修正 — 数 memories is_deleted=true 行
...
SoftDelete 持久化语义 = memories 表内标记 is_deleted=true(不写独立 tombstones 表),
但 Rust stats() 的 tombstone_count 数的是空 tombstones 表 → 恒 0(指标失真)。
修正:stats() 对 memories 表 count_rows(Some("is_deleted = true")) 作为 tombstone_count。
验证: DELETE 一条记忆后 stats tombstone_count 应 >0。
2026-09-06 09:22:49 +08:00
xiaowei
f6cd93fbd7
fix(forgetting): P2 候选源升级 — Rust scan 全表替代纯缓存遍历
...
GetCandidatesForForgetting 原实现只遍历进程内 _local.memories 缓存
(commit/recall/search 才触碰), 重启后缓存空 → decay scanned=3 扫不全,
9-25 到期记忆若不在缓存则永远无法被遗忘(闭环断)。
安全版 scan_for_forgetting (防 febc2c9 风暴复发):
- 强制 limit (IPC 钳制硬上限 5000, decay 侧 2000)
- 不读 vector 列 (1024维×3000条≈12MB+, IPC JSON 会卡)
- 真读 last_recalled_at 列 (scan_all 旧实现 String::new() 恒空 → 遗忘判定失真)
- 消费方截断护栏已就位 (merge 桶500 / conflict 500 / sanity 1000)
- IPC 失败/空 → fallback 缓存遍历 (保持可用)
验证: [decay] scanned=3 → 2000 (重启即扫全表), CPU 0%, 无 panic
2026-09-06 02:32:58 +08:00
xiaowei
b0059166a2
fix G7 E3: crystallize路由路径+GetSkillCandidates通过Rust IPC查LanceDB
...
- server.go: 修复mux路由路径(去掉"POST "前缀)
- skill_crystallize.go: 添加POST方法检查
- models/memory.go: 添加safeTime类型避免空字符串解析报错
- lancedb_ipc.go: GetSkillCandidates改用Rust IPC的lancedb_query
- Rust lancedb_ops.rs: 新增query_memories()支持min_recall过滤
- Rust main.rs: 新增lancedb_query IPC handler
2026-06-02 04:19:58 +08:00
xiaowei
243a2066a4
G7.3: skill execute + quality_score fix
...
G7.3 — Skill执行+遗忘联动:
- skill_execute.go: ExecuteSkill handler, applyForgettingLinkage
- /api/v1/skills/{name}/execute: 返回 enriched_prompt + linked memories
- Trial feedback 联动: success → degree保护, failure → decay加速
Fix quality_score=0 (Step 2):
- main.rs: stratified_sample 用 tier 字段,但 memories 全为 "normal"
- 改为 r.freshness(默认为 "fresh"),匹配 stratified_sample 期望的 tier 值
G7.1+G7.2 已在运行(skill persistence + crystallize API 验证通过)
2026-06-02 00:48:36 +08:00
xiaowei
cd0f898829
fix: eps=1.0 (19 clusters from 1486 items), add col_vector() for FixedSizeListArray reading
...
- eps: 0.1 → 1.0 (p50=1.011, meaningful semantic clustering)
- col_vector(): parse FixedSizeListArray and Float32Array for LanceDB vector column
- search() and scan_all() now read actual vectors instead of vec![]
- client.go: remove duplicate Epsilon field, eps=1.0
2026-05-31 14:35:29 +08:00
xiaowei
1fa8349e48
fix: mode propagation, eps=0.1, BGE connectivity check, vector storage, WriteTimeout 60s
...
Key fixes:
- Go task mode now correctly propagates to Rust sidecar via IPC (RunWithMode)
- DBSCAN eps lowered from 1.5 to 0.1 (cosine threshold 0.995)
- Add BGE HTTP connectivity check (TcpStream 2s timeout) before Step 4 quality backtrace
- Fix LanceDB insert_batch: use Float32Array::from_iter_values + try_new with None validity
- Fix embed.rs: add .timeout(10s) on encode request
- Fix consolidation_pipe.go: nil guards on report
- Fix main.go: WriteTimeout 60s (was 10s, causing exit 52 on full mode)
- Add vector zero detection + debug logging (norms, sample distances)
- Log warning when BGE HTTP unreachable (skip quality backtrace instead of hanging)
2026-05-31 11:46:59 +08:00
xiaowei
0ef3f2f0ba
fix(G6.2): LLM model换qwen3.5-122b,deploy service同步更新
2026-05-31 01:25:51 +08:00
xiaowei
b175b82b01
fix(G6.2): MiniMax M2.7 reasoning_content fallback + LLM API key 修复
2026-05-31 00:51:12 +08:00
xiaowei
3b031ed2e7
fix(G7): skill trial路由 + LLM API key 传递到 Rust sidecar + Authorization header
2026-05-30 23:55:43 +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
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
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
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
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
cfb52518e4
feat: 织忆 MemoryWeave 项目初始化
...
- Go 项目骨架 (zhiyid daemon, port 7821)
- Rust 项目骨架 (zhiyi-consolidate sidecar)
- 完整设计文档 v3.8 (DESIGN.md)
- 实施计划 8 个里程碑 (IMPLEMENTATION.md)
- systemd 部署文件
- Makefile 构建系统
2026-05-28 17:03:54 +08:00