小唯
febc2c9139
fix(forget-loop): auto_forget 闭环修复 — GetCandidatesForForgetting 改用全表扫描 + decay 触发条件对齐 + tombstone 持久化
...
根因(记忆只增不减):
1. RustLanceDBClient.GetCandidatesForForgetting 只遍历进程内 _local.memories 缓存,
该缓存仅被 commit/recall/search 触碰;zhiyid 启动(LastFiredAt 零值)即触发一次
decay,此时缓存近乎为空 → 0 候选 → Forgetter/ShouldForget 从不执行,auto_forget 0 条。
2. server.go decay 把空 last_recalled_at 默认当 30 天前,低于 ShouldForget ~53 天阈值
→ 从未被召回的旧记忆永不遗忘;且 recall_count 仅断言 .(int),JSON 解码 float64 会
静默归 0。
3. SoftDelete 只标记内存缓存不落盘(重启即复活),tombstone 从未持久化。
修复:
- Rust sidecar: main.rs 暴露 lancedb_scan(scan_all 全量 is_deleted=false);lancedb_ops
3 处读表补 last_recalled_at(此前 search/query/scan_all 返回空串)。
- Go GetCandidatesForForgetting 主路径走 lancedb_scan(sidecar 旧版自动退回缓存),
按最久未访问升序取前 200(镜像 SQLite ORDER BY last_recalled_at ASC LIMIT 100,
避免 merge/conflict 消费方 O(n²) 风暴);字段强转 Go 类型(recall_count=int)。
- decay 触发条件:last_recalled_at 空 → 回退 created_at 作为空闲锚;两者皆空(未知
年龄)默认保留不猜删;新增 [decay] scanned/forgotten 日志便于观测。
- admin /forget 同锚对齐(原 parseTimeStr("")=零值时间 → ShouldForget 恒真,全表
从未召回记忆会被误删的隐患)。
- SoftDelete 持久化 is_deleted=true 到 LanceDB(Rust update 实测把 'true' 写为 bool)。
部署验证(2026-09-05 23:08):
- 新 sidecar + 新 zhiyid 重启后 [decay] scanned=200 forgotten=1(构造 2026-06-01 旧
记忆被 auto_forget 删除);重启后 tombstone 不复活。
- 真实语料最老 2026-08-02(34 天)< 53 天阈值 → forgotten=0,无误删。
- 附带修复 merge 去重:同源重复蒸馏事实 merged_into 持久化(此前同样看不见全表)。
- 备份 /home/muc/bin/{zhiyid-new,zhiyi-consolidate}.bak-20260905 可回滚。
2026-09-05 23:11:06 +08:00
小唯
38701748d1
feat(distill): P4 AAAK压缩索引 + P5 Markdown导出层
...
P4: 借鉴 mempalace AAAK dialect — 每条事实生成紧凑索引(实体|关键词|权重|类型)
P5: 借鉴 EverOS md真相层 — /api/v1/memories/export 导出人可读 Markdown
2026-08-12 01:37:27 +08:00
小唯
82c3d25423
feat(distill): P2 离线整合(UPDATE_PROMPT) + P3 双缓冲(token积累) + JSON健壮剥离修复
...
- P2: consolidate.go 新增 ConsolidateMemory + TextSimilarity,LLM三选一(update/delete/ignore)合并相似记忆
- P2: server.go 新增 POST /api/v1/consolidate/memory 手动触发端点
- P3: engine.go Enqueue 按 token 积累触发 flush(阈值2000),batchTimeout兜底
- fix: LLM JSON 剥离增强(找首个{和最后}截取),修复模型返回markdown/注释导致的parse error
2026-08-11 21:38:10 +08:00
小唯
72cbf73583
feat: P0 recall fallback + P2 trust scoring for graph edges
...
P0: When bge-embed/IPC recall fails, fall back to graph.db keyword search (FallbackTextSearch) instead of 500 error. Response includes X-Fallback: graph header.
P2: Add trust_score, retrieval_count, helpful_count columns to graph_edges table. New POST /api/v1/graph/edge/feedback endpoint. UpdateEdgeTrustScores batch calculation.
2026-07-02 00:22:28 +08:00
小唯
dc8d074cf5
fix: 6 Go code quality fixes + 4 plugin bug fixes
2026-06-20 16:51:13 +08:00
小唯
12c4c58c1c
fix: re-enable /api/v1/memories list endpoint (via AdminAPI)
2026-06-20 16:24:52 +08:00
小唯
23c6547503
perf: add graph navigate cache (TTL 5min, 500 entries) + cache invalidation + cache stats API
...
- NewCachedGraphStore: governance.GraphStore wrapper, only Navigate() is cached
- GraphCacheRef: expose InvalidateAll() + Stats() for cache management
- Cache invalidation on graph/edge add, graph/cleanup (non-dry-run)
- New /api/v1/cache/stats endpoint for cache monitoring
- /api/v1/health now registered at /api/v1/health path too
- normalizeEntity: preserve Unicode letters (Chinese chars not stripped)
2026-06-16 18:09:51 +08:00
小唯
d6188a2bd7
fix: health endpoint + graph/edge API + normalizeEntity Chinese + nl_query comparison
...
1. Add /api/v1/health endpoint (maps to HandleHealth)
2. Add POST /api/v1/graph/edge for adding relation edges
3. Fix normalizeEntity to preserve Chinese characters (0x4e00-0x9fa5)
4. Fix nl_query direct_path comparison to use normalizeEntity on both sides
2026-06-16 16:16:35 +08:00
小唯
bd8008b3fd
fix: comment out api.ListMemories (removed from routes)
2026-06-15 18:34:12 +08:00
小唯
a76b6d3afa
feat(graph): add graph cleanup + nl_query + navigate grouped format
...
- Add CleanupNoiseNodes() to GraphStore interface + SQLiteGraphStore impl
- Add /api/v1/graph/cleanup endpoint (dry_run + execute)
- Add /api/v1/graph/nl_query endpoint for natural language graph queries
- Improve /api/v1/graph/navigate: add grouped_by_relation, suggestions, normalized_entity
- Add CleanupNoiseNodes stubs to InMemoryGraph and FileGraph
BREAKING: navigate response now includes grouped_by_relation and suggestions
2026-06-15 18:09:27 +08:00
小唯
8ad4a7c794
feat: add freshness field to memory lifecycle
...
- server.go: set freshness='fresh' when distill creates new memory
- recall.go: set freshness='verified' when memory is recalled
- Freshness values: fresh (new), verified (recalled), stale (decayed)
2026-06-15 10:39:15 +08:00
xiaowei
42a8aeb53c
api/server: only record distill_loss when Overall>0, exclude fallback pollution
2026-06-12 11:43:05 +08:00
xiaowei
cf31ff5e8e
api: add /api/v1/metrics endpoint exposing Dashboard metrics (avg_distill_loss, etc.)
2026-06-12 08:54:00 +08:00
xiaowei
b237cc9aeb
fix(backup): add 5min timeout to tar, fix comment
2026-06-10 10:16:49 +08:00
xiaowei
2c96f805f4
fix: consolidate trigger uses full mode instead of cluster_only
...
Problem: server.go 30s ticker loop called consolPipe.Run() which
defaults to cluster_only mode. The 'consolidation' and 'backtrack'
actions never executed prune/decay/quality steps.
Fix:
- Separate 'distill' action (keeps cluster_only for fast frequent runs)
- 'consolidation' and 'backtrack' now call RunWithMode(full)
- selfoptimize.Flow.Register('consolidate') also uses RunWithMode('full')
- Proper case indentation (4 tabs for labels, 5 for bodies)
Result: prune + decay + quality steps now run when t_consolidation
or t_backtrack fires (48h cooldown protects against over-firing)
2026-06-09 12:45:33 +08:00
xiaowei
f286348ad8
fix: gap auto-close + conflict_muchen handler
...
- GapDetector.RecordHit(topic): recall 命中后自动关闭该 topic 的 open gap
- GapDetector.ClearMisses(topic): 清除 miss 计数,避免重复触发
- SetGlobalGapDetector / GetGlobalGapDetector: 全局实例注册,供 recall 回调使用
- recall handler (core.go): 命中时调用 RecordHit + ClearMisses 实现 gap auto-close
- conflict_muchen handler (server.go): 注册处理器,自动裁决 pending conflict(latest_wins / primary_wins / dismiss)
- fix: server_sqlite_nowindows.go 修复 osGetenv → os.Getenv (pre-existing)
2026-06-08 00:54:40 +08:00
xiaowei
3d054e7590
自验证机制:consolidate 聚类下限 + timestamp 前置检查 + 启动数据目录检查 + 修复图谱扩展字段名
...
1. consolidation_pipe.go:
- 前置:抽样检查记忆时间戳(< 2024-01-01 视为可疑 epoch-0)
- 后置:clusters <= 1 时记录 ERROR + patterns 标记异常
2. server.go: runStartupChecks() 启动时检测废弃路径 + socket 可达性
3. graph_expander.go: Navigate 返回字段从 "target"/"source" 修正为 "to"/"from"
2026-06-03 12:44:31 +08:00
xiaowei
7ec0642b9d
feat: E1.1-E1.7 图谱 BFS 扩展全部完成
...
E1.1: InMemoryGraph.NavigateBiDir 真正双向 BFS(替代伪实现)
E1.2: 无相遇节点返回 {unreachable:true} 而非降级单向
E1.3: 规则 NER(extractEntitiesWithNER, 7个正则模式)
E1.4: relationFilter 支持(buildRelationFilterClause, SQL注入)
E1.5: API 层 relation_filter 参数(navigate 端点)
E1.6: API 层 relation_filter 参数(同上,已在 navigate 中支持)
E1.7: 环路检测(seenEdges map,同一边不在单次 BFS 中重复访问)
同时修复: graph_expander.go Navigate 调用加 relFilter=nil
2026-06-02 20:26:57 +08:00
xiaowei
4501d93717
E5.3 Web UI: React 单文件 + 静态文件中间件
...
- web-ui/index.html: 4页 SPA(记忆/图谱/搜索/蒸馏),Babel standalone JSX
- Go 静态文件中间件: catch-all handler 检查 web-ui 目录
- Makefile: build-web / install-all 目标
2026-06-02 17:10:28 +08:00
xiaowei
abef38cb05
E5.1 Obsidian 插件: CORS中间件 + 记忆面板 + 图谱视图 + 搜索模态框
...
- 新增 CORS 中间件 (middleware/cors.go): 支持 app://obsidian.md 跨域
- 新增 Obsidian 插件: MemoryView(分页记忆列表) + GraphView(D3力导向图) + SearchModal(语义搜索)
- Go API CORS: Access-Control-Allow-Origin: app://obsidian.md
- Makefile 新增 build-obsidian / install-obsidian 目标
- 插件安装至 ~/.obsidian/plugins/zhiyi-memory/
2026-06-02 15:42:54 +08:00
xiaowei
f93da87a97
fix: distill端点 /status /queue /quota(Engine新增导出方法);WORKLOG同步
2026-06-02 12:28:00 +08:00
xiaowei
8db0138b06
G8: Restore+ListBackups 端点;G9: SearchCache 双级缓存(内存+Redis L2)
2026-06-02 11:43:34 +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
43286dd2d7
G7.1+G7.2: skill persistence + crystallize API
...
G7.1 — Skill 持久化:
- BetaSkill: prompt_template, linked_memory_ids, linked_entities, created_at
- BayesianSkillManager: EnableRedisPersistence(), loadFromRedis(), persistSkill()
- Redis HASH (zhiyi:skills) 持久化,重启不丢 skills
- Skill CRUD API: POST/GET/DELETE /api/v1/skills/{name}
- auto_distill skill: ETA=0.93, status=active after 12 trials ✓
G7.2 — Skill 结晶:
- GetSkillCandidates(minRecalls, limit): storage.LanceDB 接口扩展
- SQLiteClient: SQL 查询候选(recall_count>=5, quality_score>=0.7)
- RustLanceDBClient/MemLanceClient: stub 实现
- /api/v1/crystallize/candidates: 获取候选记忆
- /api/v1/crystallize/memory/{id}: 对记忆执行 LLM 结晶
- callSkillLLM(): LLM 生成 prompt 模板(带降级)
- RegisterLDBGetter(): routes 包访问 LanceDB 实例
2026-06-02 00:01:59 +08:00
xiaowei
137c25f16f
G7.1 fix: skillByNameHandler method dispatch, Redis persistence verified
...
- skillByNameHandler: GET/DELETE on same pattern via r.Method switch
- EnableRedisPersistence at startup: confirmed working via logs + curl
- Redis HGET zhiyi:skills: full skill state persisted correctly
- Trial feedback: ETA 0.5 → 0.67 after 1 success (Bayesian update ✓)
2026-06-01 23:48:51 +08:00
xiaowei
4f2c0fe769
G7.1: skill persistence - BayesianSkillManager Redis + CRUD API
...
- BetaSkill extended: PromptTemplate, LinkedMemoryIDs, LinkedEntities, CreatedAt
- BayesianSkillManager: EnableRedisPersistence(), loadFromRedis(), persistSkill()
- Skill CRUD API: POST/GET/DELETE /api/v1/skills/{name}
- Skill Manager: Register(), Get(), Delete(), Stats()
- redis.go: added HDel method
- triggers.go: removed duplicate Skill/SkillManager (now in skill_bayes.go)
- server.go: EnableRedisPersistence() at startup + new routes
2026-06-01 23:44:36 +08:00
xiaowei
525b5f2bb2
fix E4.3: 回退 FileGraph,恢复 SQLiteGraphStore(数据在 graph.db)
...
切换 FileGraph 导致 9.9MB 历史图谱数据丢失。
恢复 NewSQLiteGraphStore,GetEntityDegree 加到 SQLiteGraphStore。
验证:1720 节点,32983 边。
2026-06-01 01:16:31 +08:00
xiaowei
2d0923a85c
E4.3: 图谱度参与遗忘决策(完整接入)
...
- GraphStore 接口添加 GetEntityDegree(entity) int
- InMemoryGraph + FileGraph 实现(复用 EvidenceCount 逻辑)
- GetCandidatesForForgetting 返回 namespace + content 字段(存储层)
- AdminAPI 添加 GraphStore 字段,admin.go 的 Forget 接入
- server.go decay 循环接入:namespace 作为实体查图谱度
- 修复预存在错误:SQLiteGraphStore → FileGraph(无 SQLite 图谱)
- 修复预存在错误:consolidation_pipe PageRank 类型断言删掉(FileGraph 自更新)
2026-05-31 22:29:28 +08:00
xiaowei
a6403dd088
E4 图谱推理:E4.1 矛盾检测+E4.2 跨agent recall+E4.3 遗忘参考图谱度
...
E4.1: ConflictDetector 注入 core.go:API, Commit 时对相似记忆运行矛盾检测(IsContradiction),有冲突时在响应中返回 conflicts 字段
E4.2: Recall 结果 < 3 时自动补充搜索 shared namespace,合并跨 agent 结果
E4.3: Forgetter.ShouldForget 加 graphDegree 可选参数,节点度 > 5 时每度 +0.03 保留分
2026-05-31 16:03:21 +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
8d3582046c
fix: IPC 字段名 + recall_count 持久化 + feedback 端点
...
1. IPC 字段名修复 (lancedb_ipc.go)
- Rust lancedb_search 返回 'result' 字段,Go ipcResp 用 'report_json'
- 两边字段名不匹配导致 ReportJSON 永远为空,Search() 降级到 localSearch
- 后果:recall_count 只写 Go 缓存,不写 LanceDB,重启后丢失
- 修复:ipcResp 加 'Result' 字段 (json:"result"),Search() 改用 resp.Result
2. Update 扩展 支持 (lancedb_ipc.go)
- 原来只有 recall_count 支持 ,useful_count/not_useful_count 被丢弃
- 新增 getIncCachedValue() 统一处理所有 counter 字段
- 加日志:Update OK / Update FAILED 可见
- 修复 Feedback 端点 传递问题(map[string]int 而非 map[string]string)
3. /api/v1/feedback 端点 (core.go + server.go)
- POST memory_id + useful/not_useful,通过 LanceDB.Update() 持久化
- 之前返回 404
破坏性:无(Search 降级是隐式行为,原代码已有 fallback)
2026-05-31 07:36:31 +08:00
xiaowei
e95ae36236
G7.1 skill修复: trial路由{name} capture + Beta-Bernoulli后端统一
...
- Fix /api/v1/skills/{name}/trial route: was '/skills/' (no capture) → '/skills/{name}/trial'
- Skills.Trial now delegates to BayesianSkills.RecordTrial (was broken simple ETA)
- Skills.List now reads from BayesianSkills (was reading from wrong store)
- 3 successful trials → η=0.8, status=active (Beta-Bernoulli verified)
2026-05-30 23:21:34 +08:00
xiaowei
51a0747324
fix(G6): 修复 Rust IPC 字段名映射 + cluster_only 模式 + consolidation timeout
...
- client.go: Result 字段名从 clusters/noise 改为 clusters_found/noise_points(匹配 Rust)
- consolidation_pipe.go: 使用 cluster_only 避免 LLM 阻塞;GraphPruned 改为 0(cluster_only 不做 pruning)
- server.go: consolidation handler 加 30s timeout,避免 HTTP 挂起
2026-05-30 22:58:27 +08:00
xiaowei
d4c13e7377
feat(G5): eval 评估框架完整实现
...
G5.1 - eval/run namespace 支持 + 完整 IR 指标
G5.2 - eval/generate 生成 12 条金标(4类×3级),recall 自动获取 expected_ids
G5.3 - vprop 反向传播端点 + V 值查询接口(/trace/vprop, /vvalue/memory/)
2026-05-30 22:26:20 +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
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
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
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
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
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
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
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
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
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