@yottameta/yotta-memory 0.16.7 → 0.17.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yottameta/yotta-memory",
3
- "version": "0.16.7",
3
+ "version": "0.17.0",
4
4
  "description": "Yuanyi (元忆) — boundary-aware, file-based memory for AI agents. File-based, zero-dependency, diff/rollback-able; FACT/PREF/BOUND/COMMIT types (public shared / private isolated), user-level + project-level storage; v0.12 reliability baseline (init guard, trash-based deletion, independent-volume backup/list/doctor/restore, start-of-work doctor, transactional snapshots before destructive writes), v0.10 consolidation (periodic summaries with provenance, near-duplicate auto-merge, per-type decay, batch audit + rollback), v0.9 recall quality + context focus + optional local embedding plugin, plus v0.8 semantic search, feedback loop, self-organization and distillation.",
5
5
  "license": "MIT",
6
6
  "keywords": [
package/references/faq.md CHANGED
@@ -92,3 +92,9 @@ yotta-memory recall <关键词> --agent <id> --agent-key-file "<AI_HOME>/.yotta-
92
92
 
93
93
  ## 16. 开工时怎么知道记忆库是否可靠?
94
94
  运行 `yotta-memory doctor`。它只读检查记忆库根目录、加密库密钥文件、公共索引、`agents.json` 与最近备份;`--json` 可输出机器可读结果。严重异常时会锁定 `maintain --apply`、`consolidate --apply`、`merge`、`archive` 与 `--purge` 等破坏性写入,`context` 也会在开工提醒中显示“破坏性写入已锁定”。先按 doctor 提示修复,再继续写操作。
95
+
96
+ ## 17. 记忆库很大,检索能快一点吗?
97
+ 公共索引超过 5000 条会按年份分片(`index-<year>.json`)。只关心某一年时用 `yotta-memory recall <关键词> --year 2026`(可重复传多次)或 `yotta-memory context --year 2026`:引擎只读取命中年份的分片文件,不再把所有年份载入内存。不传 `--year` 时行为与旧版完全一致(全量读取)。规模体检看 `yotta-memory doctor` 的「规模」段(条数 / 单目录最大文件数 / 索引总体积),阈值用 `config set scale_warn_entries` 等键调整。
98
+
99
+ ## 18. 怎么证明改了检索 / 索引之后「没变差」?
100
+ 用 `yotta-memory bench`。默认按库内条目做确定性抽样生成基线评测集,也可以用 `--evalset <文件>` 固定一组查询(评测集 v1:`{"version":1,"queries":[{"query":"...","expect":["<记忆 id>"]}]}`,记忆 id 写相对路径或文件名都可以)。报告给 Recall@k / MRR / nDCG@k / HitRate + 固定种子 bootstrap 95% 置信区间,并写明库指纹与评测集指纹——同库、同评测集、同参数必须同输出,所以改前跑一次、改后再跑一次就能直接对比。接 CI 用 `--gate mrr=0.6`(不达标 exit 1);`--ablate` 对比关键词 / 语义 × 融合 / 纯分四组;想要耗时再加 `--timing`(带上后报告标记为不可逐字节复算)。`bench` 全程只读:不重建索引、不写访问计数、不调用外部 embedding 插件;索引缺失或版本过旧时会提示先 `reindex`。
@@ -153,14 +153,15 @@ magic "YTMIDX1" (7B) | nonce(12B) | tag(16B) | ciphertext(JSON: {version, update
153
153
  |---|---|
154
154
  | `init [--project]` | 创建目录结构;默认用户级,`--project` 建项目级 |
155
155
  | `remember <type> <subject> <statement> [--owner <id>] [--source <来源>] [--weight <0..>] [--verify] [--no-hint]` | 写入;同 subject+statement 已存在则更新 `updated` 且 `weight` 取 max;`--source` 记录来源;`--weight` 重要性权重;`--verify` 写后回读校验;`--no-hint` 关闭类型启发式提示 |
156
- | `recall [关键词] [--type T] [--limit N] [--agent <id>] [--owner <id>] [--all] [--unsafe]` | 索引+TF 打分匹配;读取分区过滤;越界(读其它智能体私密)默认拒绝,需 grant / identity=user / `--unsafe` 授权;项目级优先;默认 50 条 |
156
+ | `recall [关键词] [--type T] [--limit N] [--year <yyyy>] [--agent <id>] [--owner <id>] [--all] [--unsafe]` | 索引+TF 打分匹配;读取分区过滤;越界(读其它智能体私密)默认拒绝,需 grant / identity=user / `--unsafe` 授权;项目级优先;默认 50 条;v0.17.0 起 `--year` 只读该年份分片(可重复传多次,不传即全量)|
157
157
  | `forget <文件>` | 删除(按路径或文件名)|
158
158
  | `archive [--days 180] [--threshold 0.4]` | 按盖棺分+年龄移入 `.archive/`(`vitality < threshold` 且超过 N 天)|
159
159
  | `reindex` | 全量扫描重建 `index.json`(手动改 .md 后校正)|
160
160
  | `export [--out f.json]` | 导出全部记忆为 JSON |
161
161
  | `import <f.json>` | 从 JSON 导入(幂等)|
162
162
  | `profile [--owner <id>]` | 用户画像聚合(零推断,写 `private/<owner>/profile.md`;跨 owner 默认拒绝)|
163
- | `context [--limit N] [--owner <id>] [--budget N] [--focus <关键词>] [--explain]` | 开工上下文包(stdout:身份 + 多智能体铁律 + 画像 + 长期摘要 + 任务相关记忆 + 近期走廊 + 近期高价值 + 边界 + 承诺 + 会话闭环契约;`--budget` 控制动态记忆字符预算)|
163
+ | `context [--limit N] [--owner <id>] [--budget N] [--focus <关键词>] [--year <yyyy>] [--explain]` | 开工上下文包(stdout:身份 + 多智能体铁律 + 画像 + 长期摘要 + 任务相关记忆 + 近期走廊 + 近期高价值 + 边界 + 承诺 + 会话闭环契约;`--budget` 控制动态记忆字符预算;`--year` 限定年份)|
164
+ | `bench [--evalset <文件>] [--k N] [--seed N] [--bootstrap N] [--ablate] [--gate <指标>=<数值>] [--timing] [--year <yyyy>] [--json] [--out <文件>]` | 可复算基准评测(v0.17.0):只读快照上重放检索打分与排序(`scoreCandidates` + `rankHits`,与 recall 同源),指标 Recall@k / MRR / nDCG@k / HitRate + 固定种子 bootstrap 95% CI;报告含索引与评测集指纹,默认不含墙钟时间;`--gate` 不达标 exit 1;不写访问计数、不重建索引、不调用 embedding 插件 |
164
165
  | `iam <id> [--name] [--user] [--relationship] [--force]` | 登记身份 + 自我档案(可选扩展显示名 / 用户 / 关系)|
165
166
 
166
167
 
@@ -3,7 +3,7 @@
3
3
  "slug": "yotta-memory",
4
4
  "name": "元忆",
5
5
  "package": "@yottameta/yotta-memory",
6
- "version": "0.16.7",
6
+ "version": "0.17.0",
7
7
  "trust": "yottameta",
8
8
  "install": {
9
9
  "idempotent": true