Agent 命名空间隔离
wesgine Cell 内 Agent 作为次级隔离的命名空间设计。
Agent 是 Cell 内次级隔离
Agent 共享 Cell 物理资源,但拥有独立认知配置:
| 独立项 | 说明 |
|---|---|
| Prompt | 系统提示词 |
| Tool ACL | 工具访问控制列表 |
| Model | 使用的模型 |
| 命名空间 | agent://X/* |
命名空间规则
| 前缀 | 归属 | 可见性 |
|---|---|---|
agent://X/* | Agent X 专有 | 仅 Agent X |
cell://* | Cell 共享 | 所有 Agent |
AgentConfig
每个 Agent 有独立配置:
cell.Agents().Register(ctx, AgentConfig{
ID: "agent-legal",
DisplayName: "法务助手",
SystemPrompt: "你是一个专业的法务顾问...",
Skills: []string{"contract-review"}, // nil=全量, []=无
Model: "gpt-4o",
})
Skills 白名单
AgentConfig.Skills 是过滤器:
| 值 | 含义 |
|---|---|
nil | 使用全部可用 Skill |
[]string{} | 不使用任何 Skill |
[]string{"a","b"} | 只使用 a 和 b |
双层白名单:Cell DisabledEngineSkills × Agent Skills allowlist,AND 生效。
Agent CRUD API
cell.Agents().Register(ctx, config) // 注册/更新
cell.Agents().Get(agentID) // 获取单个
cell.Agents().List(ctx) // 列出全部
cell.Agents().Delete(ctx, agentID) // 删除
HTTP 端点
| 操作 | 端点 |
|---|---|
| 列出 | GET /cells/{id}/agents |
| 注册/更新 | POST /cells/{id}/agents |
| 获取 | GET /cells/{id}/agents/{aid} |
| 删除 | DELETE /cells/{id}/agents/{aid} |
Agent 与 Actor 的区别
| 维度 | Agent | Actor |
|---|---|---|
| 是什么 | AI 角色配置 | 请求发起人 |
| 物理隔离 | 命名空间 | 记忆 / Session / Token |
| 配置 | prompt / tools / model | 由身份系统提供 |
| 生命周期 | Cell 级 | 请求级 |
| 数量 | Cell 内可多个 | Run 内恰好一个 |
Agent 记忆隔离
Agent 级记忆通过命名空间隔离:
agent://legal/preferences → 法务助手的偏好
agent://research/conventions → 研究助手的习惯
agent://shared/guidelines → Agent 内共享通道
agent://shared/* 是 Agent 内的共享,不是 Cell 级共识。
相关文档
- Actor 模型 →
actor-model.md - 记忆命名空间 →
memory-namespace-details.md - Agent 记忆层 →
memory-agent-memory.md - Skill 系统 →
skill-system.md