feat: port quality, escalation, KB version, site-map KB, experiments and metrics

This commit is contained in:
wangliang
2026-10-23 11:41:09 +08:00
parent 81b49c9350
commit b778570045
33 changed files with 2446 additions and 344 deletions
+13
View File
@@ -61,6 +61,13 @@ bash scripts/rebuild-kb-index.sh
bash scripts/import-kb-snapshot.sh
# 或指定目标库:TARGET_PG_DB=products bash scripts/import-kb-snapshot.sh
# 从 sitemap 生成类目 KB
node scripts/build-site-kb.js
# KB 备份列表 / 回滚
RAG_PG_URL=postgres://crmnew:<password>@127.0.0.1:5440/bridge node scripts/kb-version.js list
RAG_PG_URL=postgres://crmnew:<password>@127.0.0.1:5440/bridge node scripts/kb-version.js rollback kb_docs_v...
# 在线 FAQ 同步 + 重建 KB(不依赖旧 bridge)
# 宿主机执行时 RAG_PG_URL 用 127.0.0.1:5440/bridge
RAG_PG_URL=postgres://crmnew:<password>@127.0.0.1:5440/bridge node scripts/sync-kb-online.js
@@ -73,6 +80,9 @@ bash scripts/export-kb-snapshot.sh
# 全量商品页站点地图(官网 sitemap → bridge 库)
node scripts/build-site-map.js www us
# Prometheus 指标
curl -s http://127.0.0.1:4100/metrics
# AI 质量日报(最近 24 小时;可传小时数)
node scripts/quality-report.js 24
@@ -84,6 +94,9 @@ node scripts/quality-alert.js 1 --dry-run
# 离线回归评测(确定性逻辑,不调 LLM)
node scripts/eval-offline.js
# RAG 检索评测
RAG_PG_URL=postgres://... node scripts/eval-retrieval.js
# 真实模型离线评测(fake LibreDesk,不写真实会话;会调 LLM/RPC)
node scripts/eval-live.js