ๆณจๅ†Œๅนถๅˆ†ไบซ้‚€่ฏท้“พๆŽฅ๏ผŒๅฏ่Žทๅพ—่ง†้ข‘ๆ’ญๆ”พไธŽ้‚€่ฏทๅฅ–ๅŠฑใ€‚

cv usk
@cv_usk
AI / Software Research Notes AI Agent, LLMOps, MLOps, Software Architecture ๆŠ•็จฟใฏๅ€‹ไบบใฎๆ„่ฆ‹ใงใ™ใ€‚
ๅŠ ๅ…ฅ May 2026
279 ๆญฃๅœจๅ…ณๆณจ    408 ็ฒ‰ไธ
# Decision Points in AI Agent Development # Orchestration vs Choreography ๐ŸŽผ ๐ŸŽฏ The Hook When coordinating multiple agents or services, you face a fundamental choice: place a conductor at the center, or let each component dance autonomously? Orchestration means a central authority controls everything. Choreography means each component reacts to events on its own. The locus of control is fundamentally different, and it shapes fault handling, auditing, debugging, and scaling in entirely different ways. ๐Ÿ“‹ Overview In orchestration, a central orchestrator defines the entire workflow, invokes components sequentially or in parallel, aggregates results, and decides the next step. Temporal, Airflow, and LangGraph's Supervisor pattern are typical implementation platforms. In choreography, each component subscribes to events on an event bus (Kafka, EventBridge, etc.), autonomously processes events it cares about, and publishes new events. No central entity knows the overall control flow. ๐Ÿ” Decision Points The primary axis is **accountability**. ๐Ÿ›๏ธ **Favor orchestration when**: - You need to explain the overall flow and decision rationale at each step after the fact - Strict sequencing constraints exist (review โ†’ approval โ†’ execution) - LLM outputs need validation or transformation before passing to the next step - Central budget management (tokens, time, cost) is required - Component count is roughly 10 or fewer ๐ŸŒŠ **Favor choreography when**: - High throughput and high scale are required and a central point becomes a bottleneck - Many teams independently develop and deploy components - "Reacting to events" is the primary processing pattern (notifications, logging, async aggregation) - Strict execution order tracking is unnecessary ๐Ÿ’ก Key Details ๐ŸŸข **Orchestration excels in clarity of control and auditability.** The entire workflow is defined in one place, so "how far have we progressed" and "why was this step executed" are always clear. Recovery from failures pinpoints exactly which step failed and resumes from there. Agent-specific advantage: LLM outputs can be validated before proceeding to the next step, blocking hallucination propagation at each stage. ๐ŸŸก **Choreography excels in loose coupling and scalability.** Components share only event schemas and know nothing about each other's existence. Adding a new component is just adding an event subscription -- no changes to existing components. Each component scales independently, with the event bus acting as a buffer to absorb temporary load spikes. โš–๏ธ Trade-offs | Dimension | Orchestration | Choreography | |---|---|---| | Overall state visibility | Always clear ๐ŸŸข | Requires event log correlation ๐Ÿ”ด | | Auditability | High (causal chains are traceable) | Low (distributed tracking needed) | | Scalability | Central becomes bottleneck | Independent component scaling | | Coupling | High (changes concentrate on center) | Low (schema sharing only) | | Hallucination control | Validate at each step | Each component needs own guardrails | | Team independence | Orchestrator changes cause conflicts | Independent development and deployment | ๐Ÿ› ๏ธ Use Cases ๐Ÿ”ต **Orchestration fits**: Business systems, regulated processes, review-approval workflows, processing requiring LLM output validation. Environments demanding accountability. ๐Ÿ”ด **Choreography fits**: High-throughput event-driven processing, notification/log aggregation/analytics pipelines. Large-scale systems where many teams independently develop components. ๐Ÿ“Œ **Default strategy**: For business systems, orchestration (centralized) is the default. In systems involving AI agents, a central entity that controls and validates LLM's probabilistic outputs is critical for both safety and auditability. A practical compromise is "centralized core, event-driven periphery" -- the orchestrator manages the main business flow while peripheral async processing (logging, notifications, analytics) is loosely coupled via events. #AIAgents# #SoftwareArchitecture#
ๆ˜พ็คบๆ›ดๅคš