179 questions
No questions match those filters.
← All questions
AgentsMedium· Multi-Agent Orchestration
How do agents communicate with each other in a multi-agent system?
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansThe mechanism should follow how tightly coupled the agents actually are, not be picked by default:
- Shared state — all agents read and write one state object. Simple, and fine for a tightly-coupled synchronous workflow where the agents were designed together and run in the same process, but it needs careful handling of concurrent writes to avoid one agent clobbering another’s update.
- Message passing — agents publish and subscribe to a queue (Kafka, Redis pub/sub) with structured messages. This decouples producer from consumer, handles async and long-running work well, and scales better than shared state once agents are running on separate processes or machines.
- A standardized protocol (A2A) — for agents that weren’t written together at all, possibly on different frameworks or by different teams entirely. Each agent publishes a capability description, and discovery plus calling conventions are standardized so one agent can find and invoke another without custom glue code.
Structured, typed messages — JSON schemas rather than free text — are worth insisting on regardless of which mechanism you pick, since the alternative is debugging failures where one agent silently misinterpreted what another one meant.