Flux is a deterministic execution kernel for DAG-based workflows. It does not reason, it does not own users, and it does not manage conversations. It executes plans generated by Agent Runtime.
Flux 是一个与 Agent 解耦的 Workflow 执行内核。它接收一个 Plan(DAG),做依赖求解、并行调度、async/await、trace/replay。谁生成 Plan?Agent Runtime(code-agent、DreamAI、Claude Code…)。Flux 不关心。
flux kernel
/ | \
library MCP tool
(Go import) (stdio) (Agent)
| 模式 | 说明 | 适用 |
|---|---|---|
| Library | import "flux" → engine.Run() |
DreamAI(已有 Agent Runtime) |
| MCP Server | flux-mcp-server → plan_workflow tool |
Claude Code / 任何 MCP Agent |
| Tool 嵌入 | 实现 tools.Tool 接口,同进程调用 |
AgentKit / code-agent |
三种模式共享同一份内核代码。详见 docs/v3/architecture-v3.md。
Layer 1 UI AgentKit / DreamAI
Layer 2 Agent Runtime 决策层(Loop / Tool / Approval)
Layer 3 Tool Layer 普通工具 + Flux Workflow Tool
Layer 4 Workflow Runtime flux(DAG / Scheduler / Async / Trace)
Layer 5 Persistence Store 接口(SQLite / PG / Memory adapter)
export LLM_API_KEY="your-key"
go run ./cmd/flux-mcp-server在 Claude Code 或其他 MCP Agent 中配置此 server,即可使用 plan_workflow 工具。
import "flux/runtime"flux/runtime 只依赖 stdlib:Plan IR、Scheduler(依赖求解/并行/async/retry)、ExecState、PlanSource 接缝。零 flux/* 依赖。
import "flux/store"flux/store 定义 WorkflowStore、AwaitStore、TraceStore 接口。消费者提供 adapter(SQLite / PG / Memory),注入 Engine。
| v3 架构 | 五层架构、持久化端口、集成契约、设计原则、决策记录 |
| v3 开发计划 | 实施路线图 |
| code-agent 对接 | 给 code-agent 团队的架构对齐建议 |
| v2 文档 | 历史参考(核心设计保留) |