Modern AI Engineering

Lesson 11.13 · 21 min · video lesson

Agent Communication: Protocols and Message Formats

When a billing agent and a tech-support agent need to work on the same customer, how do they actually talk: free text, JSON, a shared database, or a chat room?

In short: Agents communicate by exchanging messages or by reading and writing shared state. The four basic patterns are direct (one to one), centralized (through a hub), broadcast (one to all) and shared memory (a common blackboard). Good communication needs a clear message format, agreed rules (a protocol) and safeguards against lost context, loops and untrusted content.

What you will learn

  • What is agent communication?
  • Why do agents need to communicate?
  • What agents need in order to communicate
  • How a message flows between agents
  • The ways AI agents communicate
  • Direct Communication
  • Centralized Communication
  • Broadcast Communication
  • Shared Memory Communication
  • What a message looks like
  • The rules agents follow to talk
  • Challenges when agents communicate
  • Best Practices

In this lesson

  1. What is agent communication?
  2. Why do agents need to communicate?
  3. What agents need in order to communicate
  4. How a message flows between agents
  5. The ways AI agents communicate
  6. What a message looks like
  7. The rules agents follow to talk
  8. Challenges when agents communicate
  9. Best practices
  10. Worked example, step by step
  11. Practice: try it yourself

Key terms in this lesson

Direct communication
One agent sends a message to one specific agent.
Centralized communication
All messages pass through a hub (usually an orchestrator) that routes them.
Broadcast
One agent sends the same message to all agents or all subscribers of a topic.
Blackboard (shared memory)
A common store that agents read from and write to instead of messaging each other.
Message envelope
Structured fields (id, sender, receiver, intent) wrapped around a message's content.
Protocol
An agreed set of rules for message formats, allowed intents and the order of exchanges.
Performative / intent
A label for what a message does: request, inform, refuse, propose.

This lesson is part of the Generative AI Engineering and Complete AI Engineer tracks. See plans and pricing to open the full lesson, its video, labs and quiz, or try the free lesson first (free account needed).

← 11.12 Subagents: Delegating Tasks Within an Agent Network · 11.14 AI Orchestration: Coordinating Agents, Tools, and Flows →