CNB Agentic Memory
基于 CNB 平台的智能体记忆工具:以 Issue 为存储、知识库为语义检索,把 CNB 的 Issue、知识库、检索能力组合成一个开箱即用的记忆层。
功能特性
- 一记忆 = 一 Issue — Issue
number即记忆唯一标识,免自定义 id / 免并发仲裁 - 双通道检索 — 知识库语义检索(按内容模糊查找)+ 关键词标题检索(无需知识库),按需选路
- 结构化组织 — 分类(
category:xxx,CNB 平台约定)与标签过滤,适合按已知维度浏览 - 多形态 — Python SDK / CLI / MCP Server / Agent Skill,同一语义层按需取用
- 实测背书 — 两步写入、写后回读校验、超长拆分等架构红线全部来自 PoC 实测
前置准备
开始使用前需要准备三件事:
- 创建专用私有仓库——作为记忆仓库。必须是专用仓库(全部 Issue 均为记忆),检索与列表不做记忆/普通 Issue 区分
- 获取 CNB 访问令牌——在 CNB 个人设置中创建,需
repo-issue:rw(Issue 读写)+repo-code:r(知识库检索)权限 - 配置知识库入库流水线——在记忆仓库的
.cnb.yml挂载knowledge:update流水线($键下),语义检索依赖它;必须先配置再写入,错过事件的记忆不会被补录
令牌与配置的完整说明见 docs/API.md · 配置;流水线 YAML 示例见 docs/API.md · 记忆仓库前置条件。
安装
uvx cnb-agentic-memory --help # 免安装直接运行(推荐)
uv add "cnb-agentic-memory[mcp]" # 或安装为依赖(含 MCP Server)
pip install "cnb-agentic-memory[mcp]" # 或 pip
快速开始
配置环境变量(四种形态通用):
export CNB_AGENTIC_MEMORY_TOKEN="<你的访问令牌>"
export CNB_AGENTIC_MEMORY_REPO="<组织名>/<仓库名>"
Agent Skill 是本工具的首要使用方式——安装 skill 后,智能体在对话中自动调用,无需手动执行任何命令:
# 安装 skill(任选一源)
npx skills add https://cnb.cool/xqitw/cnb-agentic-memory.git
npx skills add https://github.com/xqitw/cnb-agentic-memory.git
之后对智能体说一句话即可:
用户:记住这个:我们的 CI 用 cnb 流水线,配置文件是 .cnb.yml
智能体:(自动调用 skill 写入记忆,自动提炼 title 与标签)
用户:上次我们的 CI 是怎么配的?
智能体:(自动检索记忆,找回上面那条)
其他形态:希望手动操作可用 CLI,集成到自建智能体可用 MCP Server 或 Python SDK,见下方使用形态。
使用形态
| 形态 | 入口 | 文档 |
|---|---|---|
| Python SDK | from cnb_agentic_memory import CNBApiClient, Memory |
docs/API.md(配置、错误处理、语义层设计约定) |
| CLI | cnb-agentic-memory --help |
docs/CLI.md(命令清单、错误处理) |
| MCP Server | cnb-agentic-memory-mcp(需 [mcp] extra) |
docs/MCP.md(客户端接入配置、智能体使用指导) |
| Agent Skill | npx skills add https://cnb.cool/xqitw/cnb-agentic-memory.git 或 GitHub 源 https://github.com/xqitw/cnb-agentic-memory.git |
skills/cnb-agentic-memory/SKILL.md |
贡献
欢迎参与贡献!开发环境搭建、分支与提交流程请参考 CONTRIBUTING.md。
License
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 cnb_agentic_memory-2.0.1.tar.gz.
File metadata
- Download URL: cnb_agentic_memory-2.0.1.tar.gz
- Upload date:
- Size: 50.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cea14b9effd79380ba46e1db899725b2d4070c70c1222460c4d3bb60a2c86c49
|
|
| MD5 |
2c1ef2bbce9025c00fa3558b9b6a8b60
|
|
| BLAKE2b-256 |
89e8af692bc968639044fbdb7554cd2f1bb60c48976b4bebd9001515b1ba4181
|
File details
Details for the file cnb_agentic_memory-2.0.1-py3-none-any.whl.
File metadata
- Download URL: cnb_agentic_memory-2.0.1-py3-none-any.whl
- Upload date:
- Size: 29.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b51671c362a857e064be3137fd812f7e107272ade32ea9873fea9fa610f39644
|
|
| MD5 |
6b0abc8a3cfef594395f16552b171664
|
|
| BLAKE2b-256 |
94d72e5b5339074a5f680665c2d4b04c6e89a77b07b367481482b3696de01550
|