Page:
Architecture
No results
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
架构概览
毕织系统从底到顶分为四层:
┌─────────────────────────────────────────┐
│ 应用层 (Applications) │
│ Bootstrap · 示例 · 用户自定义系统 │
├─────────────────────────────────────────┤
│ 协同层 (Orchestration) │
│ 模板引擎 · Pipeline · 中间件 · Webhook │
├─────────────────────────────────────────┤
│ 运行时层 (Runtime) │
│ Agent · 状态机编译器 · 事件系统 · MCP │
├─────────────────────────────────────────┤
│ 提供者层 (Providers) │
│ LLM (DeepSeek/OpenAI/Anthropic) · MCP │
└─────────────────────────────────────────┘
编译层
- DSL 定义 — JSON 描述 Agent 状态机(状态、转换、守卫、超时)
- 编译器 — DSL → asyncio 协程,支持复合状态嵌套和事件冒泡
- 多事件源 — Agent 可同时监听多个事件队列
运行时层
- Agent 生命周期 — 邮箱通信、状态转换、动作函数执行
- 热重载 — 不重启系统即可更新 Agent 定义
- 持久化 — 快照保存/恢复
协同层
- 流模板系统(v0.2)— 元策略模板 + 节点填充 → 自动生成多 Agent 系统
- Pipeline — 跨 Agent 的流程编排
- 中间件链 — 事件拦截、转换、过滤、审计
- Webhook — Forgejo / GitHub 事件接入
提供者层
- LLM Provider — 统一接口封装 DeepSeek / OpenAI / Anthropic
- MCP 协议 — 外部工具集成(文件读写、Git 操作等)
- Tool Loop — LLM 自动调用工具、循环推理
设计原则
- 状态机骨架是确定的 — LLM 的随机性被限制在动作函数内部
- 节点是独立的 — 每个 Agent 有自己的状态和节奏,不知道其他 Agent 内部状态
- 通过事件耦合 — Agent 之间不直接调用,只通过事件通信
- 可调试 — 每个节点可独立运行和测试