AI Invite · Memory / 爱邀记忆内核
面向 AI 伴侣的可验证、可携带的记忆内核与人格层。
人格不活在权重里,而活在一份可以重算的产物 + 一组可以验证的测试里。
当前状态:v0.26-m21 · 383 个测试全绿 · 30 个 tag · 0 第三方依赖
顺序:证据层 → 主题与规则 → 检索 → 人格内核 → 行为身份 → 载荷 → 轨迹投影 → 增量编译。(见
AGENTS.md §1)
另外两份完整文档:
- AI 角色哀悼与继承协议 V7.0:
docs/PROTOCOL-V7.md—— 人死后人格与情感记忆如何被继承。工程定稿,尚未实现(aiinvite/succession目前是 M15 的胶囊 V1;按宪章,活着的用户路径优先)。- 影响评估:
docs/IMPACT-PROTOCOL-V7.md
安装
pip install ai-invite-memory # 零第三方依赖,Python 3.11+
没有 PyPI 账号也行,直接装 Release 里的 wheel:
下载页 · 详见 docs/INSTALL.md
想看它到底能做什么? 装完跑一个 60 秒的窗口:
python -m aiinvite.demo.app
按一次「换模型」——kid 不变、用户卡不变,回答换了一个模型的声音。详见 aiinvite/demo/README.md。
这是内核,不是成品应用。 它没有界面、不调模型;要「双击就能用」的产物,需要在其上再加一层(见 INSTALL §4)。
它是什么
它能回答什么问题
| 问题 | 机制 | 实测 |
|---|---|---|
| 记忆有没有被改过? | 追加链 + 哈希链 | 改 1 字节即被发现;python -m aiinvite.kernel.cli compile 默认先验链(E_KN_TAMPER) |
| 换设备还能用吗? | 单一胶囊文件,人格到岸重算 | 设备 B 重算 kid 相同 |
| 换模型还是同一个人吗? | 内容身份 kid + 行为身份 PCS | PCS = 0.649(95% CI [0.522, 0.754]);PCS 是评测结果,不随胶囊携带 |
| 上下文会很贵吗? | 预算装配(4k 上限) | 20 万条记忆 p50 13 ms |
| 中文能零模型解析吗? | 规则层(称谓 / 时间 / 俚语) | 留出集 14/14 |
一条命令跑起来
python -m unittest discover -s tests -v # 383 tests,期望全绿
零第三方依赖,Python 3.11+。核心库不联网、不调模型——网络与模型调用只出现在 tools/。
目录
aiinvite/ 证据层:容器、哈希链、字节可复现
aiinvite/cn/ 中文规则层:称谓图、相对时间、梗时效、繁简
aiinvite/recall/ 检索与预算装配:FTS5 + 二元切分 + 4k 上限
aiinvite/kernel/ 人格内核:确定性编译、门控、历史、提案
aiinvite/pcs/ 行为身份:PCS、可执行规则、坍塌深度
tools/ 外部适配器(网络只在这里):提案器、回复采集、矩阵实验
experiments/ 实验产物:回复集与矩阵结果
docs/ 规格、验收记录、结果、论文
关键文档
| 文档 | 内容 |
|---|---|
| docs/PAPER.md | 论文正文(中文) |
| docs/PAPER-en.md | 论文正文(English) |
| docs/RESULTS-rater-comparison.md | 模型 vs 真人:同一套规则的通过率 |
| docs/RESULTS-judge-validity.md | 判定器效度:κ 的四轮递进 |
| docs/RESULTS-variance.md | 方差与分辨力:采样下 PCS 测不出差异 |
| docs/SPEC-CHECKLIST.md | 规格自检清单 |
| AGENTS.md | 开发约束与里程碑状态 |
| CHANGELOG.md | 11 个里程碑的来龙去脉 |
证据一览
内容身份 跨进程 kid 一致 / 删内核重建一致 / 换设备一致 / 提案删了 kid 回来
行为身份 PCS = A × min(C);80 条可执行规则探针;判定器 κ = 0.690(60 条留出集)
人类基线 191 条真人发言:R1 通过 10%、R5 通过 98% —— 规则是对 AI 的规定,不是人类行为描述
多轮坍塌 R = 0.389 / 0.556;D = 0.657 / 0.635
性能 20 万事件建索引 12 s;装配 p50 13 ms
明确没有的东西
- 没有真实长期用户数据(全部为合成场景 + 模型生成)
- 没有跨月回放
- 没有与其他记忆系统的横向实验
- 结论只适用于情绪支持模式(咨询模式规则集未做)
这些限制在论文 §7.2 逐条列出。
许可
Apache-2.0,见 LICENSE。
English: README-en.md
Metadata
Release files for ai-invite-memory 0.27.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ai_invite_memory-0.27.0.tar.gz | 257.6 kB | Without provenance | Details for ai_invite_memory-0.27.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ai_invite_memory-0.27.0-py3-none-any.whl | Python 3 | none | any | Details for ai_invite_memory-0.27.0-py3-none-any.whl |
Total release size: 455.5 kB
Release files / ai_invite_memory-0.27.0.tar.gz
| Download URL | ai_invite_memory-0.27.0.tar.gz |
|---|---|
| Size | 257.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
323bfb1b73fc65113d9759c74a74f341085326845b6fd2d14330714c7e5fd493
|
|
BLAKE2b-256 checksum How to use checksums |
5e0436daa59bbdff1166179410f9b28f26cf5140b9501ba6bdcd0cea1d84044f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / ai_invite_memory-0.27.0-py3-none-any.whl
| Download URL | ai_invite_memory-0.27.0-py3-none-any.whl |
|---|---|
| Size | 197.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f5b735ef533bf20b90877fa1725909d9688d131b39c54d170aad42f9c26f8785
|
|
BLAKE2b-256 checksum How to use checksums |
945e13c90cb9d19487aa9965ac7573c662466c69cf57c148e986bd6475345103
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Security for ai-invite-memory 0.27.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.