在 iii 引擎上创建并编排多智能体流水线。适用于构建 AI 智能体协作、智能体编排、研究/评审/综合等场景。
Comparable to: LangGraph, CrewAI, AutoGen, Letta
Use the concepts below when they fit the task. Not every agentic workflow needs all of them.
text
HTTP request
→ Enqueue(agent-tasks) → Agent 1 (researcher) → writes state
→ Enqueue(agent-tasks) → Agent 2 (critic) → reads/updates state
→ explicit approval check (is-approved?)
→ Enqueue(agent-tasks) → Agent 3 (synthesizer) → final state update
→ publish(research.complete)
PrimitivePurposeregisterWorkerInitialize the worker and connect to iiiregisterFunctionDefine each agenttrigger state::set, state::get, state::updateShared context between agentstrigger({ ..., action: TriggerAction.Enqueue({ queue }) })Async handoff between agents via named queuetrigger({ function_id, payload })Explicit condition check before enqueuingtrigger({ function_id: 'publish', payload, action: TriggerAction.Void() })Broadcast completion to any listenersregisterTrigger({ type: 'http' })Entry point
See ../references/agentic-backend.js for the full working example — a multi-agent research pipeline where a researcher gathers findings, a critic reviews them, and a synthesizer produces a final report.
Code using this pattern commonly includes, when relevant:
registerWorker(url, { workerName }) — worker initializationtrigger({ function_id, payload, action: TriggerAction.Enqueue({ queue }) }) — async handoff between agentsstate::set, state::get, state::update — shared context between agentsawait iii.trigger({ function_id: 'condition-fn', payload }) before enqueuing next agenttrigger({ function_id: 'publish', payload: { topic, data }, action: TriggerAction.Void() }) — completion broadcastregisterFunction with agents:: prefix IDsconst logger = new Logger() — structured logging per agentUse the adaptations below when they apply to the task.
TriggerAction.Enqueue({ queue })iii-config.yaml under queue_configsresearch-tasks, support-tickets)functionId segments should reflect your agent hierarchy (e.g. agents::researcher, agents::critic)Named queues for agent handoffs are declared in iii-config.yaml under queue_configs. See ../references/iii-config.yaml for the full annotated config reference.
registerFunction (including prompts asking for { path, id } endpoint maps + loops), prefer iii-http-invoked-functions.iii-agentic-backend when the primary problem is multi-agent orchestration, queue handoffs, approval gates, and shared context.iii-agentic-backend in the iii engine.