memorix 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +73 -11
- package/README.md +469 -409
- package/README.zh-CN.md +477 -408
- package/TEAM.md +106 -0
- package/dist/cli/index.js +34462 -27684
- package/dist/cli/index.js.map +1 -1
- package/dist/dashboard/static/app.js +983 -59
- package/dist/dashboard/static/index.html +24 -4
- package/dist/dashboard/static/style.css +663 -0
- package/dist/index.js +1692 -247
- package/dist/index.js.map +1 -1
- package/dist/sdk.d.ts +677 -0
- package/dist/sdk.js +19580 -0
- package/dist/sdk.js.map +1 -0
- package/dist/types.d.ts +12 -11
- package/dist/types.js +11 -10
- package/dist/types.js.map +1 -1
- package/docs/AGENT_OPERATOR_PLAYBOOK.md +684 -0
- package/docs/AI_CONTEXT.md +18 -0
- package/docs/API_REFERENCE.md +687 -0
- package/docs/ARCHITECTURE.md +488 -0
- package/docs/CLOUD_SYNC_AND_MULTI_AGENT_RESEARCH.md +470 -0
- package/docs/CONFIGURATION.md +265 -0
- package/docs/DESIGN_DECISIONS.md +358 -0
- package/docs/DEVELOPMENT.md +317 -0
- package/docs/DOCKER.md +138 -0
- package/docs/GIT_MEMORY.md +221 -0
- package/docs/KNOWN_ISSUES_AND_ROADMAP.md +149 -0
- package/docs/MEMORY_FORMATION_PIPELINE.md +224 -0
- package/docs/MODULES.md +383 -0
- package/docs/PERFORMANCE.md +64 -0
- package/docs/README.md +79 -0
- package/docs/SETUP.md +617 -0
- package/docs/hooks-architecture.md +108 -0
- package/package.json +24 -23
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Memorix 已知问题 & 未来路线图
|
|
2
|
+
|
|
3
|
+
> 最后更新: 2026-03-09 (v1.0.0)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 已知问题 & 限制
|
|
8
|
+
|
|
9
|
+
### 🔴 严重
|
|
10
|
+
|
|
11
|
+
| # | 问题 | 影响 | 状态 |
|
|
12
|
+
|---|------|------|------|
|
|
13
|
+
| 1 | ~~**无文件锁**~~ — 多 Agent 同时写入 | 数据完整性 | ✅ v0.7.11 (`withFileLock` + `atomicWriteFile`) |
|
|
14
|
+
| 2 | **Orama where 过滤不可靠** — 空 term + number filter 时结果可能不正确 | `compactDetail` 已绕过 (使用内存查找) | 已变通 |
|
|
15
|
+
|
|
16
|
+
### 🟡 中等
|
|
17
|
+
|
|
18
|
+
| # | 问题 | 影响 | 状态 |
|
|
19
|
+
|---|------|------|------|
|
|
20
|
+
| 3 | **非 Git 项目的 projectId 不稳定** — 基于目录名,不同机器或路径会不同 | 数据隔离 | 未修复 |
|
|
21
|
+
| 4 | ~~**retention 只有报告没有执行**~~ | 数据膨胀 | ✅ v0.7.11 (`archiveExpired` + `action="archive"`) |
|
|
22
|
+
| 5 | ~~**实体抽取不支持中文标识符**~~ | 中文项目覆盖不足 | ✅ v0.7.11 (中文括号/反引号 + 因果语言) |
|
|
23
|
+
| 6 | ~~**auto-relations 每次读取全图**~~ | 性能 | ✅ v0.7.11 (entityIndex O(1) 查找) |
|
|
24
|
+
| 7 | **高重要性 observations 永远免疫** — gotcha/decision/trade-off 永不过期 | 数据膨胀 | 设计如此,需评估 |
|
|
25
|
+
|
|
26
|
+
### 🟢 轻微
|
|
27
|
+
|
|
28
|
+
| # | 问题 | 影响 | 状态 |
|
|
29
|
+
|---|------|------|------|
|
|
30
|
+
| 8 | ~~**Kiro/Trae Agent hooks 未实现**~~ | 功能缺失 | ✅ v0.9.12+ (Kiro/Trae/OpenCode/Gemini CLI 全部支持) |
|
|
31
|
+
| 9 | **fastembed 首次使用需下载模型** — ~30MB,可能在网络不好时超时 | 用户体验 | npm 可选依赖 |
|
|
32
|
+
| 10 | **npx 缓存可能损坏** — 见 `MODULE_NOT_FOUND chownr` 问题 | 安装体验 | 需文档说明 |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 未来路线图
|
|
37
|
+
|
|
38
|
+
### Phase 1: 稳定化 ✅
|
|
39
|
+
- [x] Copilot Adapter 实现
|
|
40
|
+
- [x] Antigravity Adapter 实现
|
|
41
|
+
- [x] MCP Server 集成验证
|
|
42
|
+
- [x] 753 测试通过 (v1.0.0)
|
|
43
|
+
- [x] 开发文档编写
|
|
44
|
+
- [x] README 优化 (中英双语, Antigravity 配置指南)
|
|
45
|
+
- [x] npm 发布配置优化
|
|
46
|
+
|
|
47
|
+
### Phase 2: 推广 & 用户获取
|
|
48
|
+
- [ ] 社区推广 (Reddit, HN, X, Discord)
|
|
49
|
+
- [ ] 技术博客文章
|
|
50
|
+
- [ ] 演示视频
|
|
51
|
+
- [ ] 与其他 MCP Server 项目的对比文档
|
|
52
|
+
|
|
53
|
+
### Phase 3: Web Dashboard ✅
|
|
54
|
+
- [x] 知识图谱可视化 (D3.js force graph)
|
|
55
|
+
- [x] Observation 搜索/浏览 Web UI
|
|
56
|
+
- [x] 记忆保留状态仪表板
|
|
57
|
+
- [x] 跨项目记忆概览 (project switcher)
|
|
58
|
+
|
|
59
|
+
### Phase 4: 功能增强 ✅
|
|
60
|
+
- [x] 自动归档过期记忆 (`memorix_retention action="archive"`)
|
|
61
|
+
- [x] 文件锁机制 (多进程安全)
|
|
62
|
+
- [x] 搜索精确度优化 (fuzzy + field boosting)
|
|
63
|
+
- [x] 中文实体抽取
|
|
64
|
+
- [x] 图谱-记忆双向同步
|
|
65
|
+
- [x] `memorix_transfer` — 导出/导入记忆 (JSON + Markdown)
|
|
66
|
+
- [x] 记忆去重和冲突检测 (`memorix_deduplicate` + `memorix_consolidate`)
|
|
67
|
+
- [x] LLM 增强模式 (压缩/重排序/写入时去重)
|
|
68
|
+
|
|
69
|
+
### Phase 5: Agent 集成 ✅
|
|
70
|
+
- [x] Kiro 完整支持
|
|
71
|
+
- [x] Trae 支持
|
|
72
|
+
- [x] OpenCode 支持
|
|
73
|
+
- [x] Gemini CLI 支持
|
|
74
|
+
- [x] Copilot hooks 支持
|
|
75
|
+
- [x] 10 个 Agent 全覆盖
|
|
76
|
+
|
|
77
|
+
### Phase 6: v1.0.0 特性 ✅
|
|
78
|
+
- [x] 团队协作 (Agent注册/文件锁/任务板/消息)
|
|
79
|
+
- [x] 工具合并 (41 → 22 默认)
|
|
80
|
+
- [x] 启动自动清理 (归档 + LLM/Jaccard 去重)
|
|
81
|
+
- [x] Mini-Skills (永久技能, 自动注入)
|
|
82
|
+
- [x] 会话管理 (跨会话上下文注入)
|
|
83
|
+
|
|
84
|
+
### Phase 7: 未来路线图
|
|
85
|
+
- [ ] 多项目记忆关联搜索
|
|
86
|
+
- [ ] LLM-based 实体抽取 (替代正则)
|
|
87
|
+
- [ ] JetBrains AI 支持
|
|
88
|
+
- [ ] VS Code + Continue.dev 支持
|
|
89
|
+
- [ ] 自定义 embedding 模型支持
|
|
90
|
+
- [ ] 记忆联邦协议 (跨团队共享)
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 依赖关系
|
|
95
|
+
|
|
96
|
+
### 运行时依赖
|
|
97
|
+
| 包 | 版本 | 用途 |
|
|
98
|
+
|---|------|------|
|
|
99
|
+
| `@modelcontextprotocol/sdk` | ^latest | MCP 协议 SDK |
|
|
100
|
+
| `@orama/orama` | ^latest | 全文/向量搜索 |
|
|
101
|
+
| `gpt-tokenizer` | ^latest | Token 计数 |
|
|
102
|
+
| `citty` | ^latest | CLI 框架 |
|
|
103
|
+
| `@clack/prompts` | ^latest | CLI 交互提示 |
|
|
104
|
+
| `zod` | ^3 | 参数验证 |
|
|
105
|
+
|
|
106
|
+
### 可选依赖
|
|
107
|
+
| 包 | 版本 | 用途 |
|
|
108
|
+
|---|------|------|
|
|
109
|
+
| `fastembed` | ^latest | 本地 ONNX embedding (384d) |
|
|
110
|
+
|
|
111
|
+
### 开发依赖
|
|
112
|
+
| 包 | 版本 | 用途 |
|
|
113
|
+
|---|------|------|
|
|
114
|
+
| `vitest` | ^latest | 测试框架 |
|
|
115
|
+
| `tsup` | ^latest | 打包构建 |
|
|
116
|
+
| `typescript` | ^5 | 类型系统 |
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 技术债务
|
|
121
|
+
|
|
122
|
+
| 优先级 | 项目 | 说明 |
|
|
123
|
+
|--------|------|------|
|
|
124
|
+
| ~~P0~~ | ~~文件锁~~ | ~~✅ v0.7.11~~ |
|
|
125
|
+
| ~~P1~~ | ~~自动归档~~ | ~~✅ v0.7.11~~ |
|
|
126
|
+
| P1 | projectId 稳定性 | 非 Git 项目需要更好的识别策略 |
|
|
127
|
+
| ~~P2~~ | ~~中文实体抽取~~ | ~~✅ v0.7.11~~ |
|
|
128
|
+
| ~~P2~~ | ~~auto-relations 性能~~ | ~~✅ v0.7.11~~ |
|
|
129
|
+
| P3 | Orama 持久化 | 考虑 Orama 的原生持久化而非每次重建 |
|
|
130
|
+
| ~~P3~~ | ~~测试覆盖~~ | ~~✅ 753 tests, 56 files, 含 HTTP 集成测试~~ |
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 历史重要事件
|
|
135
|
+
|
|
136
|
+
| 日期 | 事件 |
|
|
137
|
+
|------|------|
|
|
138
|
+
| 2026-02-13 | Copilot Adapter 实现完成,274 测试全部通过 |
|
|
139
|
+
| 2026-02-13 | Antigravity MCP 配置修复,Memorix MCP Server 首次成功运行 |
|
|
140
|
+
| 2026-02-13 | 发现并修复 npx 缓存损坏问题 (MODULE_NOT_FOUND chownr) |
|
|
141
|
+
| 2026-02-15 | 完成全部核心模块的深度代码审查 |
|
|
142
|
+
| 2026-02-15 | 开发文档完成 (ARCHITECTURE, MODULES, DEVELOPMENT, DESIGN_DECISIONS, API_REFERENCE) |
|
|
143
|
+
| 2026-02-24 | v0.7.8-0.7.10: Antigravity 兼容 + MCP roots + 中英双语文档 |
|
|
144
|
+
| 2026-02-24 | v0.7.11: P0-P2 全部完成 (文件锁 + 搜索优化 + 自动归档 + 中文实体 + 性能优化 + 图谱同步) |
|
|
145
|
+
| 2026-02-25 | v0.9.0-0.9.12: Hooks 系统全量修复 + 10 Agent 支持 |
|
|
146
|
+
| 2026-02-28 | v0.9.25: Windsurf 兼容性修复 |
|
|
147
|
+
| 2026-03-05 | v0.10.5: Antigravity/Claude Code hooks 修复 |
|
|
148
|
+
| 2026-03-07 | v0.11.0: Mini-Skills + LLM 增强模式 |
|
|
149
|
+
| 2026-03-09 | **v1.0.0**: 首个稳定版 — 22 工具 + 团队协作 + 自动清理 + 753 测试 |
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# Memory Formation Pipeline — Technical Design
|
|
2
|
+
|
|
3
|
+
## 1. Problem Statement
|
|
4
|
+
|
|
5
|
+
Memorix currently has two write paths:
|
|
6
|
+
|
|
7
|
+
- **Explicit** (`memorix_store`): Agent structures data manually → quality depends on agent prompt
|
|
8
|
+
- **Implicit** (hooks): Auto-captures tool use → `buildObservation()` does template-based title/entity generation, no semantic understanding
|
|
9
|
+
|
|
10
|
+
Both paths share the same **Compact on Write** step, which only does deduplication (ADD/UPDATE/NONE), not **memory formation** — it doesn't extract facts, resolve entities, assess knowledge value, or form stable long-term representations.
|
|
11
|
+
|
|
12
|
+
**Result**: Memory quality is capped by the weakest link (usually the caller), and the system accumulates process noise alongside reusable knowledge.
|
|
13
|
+
|
|
14
|
+
## 2. Design Goals
|
|
15
|
+
|
|
16
|
+
1. **System-level quality floor**: Even without LLM, every memory should be structurally sound
|
|
17
|
+
2. **Dual-mode**: Rules-based baseline (free) + LLM-powered premium (with API key)
|
|
18
|
+
3. **No new tools**: Formation is internal processing, not a new MCP tool
|
|
19
|
+
4. **Non-breaking**: Existing `memorix_store` schema unchanged; Formation is a middleware layer
|
|
20
|
+
5. **Measurable**: Each stage produces metrics that feed into future eval
|
|
21
|
+
|
|
22
|
+
## 3. Architecture Overview
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
┌─────────────────────────────────────────────┐
|
|
26
|
+
│ Memory Formation Pipeline │
|
|
27
|
+
│ │
|
|
28
|
+
memorix_store ──► │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
|
29
|
+
│ │ Stage 1 │ │ Stage 2 │ │ Stage 3 │ │ ──► storeObservation()
|
|
30
|
+
hooks ──────────► │ │ Extract ├─►│ Resolve ├─►│ Evaluate │ │
|
|
31
|
+
│ │ │ │ │ │ │ │
|
|
32
|
+
│ └──────────┘ └──────────┘ └──────────┘ │
|
|
33
|
+
│ │
|
|
34
|
+
│ Runs BEFORE compact-on-write │
|
|
35
|
+
└─────────────────────────────────────────────┘
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 4. Stage Definitions
|
|
39
|
+
|
|
40
|
+
### Stage 1: Extract (Fact Extraction + Normalization)
|
|
41
|
+
|
|
42
|
+
**Input**: Raw `{ title, narrative, facts, entityName, type }` from caller
|
|
43
|
+
**Output**: Enriched `{ title, narrative, facts, entityName, type }` with system-extracted data
|
|
44
|
+
|
|
45
|
+
#### Rules-based mode (no LLM):
|
|
46
|
+
- **Fact extraction**: Parse narrative for key-value patterns (`X: Y`, `X = Y`, `X → Y`), error messages, version numbers, file paths, URLs
|
|
47
|
+
- **Title normalization**: If title is generic ("Updated file.ts", "Session activity"), generate a more descriptive title from first meaningful sentence of narrative
|
|
48
|
+
- **Entity resolution**: If entityName is a raw filename ("file-lock"), try to resolve to a more meaningful entity by checking existing entity names in the Knowledge Graph
|
|
49
|
+
- **Type inference**: If type seems wrong (e.g., agent says "discovery" but content contains error stack trace), suggest correction
|
|
50
|
+
|
|
51
|
+
#### LLM mode:
|
|
52
|
+
- Single LLM call: "Extract the 3-5 most important atomic facts from this content. Suggest a canonical entity name. Verify the observation type."
|
|
53
|
+
- Merge LLM-extracted facts with caller-provided facts (dedup by semantic overlap)
|
|
54
|
+
|
|
55
|
+
### Stage 2: Resolve (Entity Resolution + Memory Consolidation)
|
|
56
|
+
|
|
57
|
+
**Input**: Enriched observation from Stage 1
|
|
58
|
+
**Output**: Resolution decision: `{ action: 'new' | 'merge' | 'evolve', targetId?: number }`
|
|
59
|
+
|
|
60
|
+
This replaces the current "Compact on Write" step with a richer model:
|
|
61
|
+
|
|
62
|
+
#### Resolution types:
|
|
63
|
+
- **new**: Truly new knowledge, no related existing memory → proceed to store
|
|
64
|
+
- **merge**: Same topic as existing memory, combine → UPDATE existing
|
|
65
|
+
- **evolve**: Existing memory is outdated, new one supersedes → UPDATE with rewrite
|
|
66
|
+
- **discard**: Process noise, not reusable knowledge → skip storage
|
|
67
|
+
|
|
68
|
+
#### Rules-based mode:
|
|
69
|
+
- Search existing memories (same as current compact search)
|
|
70
|
+
- Compare entity names (exact match, substring match, shared file paths)
|
|
71
|
+
- Score: similarity × entity_overlap × recency_weight
|
|
72
|
+
- Decision thresholds: merge (>0.75), evolve (>0.60 + contradiction detected), discard (duplicate >0.85)
|
|
73
|
+
|
|
74
|
+
#### LLM mode:
|
|
75
|
+
- Enhanced version of current `compactOnWrite()` prompt, but with explicit instructions for entity resolution and evolution detection
|
|
76
|
+
|
|
77
|
+
### Stage 3: Evaluate (Knowledge Value Assessment)
|
|
78
|
+
|
|
79
|
+
**Input**: Observation + resolution decision
|
|
80
|
+
**Output**: `{ valueScore: 0-1, valueCategory: 'core' | 'contextual' | 'ephemeral', reason: string }`
|
|
81
|
+
|
|
82
|
+
This is the **new layer** that doesn't exist today. It answers: "Is this worth storing as long-term memory?"
|
|
83
|
+
|
|
84
|
+
#### Rules-based scoring:
|
|
85
|
+
```
|
|
86
|
+
score = base_type_weight
|
|
87
|
+
+ fact_density_bonus (facts.length / narrative.length)
|
|
88
|
+
+ specificity_bonus (has file paths, version numbers, error codes)
|
|
89
|
+
+ causal_bonus (has "because", "therefore", "due to")
|
|
90
|
+
- generic_penalty (title matches LOW_QUALITY_PATTERNS)
|
|
91
|
+
- noise_penalty (narrative is mostly tool output, not knowledge)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
#### Value categories:
|
|
95
|
+
- **core** (score >= 0.7): Architecture decisions, gotchas, problem-solutions with root cause → store with high importance
|
|
96
|
+
- **contextual** (0.4 <= score < 0.7): File changes, command results with context → store with normal importance
|
|
97
|
+
- **ephemeral** (score < 0.4): Process logs, trivial changes → discard or store with auto-decay flag
|
|
98
|
+
|
|
99
|
+
#### LLM mode:
|
|
100
|
+
- Ask LLM: "Rate this memory's long-term value (0-1) and classify as core/contextual/ephemeral. Explain why."
|
|
101
|
+
|
|
102
|
+
## 5. Object Model
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
/** The intermediate representation produced by the Formation Pipeline */
|
|
106
|
+
interface FormedMemory {
|
|
107
|
+
// Original input (may be enriched)
|
|
108
|
+
entityName: string;
|
|
109
|
+
type: ObservationType;
|
|
110
|
+
title: string;
|
|
111
|
+
narrative: string;
|
|
112
|
+
facts: string[];
|
|
113
|
+
|
|
114
|
+
// Formation metadata
|
|
115
|
+
formation: {
|
|
116
|
+
/** Facts extracted by the system (not provided by caller) */
|
|
117
|
+
extractedFacts: string[];
|
|
118
|
+
/** Entity resolved from Knowledge Graph, or null */
|
|
119
|
+
resolvedEntity: string | null;
|
|
120
|
+
/** Whether title was auto-improved */
|
|
121
|
+
titleImproved: boolean;
|
|
122
|
+
/** Whether type was auto-corrected */
|
|
123
|
+
typeCorrected: boolean;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// Resolution decision
|
|
127
|
+
resolution: {
|
|
128
|
+
action: 'new' | 'merge' | 'evolve' | 'discard';
|
|
129
|
+
targetId?: number;
|
|
130
|
+
reason: string;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
// Value assessment
|
|
134
|
+
value: {
|
|
135
|
+
score: number; // 0-1
|
|
136
|
+
category: 'core' | 'contextual' | 'ephemeral';
|
|
137
|
+
reason: string;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// Pipeline metadata
|
|
141
|
+
pipeline: {
|
|
142
|
+
mode: 'rules' | 'llm';
|
|
143
|
+
durationMs: number;
|
|
144
|
+
stagesCompleted: number;
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## 6. Integration Points
|
|
150
|
+
|
|
151
|
+
### Where it plugs in:
|
|
152
|
+
|
|
153
|
+
**Current flow** (memorix_store in server.ts):
|
|
154
|
+
```
|
|
155
|
+
Input → Compact on Write → LLM Compression → storeObservation() → Graph
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**New flow**:
|
|
159
|
+
```
|
|
160
|
+
Input → Formation Pipeline (Extract → Resolve → Evaluate) → storeObservation() → Graph
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
- Formation Pipeline **replaces** Compact on Write (absorbs its functionality into Stage 2)
|
|
164
|
+
- Formation Pipeline **replaces** LLM Narrative Compression (moves it into Stage 1)
|
|
165
|
+
- `storeObservation()` remains unchanged
|
|
166
|
+
|
|
167
|
+
**For hooks** (handler.ts):
|
|
168
|
+
```
|
|
169
|
+
Current: normalizeHookInput → classifyTool → buildObservation → storeObservation
|
|
170
|
+
New: normalizeHookInput → classifyTool → buildObservation → Formation Pipeline → storeObservation
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### New file structure:
|
|
174
|
+
```
|
|
175
|
+
src/memory/
|
|
176
|
+
formation/
|
|
177
|
+
index.ts # Pipeline orchestrator: runFormation(input) → FormedMemory
|
|
178
|
+
extract.ts # Stage 1: Fact extraction + normalization
|
|
179
|
+
resolve.ts # Stage 2: Entity resolution + consolidation (absorbs compact)
|
|
180
|
+
evaluate.ts # Stage 3: Knowledge value assessment
|
|
181
|
+
types.ts # FormedMemory, stage interfaces
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## 7. Migration Strategy
|
|
185
|
+
|
|
186
|
+
1. **Phase A**: Build Formation Pipeline as a standalone module with unit tests
|
|
187
|
+
2. **Phase B**: Wire into `memorix_store` (server.ts), replacing compact-on-write
|
|
188
|
+
3. **Phase C**: Wire into hooks (handler.ts), replacing `buildObservation()`'s template logic
|
|
189
|
+
4. **Phase D**: Add pipeline metrics to dashboard
|
|
190
|
+
|
|
191
|
+
Each phase is independently shippable and testable.
|
|
192
|
+
|
|
193
|
+
## 8. Rules-based Quality Guarantees (No LLM)
|
|
194
|
+
|
|
195
|
+
Even without LLM, the pipeline should:
|
|
196
|
+
|
|
197
|
+
| Aspect | Current | After Formation |
|
|
198
|
+
|--------|---------|----------------|
|
|
199
|
+
| Fact extraction | None (caller-provided only) | Regex-based key-value, error, path extraction |
|
|
200
|
+
| Entity resolution | Caller-provided entityName | Match against existing KG entities |
|
|
201
|
+
| Title quality | "Updated file.ts" from hooks | First meaningful sentence extraction |
|
|
202
|
+
| Noise filtering | `significanceFilter` (pattern matching) | Value score with multi-factor assessment |
|
|
203
|
+
| Dedup | Similarity threshold only | Similarity + entity overlap + contradiction detection |
|
|
204
|
+
|
|
205
|
+
## 9. LLM Quality Uplift
|
|
206
|
+
|
|
207
|
+
With LLM, each stage gets a single-call enhancement:
|
|
208
|
+
|
|
209
|
+
| Stage | LLM Enhancement |
|
|
210
|
+
|-------|----------------|
|
|
211
|
+
| Extract | 3-5 atomic facts + entity suggestion + type verification |
|
|
212
|
+
| Resolve | Semantic similarity + contradiction detection + rewrite |
|
|
213
|
+
| Evaluate | Value assessment with explanation |
|
|
214
|
+
|
|
215
|
+
**Key design choice**: Each stage makes **at most 1 LLM call**. Total pipeline = max 3 LLM calls per store operation. In practice, Stage 2 and 3 can share a call, so typical = 2 calls.
|
|
216
|
+
|
|
217
|
+
## 10. Success Metrics (for future Eval)
|
|
218
|
+
|
|
219
|
+
- **Fact density**: avg facts per observation (before vs after)
|
|
220
|
+
- **Title quality**: % of non-generic titles
|
|
221
|
+
- **Entity coherence**: % of observations linked to existing KG entities
|
|
222
|
+
- **Noise rejection rate**: % of ephemeral content discarded
|
|
223
|
+
- **Duplicate reduction**: observation count growth rate (lower = better)
|
|
224
|
+
- **LLM uplift delta**: quality scores with vs without LLM
|