Trinity: A Triune Architecture for AGI Long-Term Memory — 122 modules, 50-tier guardian chain, 47 retrieval channels
Project description
Trinity Memory — 三位一体长程记忆系统
快速开始
# 安装
pip install trinity-memory
# Python API
from trinity import Trinity
mem = Trinity()
mem.ingest("用户偏好暗色模式", tags=["preference", "ui"])
results = mem.search("用户偏好")
print(results)
# 启动 API 服务
trinity-api --port 8100
# 启动 MCP Server
trinity-mcp --mode stdio
架构
Trinity 是三位一体记忆架构,整合了 12+ 业界最优方案:
| 层级 | 组件 | 对齐方案 |
|---|---|---|
| 检索层 | CB53 BEAM-LIGHT | ICLR 2026 BEAM 基准 |
| CB54 Exabase 三阶段检索 | LongMemEval 96.4% SOTA | |
| CB55 Hindsight 四网络 | BEAM 10M SOTA 64.1% | |
| CB56 Zikkaron Hopfield | 非LLM SOTA 40.4% | |
| 记忆层 | CB45-CB48 级联提取 | ByteRover / Mem0 / Graphiti |
| CB49-CB52 关系管理 | Supermemory / Mastra / MemMachine | |
| CB57 自优化 | SelfMem July 2026 | |
| 保护层 | 50 级 Guardian 链 | 遗忘防护 / 压缩审计 |
| 检索通道 | 47 路融合检索 | 语义/图谱/精确/混合 |
快速集成
作为 MCP Server
Trinity 提供标准 MCP 接口,可被任何 MCP 客户端调用:
{
"mcpServers": {
"trinity-memory": {
"command": "trinity-mcp",
"args": ["--mode", "stdio"]
}
}
}
8 个工具可用:memory_search, memory_write, memory_update, memory_delete, audit_query, trinity_diagnostics, memory_chronicle, memory_tag_search
作为 REST API
# 写入记忆
curl -X POST http://localhost:8100/memories \
-H "Content-Type: application/json" \
-d '{"content":"用户信息","importance":0.8}'
# 搜索记忆
curl "http://localhost:8100/search?q=用户&top_k=5"
部署
Docker
docker build -t trinity-memory .
docker run -d -p 8100:8100 -p 8000:8000 -v /data:/data trinity-memory
一键启动
# Windows
start_trinity.bat
# Linux/Mac
chmod +x docker-entrypoint.sh
./docker-entrypoint.sh
商业化
| 产品 | 定价 | 适用场景 |
|---|---|---|
| MCP Server | 免费开源 | AI Agent 集成 |
| SaaS API | 按量付费 | 应用开发 |
| 企业私有部署 | 许可证 | 合规需求 |
许可证
MIT License — 可自由使用于商业和非商业项目。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trinity_memory-6.36.0.tar.gz.
File metadata
- Download URL: trinity_memory-6.36.0.tar.gz
- Upload date:
- Size: 414.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f44897d6810d10b143a653b2938ec954683647a2508750de3de92fec43e08eda
|
|
| MD5 |
c5b0dae166535e1da33380198f2ae4c5
|
|
| BLAKE2b-256 |
adfc0e0da6e91504bea0eff51606145e71555fff6165f6dbaeac2e25483fd251
|
File details
Details for the file trinity_memory-6.36.0-py3-none-any.whl.
File metadata
- Download URL: trinity_memory-6.36.0-py3-none-any.whl
- Upload date:
- Size: 437.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d2937634eb8231fdff8213899ce5db2408208babbc433d25bed0b955020ce14
|
|
| MD5 |
cb6dfaa4158abaaf4cb3a9c219b9c0f1
|
|
| BLAKE2b-256 |
e5e912260bbdfe7a5681111921f85fb8e8e5bb56692d33d8c3f6f843cd02cd64
|