A Message is how agents send and receive information in ACP. Messages consists of a sequence of ordered parts, forming complete, structured, multi-modal communications.
Message Role
Each message must specify a role that identifies the sender. Valid role formats are:
user - for messages from users
agent - for generic agent messages
agent/{name} - for specific agent messages where name can contain alphanumeric characters, underscores, and hyphens (e.g. agent/image-analyzer, agent/chat_bot)
Message Parts
Artifacts
Artifacts are specialized MessageParts with a name attribute. They represent important outputs like:
- Attachments
- Citations
- Files
- Named results
MessageParts can include optional metadata to provide additional context or semantic information. ACP supports standardized metadata types for citations and trajectory information.
For detailed information about metadata types, usage patterns, and examples, see Message Metadata.
Examples
Messages are made of ordered parts. The order determines how content is presented or processed.
Basic Text Message
Agent Response Message
Multi-modal Message with Image
Message with an Artifact
Content Delivery Methods
Inline Content
Best for small, text-based, or simple data:
Referenced Content (URL)
Best for larger files, external resources, or when inline embedding is impractical:
Base64 Encoded Content
Best for binary data (images, documents) embedded directly:
Data Models
For detailed metadata type definitions, see Message Metadata.
Artifacts inherit all validation rules from MessagePart so they must also have either content or content_url (never both).
Validation Rules
- Every part must have a
content_type
- Parts must provide either
content or content_url (not both)
- MessageParts with a
name are Artifacts
- Parts are processed in order
Common Content Types
Any valid MIME type can be used as content. Some common ones are:
text/plain: Plain text content
image/png, image/jpeg: Image content
application/json: JSON data
application/pdf: PDF documents
text/html: HTML content