Agent 配置

wesgine Agent 管理:注册、多实例、工具白名单、Skill 过滤与认知配置。


Agent API

HTTP 端点

方法路径说明
GET/agents列出 Agent
POST/agents注册/更新 Agent
GET/agents/{aid}获取单个 Agent
DELETE/agents/{aid}删除 Agent

SDK API

cell.Agents().Register(ctx, AgentConfig{...})
cell.Agents().Get(ctx, agentID)
cell.Agents().List(ctx)
cell.Agents().Delete(ctx, agentID)

AgentConfig 主要字段

字段说明
IDAgent 唯一标识
Name显示名称
SystemPrompt系统提示词
Model默认模型
SkillsSkill 白名单过滤器
Tools工具白名单
MaxTurns最大轮次
Temperature模型温度

Agent 是 Cell 内次级隔离

Agent 与 Cell 的关系:

Cell(物理隔离域)
  └── Agent A(独立认知配置)
  └── Agent B(独立认知配置)
  └── Agent C(独立认知配置)

共享 vs 独立

共享(Cell 级)独立(Agent 级)
物理资源prompt
Memory 存储tool ACL
Knowledge 语料model 选择
Provider 池Skills 白名单

命名空间


Skill 过滤

AgentConfig{
    Skills: nil,         // nil = 全量
    Skills: []string{},  // 空 = 无
    Skills: []string{"code-review", "test-engineering"},  // 白名单
}

双层白名单

Cell DisabledEngineSkills × Agent Skills → AND 生效

Cell 级禁用的 Skill,即使 Agent 允许,也不可见。


Tool 白名单

Agent 可限制可用的工具集:

AgentConfig{
    Tools: []string{"read", "grep", "exec"},  // 仅这些工具可用
}

多 Agent 场景

一个 Cell 可注册多个 Agent,每个 Agent 独立配置。

典型场景:

Run 指定 Agent

cell.Runtime().Run(ctx, AppRunRequest{
    AgentID: "agent-legal",
    Actor:   "alice",
    ...
})

Agent Memory 命名空间

Agent 级记忆存在 agent:// 命名空间内:

命名空间可见性
agent://legal/*仅 agent-legal
agent://legal/sharedagent-legal 内共享通道
cell://*全 Cell 共享

相关文档