cnb-agentic-memory 0.1.0__py3-none-any.whl
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.
- cam/__init__.py +9 -0
- cam/cli.py +6 -0
- cam/mcp_server.py +6 -0
- cam/py.typed +0 -0
- cnb_agentic_memory-0.1.0.dist-info/METADATA +117 -0
- cnb_agentic_memory-0.1.0.dist-info/RECORD +9 -0
- cnb_agentic_memory-0.1.0.dist-info/WHEEL +4 -0
- cnb_agentic_memory-0.1.0.dist-info/entry_points.txt +3 -0
- cnb_agentic_memory-0.1.0.dist-info/licenses/LICENSE +21 -0
cam/__init__.py
ADDED
cam/cli.py
ADDED
cam/mcp_server.py
ADDED
cam/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: cnb-agentic-memory
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: cnb-agentic-memory (cam) — 通用智能体记忆工具:以 CNB Issue 为存储、知识库为检索的 MCP Server
|
|
5
|
+
Project-URL: Homepage, https://cnb.cool/cnpc/cam
|
|
6
|
+
Project-URL: Repository, https://cnb.cool/cnpc/cam
|
|
7
|
+
Project-URL: Issues, https://cnb.cool/cnpc/cam/-/issues
|
|
8
|
+
Author: cnb-agentic-memory Contributors
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agent,cnb,knowledge-base,llm,mcp,memory
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Requires-Dist: httpx>=0.27
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: mcp<2,>=1.2.0; extra == 'dev'
|
|
24
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: respx>=0.21; extra == 'dev'
|
|
28
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
29
|
+
Provides-Extra: mcp
|
|
30
|
+
Requires-Dist: mcp<2,>=1.2.0; extra == 'mcp'
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# cnb-agentic-memory (cam)
|
|
34
|
+
|
|
35
|
+
[](https://cnb.cool/cnpc/cam/-/badge/release.link)
|
|
36
|
+
[](https://pypi.org/project/cnb-agentic-memory/)
|
|
37
|
+
[](./LICENSE)
|
|
38
|
+
[](https://www.python.org)
|
|
39
|
+
|
|
40
|
+
基于 CNB 平台构建的通用智能体记忆工具 —— 以 CNB Issue 为存储、CNB 知识库为语义检索,以 MCP Server 形式让任何智能体"记住"跨会话、跨任务的信息。
|
|
41
|
+
|
|
42
|
+
> **核心思路**:完全依托 CNB 现成能力,不写一行存储/检索代码。存储、向量化、检索全部由 CNB 平台承担,cam 只是一个轻量适配层。设计文档见 [Issue #1](https://cnb.cool/cnpc/cam/-/issues/1)。
|
|
43
|
+
|
|
44
|
+
## 工作原理
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
智能体 ←MCP→ cam MCP Server ←纯 API→ CNB Issue 存储 + 知识库检索
|
|
48
|
+
↑
|
|
49
|
+
issue.open/update/comment/close 事件自动触发 knowledge:update 向量化
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
- **一条记忆 = 一个 Issue**:`number` 即记忆 id,天然唯一,并发写零冲突
|
|
53
|
+
- **写入即入库**:Issue 变更事件自动触发知识库同步(约 1~2 分钟可检索)
|
|
54
|
+
- **语义检索**:知识库向量召回,从 `metadata.path` 直接定位记忆原文
|
|
55
|
+
- **软删除**:`state=closed` 归档可恢复,`activities` 免费审计日志
|
|
56
|
+
|
|
57
|
+
## 安装
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
uvx cam-mcp # 免安装直接运行 MCP Server
|
|
61
|
+
pip install "cnb-agentic-memory[mcp]" # 含 MCP 支持
|
|
62
|
+
uv tool install cnb-agentic-memory[mcp]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## MCP 接入
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"mcpServers": {
|
|
70
|
+
"cam": {
|
|
71
|
+
"command": "cam-mcp",
|
|
72
|
+
"env": {
|
|
73
|
+
"MEMORY_REPO": "group/memory-repo",
|
|
74
|
+
"CNB_TOKEN": "<你的 CNB 访问令牌>"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
环境变量:
|
|
82
|
+
|
|
83
|
+
| 变量 | 说明 |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| `MEMORY_REPO` | 记忆仓库 slug,如 `group/memory-repo` |
|
|
86
|
+
| `CNB_TOKEN` | 访问令牌,需 `repo-issue:rw`(Issue 读写)+ `repo-code:r`(知识库检索) |
|
|
87
|
+
|
|
88
|
+
## 工具清单
|
|
89
|
+
|
|
90
|
+
| 工具 | 说明 |
|
|
91
|
+
| --- | --- |
|
|
92
|
+
| `memory_write` | 新增记忆(自动生成关键词标题,两步写入标签) |
|
|
93
|
+
| `memory_update` | 修改记忆内容/标签 |
|
|
94
|
+
| `memory_append` | 追加更新记录(评论,可被语义检索) |
|
|
95
|
+
| `memory_delete` | 软删除(归档,可恢复) |
|
|
96
|
+
| `memory_get` | 按编号精确读取 |
|
|
97
|
+
| `memory_list` | 按分类/标签列出 |
|
|
98
|
+
| `memory_list_recent` | 最近 N 条记忆 |
|
|
99
|
+
| `memory_search` | 语义检索(知识库向量召回为主通道) |
|
|
100
|
+
|
|
101
|
+
## 记忆仓库初始化
|
|
102
|
+
|
|
103
|
+
记忆仓库需配置 `.cnb.yml` 启用 Issue → 知识库同步(模板见 [Issue #1 §8](https://cnb.cool/cnpc/cam/-/issues/1))。后续版本将提供 `cam init --repo <slug>` 一键初始化。
|
|
104
|
+
|
|
105
|
+
## 文档
|
|
106
|
+
|
|
107
|
+
- [设计方案与实测依据](https://cnb.cool/cnpc/cam/-/issues/1) — 完整设计 + 全量 PoC 实测结论
|
|
108
|
+
- [贡献指南](CONTRIBUTING.md)
|
|
109
|
+
- [安全策略](SECURITY.md)
|
|
110
|
+
|
|
111
|
+
## 贡献指南
|
|
112
|
+
|
|
113
|
+
欢迎参与贡献!请参考 [CONTRIBUTING.md](./CONTRIBUTING.md)。
|
|
114
|
+
|
|
115
|
+
## 许可证
|
|
116
|
+
|
|
117
|
+
[MIT](./LICENSE)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
cam/__init__.py,sha256=0XwZ1s9XKUIxHtFshalSLdZ3E4P48GAsDmpe5xpr9xw,277
|
|
2
|
+
cam/cli.py,sha256=GTT_yQRJMReIuFqDKXYeMUGIQnqbBQR5S0dw5QH3-e0,209
|
|
3
|
+
cam/mcp_server.py,sha256=h80xZyW_q2W1TH254MHFzQxZcTpnt_aBYnKJPcR8t4E,291
|
|
4
|
+
cam/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
cnb_agentic_memory-0.1.0.dist-info/METADATA,sha256=cNH-bsQztbjgGdOhjCxHOX4TczOtttoAIwgYekL4Cak,4489
|
|
6
|
+
cnb_agentic_memory-0.1.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
7
|
+
cnb_agentic_memory-0.1.0.dist-info/entry_points.txt,sha256=Rqf_sJl4TF_OCGsyUdPoGzezuHLtwMNBQV7YwE513QA,67
|
|
8
|
+
cnb_agentic_memory-0.1.0.dist-info/licenses/LICENSE,sha256=gacCkk4qDNqGPIAWKTMclpfRZhb-x20RogZKai6B8So,1088
|
|
9
|
+
cnb_agentic_memory-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 cnb-agentic-memory Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|