Shared Memory
Share memories from your knowledge base with other users. Manage users, groups, and fine-grained permissions on namespaces.
Quick Start
CODEBLOCK0
Namespace Organization
CODEBLOCK1
Grant access to mark/shared/ → all shared content
Grant access to mark/shared/recipes/ → just recipes
Commands
Users
| Command | Description |
|---|
| INLINECODE2 | Create user |
| INLINECODE3 |
Delete user |
Groups
| Command | Description |
|---|
| INLINECODE4 | Create group |
| INLINECODE5 |
Delete group |
|
add-member <group> <user> | Add user to group |
|
remove-member <group> <user> | Remove user |
Permissions
| Command | Description |
|---|
| INLINECODE8 | Grant to org |
| INLINECODE9 |
Grant to user |
|
grant group <name> <action> <pattern> | Grant to group |
|
revoke <grant_id> | Revoke permission |
|
list | List all grants |
|
list-permissions | List effective permissions |
Actions: read, create, update, INLINECODE17
Subscriptions
| Command | Description |
|---|
| INLINECODE18 | Get notified on changes |
| INLINECODE19 |
Stop notifications |
|
list-subscriptions | List subscriptions |
Example: Family Sharing
CODEBLOCK2
Troubleshooting
If commands fail, first check if an Ensue API key is configured:
CODEBLOCK3
If no API key found, tell user to get a free key at https://www.ensue-network.ai/login and configure in ~/.clawdbot/clawdbot.json:
CODEBLOCK4
If key exists but commands fail, the key may be invalid - have user generate a new one.
共享内存
将知识库中的记忆与其他用户共享。管理用户、群组以及对命名空间的细粒度权限。
快速开始
bash
创建用户和群组
{baseDir}/scripts/shared-memory.sh create-user mark
{baseDir}/scripts/shared-memory.sh create-group family
{baseDir}/scripts/shared-memory.sh add-member family mark
授予访问权限
{baseDir}/scripts/shared-memory.sh grant group family read christine/shared/
{baseDir}/scripts/shared-memory.sh grant group family update christine/shared/
命名空间组织
<用户名>/
├── private/ # 仅该用户可访问
├── shared/ # 与他人共享
└── public/ # 对他人只读
授予对 mark/shared/ 的访问权限 → 所有共享内容
授予对 mark/shared/recipes/ 的访问权限 → 仅食谱内容
命令
用户
| 命令 | 描述 |
|---|
| create-user <用户名> | 创建用户 |
| delete-user <用户名> |
删除用户 |
群组
| 命令 | 描述 |
|---|
| create-group <名称> | 创建群组 |
| delete-group <名称> |
删除群组 |
| add-member <群组> <用户> | 将用户添加到群组 |
| remove-member <群组> <用户> | 移除用户 |
权限
| 命令 | 描述 |
|---|
| grant org <操作> <模式> | 授予组织权限 |
| grant user <名称> <操作> <模式> |
授予用户权限 |
| grant group <名称> <操作> <模式> | 授予群组权限 |
| revoke <授权ID> | 撤销权限 |
| list | 列出所有授权 |
| list-permissions | 列出有效权限 |
操作:read(读取)、create(创建)、update(更新)、delete(删除)
订阅
| 命令 | 描述 |
|---|
| subscribe <键> | 获取变更通知 |
| unsubscribe <键> |
停止通知 |
| list-subscriptions | 列出订阅 |
示例:家庭共享
bash
为伴侣创建用户
{baseDir}/scripts/shared-memory.sh create-user mark
创建家庭群组
{baseDir}/scripts/shared-memory.sh create-group family
{baseDir}/scripts/shared-memory.sh add-member family mark
授予对 shared/ 命名空间的相互访问权限
{baseDir}/scripts/shared-memory.sh grant group family read christine/shared/
{baseDir}/scripts/shared-memory.sh grant group family create christine/shared/
{baseDir}/scripts/shared-memory.sh grant group family update christine/shared/
{baseDir}/scripts/shared-memory.sh grant group family read mark/shared/
{baseDir}/scripts/shared-memory.sh grant group family update mark/shared/
故障排除
如果命令执行失败,首先检查是否配置了 Ensue API 密钥:
bash
echo $ENSUEAPIKEY
grep -A2 ensue-learning-memory ~/.clawdbot/clawdbot.json
如果未找到 API 密钥,告知用户前往 https://www.ensue-network.ai/login 获取免费密钥,并在 ~/.clawdbot/clawdbot.json 中配置:
json
{
skills: {
entries: {
ensue-learning-memory: {
apiKey: 在此处填写用户的API密钥
}
}
}
}
如果密钥存在但命令执行失败,则密钥可能无效——请让用户生成一个新密钥。