架构与运行逻辑¶
IndustrialAgentFlow 的主线由四层组成:
1. 数据入口层
负责 YAML 导入、点位绑定和快照上下文构建。
2. Agent 层
Parser 负责字段映射,Generator 负责草案生成,Critic 负责失败修正指令。
3. 确定性校验层
执行模板校验与评分阈值检查,决定是否允许发布。
4. 执行评测层
运行预测优化仿真和批量评测。
主链路时序¶
sequenceDiagram
participant User as User
participant API as API
participant Loader as CatalogLoader
participant Repo as CatalogBundleRepo
participant Parser as ParserAgent
participant Generator as GeneratorAgent
participant Gate as Validator+QualityGate
participant Critic as CriticAgent
participant TplRepo as TemplateRepo
participant Pipeline as SimulationPipeline
User->>API: POST /v1/catalogs/import
API->>Loader: load(yaml, mode)
Loader-->>API: CatalogBundle
API->>Repo: put(bundle)
Repo-->>API: ok
User->>API: POST /v1/agentic/run-from-catalog
API->>Repo: get(catalog_id)
Repo-->>API: CatalogBundle
API->>Parser: build parser result from bindings
API->>Generator: generate draft
API->>Gate: validate + quality-check
alt gate pass
API-->>User: AgenticRunReport(approved)
else gate fail
API->>Critic: review(failed_draft, errors)
Critic-->>API: correction instruction
API->>Generator: regenerate with instruction
API->>Gate: validate + quality-check
end
User->>API: POST /v1/templates/publish
API->>TplRepo: publish(template)
User->>API: POST /v1/pipeline/simulate
API->>Pipeline: run(context, template)
Pipeline-->>User: PipelineResult
关键设计点¶
- LLM 不直接决定发布,发布由确定性检查决定。
- 点位输入支持大规模 legacy YAML,不要求逐点手填。
- 存储支持内存和文件后端,开发和轻量部署都可用。
- LLM 失败策略可配置,默认自动降级,支持严格失败。