Formation 拓扑
用可递归嵌套的超图把 MicroAgent、人类席位与子组织编排为管道、委派与网状协商。
Formation 是 Kernuq 的「三」:把智能体与人编成一支队伍。
节点
micro_agent:挂载一个或多个 Harness 的 MicroAgent,可设置carrier(in_process等)与lifecycle(resident/ephemeral)。human_seat:人类席位,配置交互类型(如approval)、送达方式与超时。nested_formation:嵌套的子 Formation,实现集团化。
边
| 类型 | 语义 |
|---|---|
pipe |
串并行管道,支持 fan_out.split_json_path 扇出与 fan_in.strategy(barrier_all / first_success / quorum_majority)扇入 |
delegate |
上级 → 下级委派,异常向上升级 |
mesh |
共享黑板主题的网状协商,支持 max_rounds、member_timeout_ms、quorum_min_responders |
示例:短剧制作组
uri: "org://formation/ancient-mystery-drama"
owner_unit_uri: "org://unit/group_hq/branch_sh"
entry_node_id: "chief_director"
run_limits:
max_total_steps: 160
max_tokens_per_run: 500000
nodes:
- id: "chief_director"
node_kind: "micro_agent"
lifecycle: "resident"
harnesses: [{ role: "execute", uri: "harness://drama/chief-director" }]
- id: "script_writer"
node_kind: "micro_agent"
lifecycle: "ephemeral"
harnesses: [{ role: "execute", uri: "harness://drama/script-writer" }]
- id: "storyboard_painters"
node_kind: "micro_agent"
pool_max_parallel: 8
harnesses: [{ role: "execute", uri: "harness://drama/storyboard-painter" }]
- id: "producer_final_review"
node_kind: "human_seat"
human_seat_spec:
assignee_uri: "human://branch_sh/seat_producer_lin"
interaction_kind: "approval"
timeout_sec: 7200
edges:
- { from: "chief_director", to: "script_writer", kind: "delegate" }
- from: "script_writer"
to: "storyboard_painters"
kind: "pipe"
fan_out: { split_json_path: "$.scenes[*]", max_concurrency: 8 }
fan_in: { strategy: "barrier_all" }
- { from: "storyboard_painters", to: "producer_final_review", kind: "pipe" }
部署
kernuq schema formation
运行期通过 formation.deploy 部署,或让 Cortex「一句话组建团队」(cortex.interact → cortex.confirm_team)。
# Formation 拓扑
用可递归嵌套的超图把 MicroAgent、人类席位与子组织编排为管道、委派与网状协商。
Formation 是 Kernuq 的「三」:把智能体与人编成一支队伍。
## 节点
- `micro_agent`:挂载一个或多个 Harness 的 MicroAgent,可设置 `carrier`(`in_process` 等)与 `lifecycle`(`resident` / `ephemeral`)。
- `human_seat`:人类席位,配置交互类型(如 `approval`)、送达方式与超时。
- `nested_formation`:嵌套的子 Formation,实现集团化。
## 边
| 类型 | 语义 |
| --- | --- |
| `pipe` | 串并行管道,支持 `fan_out.split_json_path` 扇出与 `fan_in.strategy`(`barrier_all` / `first_success` / `quorum_majority`)扇入 |
| `delegate` | 上级 → 下级委派,异常向上升级 |
| `mesh` | 共享黑板主题的网状协商,支持 `max_rounds`、`member_timeout_ms`、`quorum_min_responders` |
## 示例:短剧制作组
```yaml
uri: "org://formation/ancient-mystery-drama"
owner_unit_uri: "org://unit/group_hq/branch_sh"
entry_node_id: "chief_director"
run_limits:
max_total_steps: 160
max_tokens_per_run: 500000
nodes:
- id: "chief_director"
node_kind: "micro_agent"
lifecycle: "resident"
harnesses: [{ role: "execute", uri: "harness://drama/chief-director" }]
- id: "script_writer"
node_kind: "micro_agent"
lifecycle: "ephemeral"
harnesses: [{ role: "execute", uri: "harness://drama/script-writer" }]
- id: "storyboard_painters"
node_kind: "micro_agent"
pool_max_parallel: 8
harnesses: [{ role: "execute", uri: "harness://drama/storyboard-painter" }]
- id: "producer_final_review"
node_kind: "human_seat"
human_seat_spec:
assignee_uri: "human://branch_sh/seat_producer_lin"
interaction_kind: "approval"
timeout_sec: 7200
edges:
- { from: "chief_director", to: "script_writer", kind: "delegate" }
- from: "script_writer"
to: "storyboard_painters"
kind: "pipe"
fan_out: { split_json_path: "$.scenes[*]", max_concurrency: 8 }
fan_in: { strategy: "barrier_all" }
- { from: "storyboard_painters", to: "producer_final_review", kind: "pipe" }
```
## 部署
```bash
kernuq schema formation
```
运行期通过 `formation.deploy` 部署,或让 Cortex「一句话组建团队」(`cortex.interact` → `cortex.confirm_team`)。