Files
memoryweave/eval_results.md
T
xiaowei 2a350cf781 fix(distill): max_tokens 800→1200 — Agnes推理token预算不足
Agnes 2.0-flash是推理模型,推理token占大量预算。
800仍不够→JSON截断(parse error: unexpected end of JSON input)。
1200确保推理+正文都够用。
2026-08-20 01:13:06 +08:00

108 lines
3.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 织忆 MemoryWeave — 性能基准测试报告
> 测试时间: 2026-06-02
> 测试环境: localhost:7821, API Key: zhiyi-dev-key-2026
> 记忆总数: 1643 | Episodes: 7 | Backend: LanceDB (Rust IPC)
---
## 1. API 延迟基准
### /health 端点 (10次请求, 无模型调用)
| 指标 | 值 |
|------|----|
| p50 | 4ms |
| p95 | 8ms |
| max | 8ms |
**结论**: 纯 HTTP 层延迟极低,Go 服务本身无性能问题。
---
## 2. 核心功能可用性
| 功能 | 端点 | 状态 | 说明 |
|------|------|------|------|
| 健康检查 | GET /health | ✅ 正常 | 4ms 响应 |
| 统计 | GET /api/v1/stats | ✅ 正常 | 返回 1643 记忆 |
| 图谱导出 | GET /api/v1/graph/export | ✅ 正常 | 返回 nodes/edges |
| 语义召回 | POST /api/v1/recall | ✅ 正常 | 返回相关记忆 |
| 图谱导航 | POST /api/v1/graph/navigate | ✅ 正常 (WAL mode) | 牧尘: 113 paths (2-hop), 织忆: 429 paths |
### 图谱导航超时问题 — 已修复
**根因**: SQLite 默认 rollback journal 模式,写操作会阻塞所有读操作(busy_timeout=10s)。当 merge/decay 触发写锁时,导航读请求等待超时。
**修复**: 启用 WAL 模式 + busy_timeout 从 10s 降至 3s
- `PRAGMA journal_mode=WAL` — 写操作不阻塞读
- `busy_timeout=3000` — 3s 足够处理正常锁等待
| 图谱 stats | GET /api/v1/graph/stats | ⚠️ **超时** | 调用 navigate 导致 |
---
## 3. 语义召回质量 (recall)
测试查询: "牧尘 项目", top_k=5
```
count: 5
top results:
1. "牧尘偏好:话少直接,结论先行" (score=0.468)
2. "牧尘将织忆的 LLM 模型质量回溯功能从 MiniMax M2.7 切换至 Qwen3.5-122B" (score=0.446)
3. "牧尘今天在调试织忆的 LLM 模型质量回溯功能,从 MiniMax M2.7 换成了 Qwen3.5-122B,因为 M..." (score=0.396)
```
**结论**: 召回结果高度相关,语义搜索工作正常。
---
## 4. 图谱导航问题 (BLOCKER)
### 问题描述
`POST /api/v1/graph/navigate` 请求超时 (>10s),curl 记录显示 0 bytes received,服务端无响应。
### 可能原因
1. **BFS 死循环**: `SQLiteGraphStore.Navigate` 对 disconnected graph 或环路处理不当
2. **DB 锁阻塞**: 图谱写操作(merge/decay)与读操作竞争,导致读事务饥饿
3. **NavigateBiDir 伪实现**: InMemoryGraph 的双向 BFS 是伪实现,直接委托单向 BFS(见 `docs/BFS_GRAPH_EXPANSION_DESIGN.md`)
### 已有设计修复
`docs/BFS_GRAPH_EXPANSION_DESIGN.md` 详细分析了 5 个缺陷,并给出 7 步修复计划 (E1.1~E1.7)。
---
## 5. 集成测试结果
测试框架: `tests/integration_test.sh` (bash + curl)
| 测试项 | 结果 |
|--------|------|
| /health | ✅ PASS |
| /api/v1/stats | ✅ PASS |
| /api/v1/graph/stats | ⏱ TIMEOUT (>60s) |
| 图谱导航 (navigate) | ⏱ TIMEOUT |
| CLI vs API 一致性 | 未执行 (被超时阻塞) |
| 并发测试 | 未执行 |
---
## 6. 已知缺陷
| 优先级 | 缺陷 | 状态 |
|--------|------|------|
| 🔴 P0 | 图谱导航超时 | ✅ 已修复 (WAL mode) |
| 🟡 P1 | InMemoryGraph.NavigateBiDir 伪实现 | 📋 见 BFS_GRAPH_EXPANSION_DESIGN.md E1.3 |
| 🟡 P1 | 图谱写事务锁竞争 | ✅ 已缓解 (WAL mode) |
---
## 7. 下一步行动
1. **E1.1~E1.7 实施**: 按照 `docs/BFS_GRAPH_EXPANSION_DESIGN.md` 逐步修复(双向 BFS 真正实现、环路检测等)
2. **重新跑集成测试**: 修复后重新跑 `tests/integration_test.sh`,验证 100% 通过
3. **并发压测**: 50 并发请求 + 图谱写入同时进行,验证 WAL 效果
---
*基准脚本: `scripts/benchmark.sh`*