版本号:v0.1.0 最后更新:2026-04-04
本文档用于定义 AI分析员与系统其他部分之间的标准输入输出结构,确保 AI 编排过程具备:
AI分析员的输入应来自显式对象,而不是隐藏在代码、日志或会话上下文中的零散信息。
AI 输出不能只是自由文本分析。
AI 必须输出:
AI 负责规划,不负责宣称计划已经执行。
执行是否合法、是否成功,由实验执行器决定并返回。
AI分析员输入建议分为四类:
当系统刚接收到一个样本、尚未开始复杂分析时,应向 AI 提供初始输入。
建议结构:
type OrchestratorInput = {
observation: ObservationSummary
probeEvidence: EvidenceSummary[]
availableChains: ChainTemplateSummary[]
availableModules?: ModuleSummary[]
priorExperiments: ExperimentSummary[]
budget: AnalysisBudget
mode: "initial_analysis" | "iterative_analysis" | "final_review"
}
type ObservationSummary = {
id: string
modality: "audio"
durationMs: number
sampleRate: number
channels: number
tags: string[]
captureMetadata?: Record<string, unknown>
}
type EvidenceSummary = {
id: string
producerModuleId?: string
category: "feature" | "pattern" | "classification" | "anomaly"
values: Record<string, unknown>
confidence: number
}
type ChainTemplateSummary = {
id: string
name: string
purpose: string
signalProfiles: string[]
goals: string[]
costClass: "low" | "medium" | "high"
}
type ModuleSummary = {
id: string
stage: string
signalProfiles: string[]
goals: string[]
inputFormat: string
outputFormat: string
tunableParams: string[]
}
type ExperimentSummary = {
id: string
parentId?: string
hypothesisId?: string
pipelineSummary: string[]
scoreTotal: number
failureReasons: string[]
keyEvidence: string[]
}
type AnalysisBudget = {
maxExperiments: number
maxDepth: number
latencyBudgetMs?: number
preferLocalFirst?: boolean
}
AI 在大多数轮次都应输出“候选假设 + 下一轮实验计划”。
建议结构:
type OrchestratorPlan = {
hypotheses: Hypothesis[]
experiments: PlannedExperiment[]
stopDecision: StopDecision
notes?: string[]
}
type Hypothesis = {
id: string
label: string
rationale: string
confidence: number
relatedSignalProfiles: string[]
}
type PlannedExperiment = {
hypothesisId?: string
goal: string
preferredChainId?: string
pipeline: PlannedNode[]
expectedEvidence: string[]
stopIf: string[]
}
type PlannedNode = {
moduleId: string
params: Record<string, unknown>
}
type StopDecision = {
shouldStop: boolean
reason: string
}
当证据已足够但尚未进入最终汇报阶段时,AI 可以输出阶段性结论。
建议结构:
type InterimConclusion = {
summary: string
topHypotheses: RankedFinding[]
unresolvedQuestions: string[]
suggestedNextActions: string[]
}
type RankedFinding = {
label: string
confidence: number
supportingEvidence: string[]
contradictingEvidence: string[]
}
当 AI 判断分析可以结束时,应输出最终结论对象。
建议结构:
type FinalConclusion = {
summary: string
findings: RankedFinding[]
experimentsRun: string[]
uncertainty: string[]
suggestedNextActions: string[]
}
AI 不应输出:
实验执行器在消费 AI 输出时,应只读取结构化部分。
推荐规则:
experiments 字段中的节点信息建议标准循环如下:
OrchestratorInputOrchestratorPlanshouldStop = trueFinalConclusionAI 可以在下列情况下建议停止:
第一版建议使用严格 JSON 输出,而不是混合自由文本格式。
建议做法:
AI 编排层的价值不在于“会说”,而在于“能以结构化方式规划和迭代实验”。
因此第一版必须把 AI 输入输出规范固化为正式接口,而不是依赖随意 prompt 和自由回答。