@yottameta/yotta-memory 0.2.10 → 0.4.2
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/README.md +116 -14
- package/SKILL.md +153 -7
- package/USER_GUIDE.md +286 -0
- package/assets/banner.png +0 -0
- package/bin/yotta-memory.js +560 -71
- package/package.json +3 -2
- package/references/protocol.md +11 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yottameta/yotta-memory",
|
|
3
|
-
"version": "0.2
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "元忆 —— 有权限边界的文件式智能体记忆。文件式、零依赖、可 diff/回滚;FACT/PREF/BOUND/COMMIT 四分类(公共共享/私密隔离),用户级+项目级双级存储。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"SKILL.md",
|
|
16
16
|
"LICENSE",
|
|
17
17
|
"README.md",
|
|
18
|
+
"USER_GUIDE.md",
|
|
18
19
|
"install.sh",
|
|
19
20
|
"references",
|
|
20
21
|
"scripts",
|
|
@@ -32,4 +33,4 @@
|
|
|
32
33
|
"yotta-memory": "bin/yotta-memory.js",
|
|
33
34
|
"yotta-memory-install": "bin/install.js"
|
|
34
35
|
}
|
|
35
|
-
}
|
|
36
|
+
}
|
package/references/protocol.md
CHANGED
|
@@ -22,10 +22,20 @@
|
|
|
22
22
|
├── bounds/ # BOUND 边界(私密)
|
|
23
23
|
├── commits/ # COMMIT 承诺(私密)
|
|
24
24
|
├── .archive/ # 归档区(archive 命令移入)
|
|
25
|
-
├── index.json # 反向索引 + TF
|
|
25
|
+
├── index.json # 反向索引 + TF 打分(见下方说明)
|
|
26
|
+
├── agents.json # 智能体身份登记表(iam 写入,唯一性强制)
|
|
26
27
|
└── README.md # 记忆库说明
|
|
27
28
|
```
|
|
28
29
|
|
|
30
|
+
> **`index.json` 说明**:条目内的 `tokens` 字段是中文分词的「词频表」,供 recall 的 TF 打分使用,**不是**访问令牌。真正的访问令牌由 `token` 命令生成,存放在 `<root>/.server/tokens.json`,仅在局域网 `serve` 模式下用于请求鉴权。
|
|
31
|
+
|
|
32
|
+
## 2.5 智能体身份(谁在写 / 谁在读)
|
|
33
|
+
|
|
34
|
+
- **agent ID 必须全局唯一**:`iam <id>` 写入 `agents.json`(记忆库根目录),唯一性强制——ID 已被其它主机 / 来源(含远端 token 登记)占用则拒绝,确认是同一智能体才 `--force`。
|
|
35
|
+
- **当次身份声明**:`whoami` / MCP `agent_info` 读「当次声明身份」——本机 `YOTTA_AGENT_ID`(stdio 由 MCP 配置 `env` 注入,CLI 用 `--agent`/环境变量);远端 `X-Agent-Id` 请求头(经 token 绑定校验)。不猜不默认。
|
|
36
|
+
- **自我档案**:`iam` 自动写一条 PREF `subject=自我接入档案`(owner=自己),statement 为 `; ` 分隔的 key:value——`agent_id / host / memory_home / mcp_mode(stdio|http) / engine_url(仅远端) / token(仅远端;本机不存 token)`。
|
|
37
|
+
- **私密记忆必须有 owner**:PREF / BOUND / COMMIT 写入时未声明身份(owner 空)直接拒绝(公共 FACT 不受影响),从机制上防止「抄别人的 ID」。
|
|
38
|
+
|
|
29
39
|
## 3. 文件格式
|
|
30
40
|
|
|
31
41
|
每个记忆一条独立 `.md` 文件,文件名 `<YYYY-MM-DD>-<NNNN>.md`(NNNN 为当日序号):
|