TextPart: Simple Text Communication
Schema:FilePart: Binary Content Exchange
Schema:bytes for small files (< 1MB), uri for large files to avoid payload bloat.
DataPart: Structured Information Exchange
Schema:Key Takeaways: A2A Part Usage
Part Types (A2A Standard):-
TextPart (
kind: "text"): For conveying plain textual content- Use for: Instructions, descriptions, status updates, conversational text
-
FilePart (
kind: "file"): For conveying file-based content- FileWithBytes: Small files provided as base64-encoded bytes
- FileWithUri: Large files referenced by URI
- Optional:
nameandmimeTypefields
-
DataPart (
kind: "data"): For conveying structured JSON data- Use for: Forms, parameters, machine-readable information
- Data is a JSON object (
dict[str, Any])
- All parts support optional
metadatafield for additional context - Parts can be used in both Messages and Artifacts
- Multiple parts can be combined in a single message
<NotPartOfA2A>:
embeddings: list[float]- Vector embeddings for semantic search and similarity
- Use
bytesfor small files,urifor large files to avoid payload bloat - Always specify
mimeTypefor files to help agents process content correctly - Use
metadatafor additional context (timestamps, confidence scores, error codes) - Structure DataPart content with clear, consistent schemas
Communication Types
Message: Operational Communication
Messages are the primary way agents, users, and systems communicate during task execution. Unlike artifacts (which contain final results), messages carry operational content like instructions, status updates, and coordination. Schema:-
user: Messages from humans or client applications
- Task instructions and requests
- Follow-up questions
- Input responses
-
agent: Messages from AI agents
- Status updates (“Processing your request…”)
- Thought processes and reasoning
- Coordination between agents
- Progress notifications
-
system: Protocol-level messages
<NotPartOfA2A>- Error notifications
- Authentication warnings
- Protocol-level events
Artifact: Task Results
Artifacts are the final, immutable outputs produced by agents after completing work. Once created, they cannot be modified. Ensuring a permanent, trustworthy record of agent execution. They represent tangible deliverables like reports, generated code, processed files, or analysis results. Unlike messages (which are ephemeral communication), artifacts are the persistent, unchangeable products of agent work that can be reliably referenced, shared, and audited. Schema:- Messages = Operational communication during work (ephemeral)
- Artifacts = Final deliverable results after work (persistent)
Communication Flow Pattern
Understanding the relationship between Messages, Tasks, and Artifacts: Basic Task Execution Flow: Streaming Task Execution Flow: Multi-Turn Interaction Flow: Key Concepts: Messages:- Carry instructions, context, and communication
- User messages initiate or continue tasks
- Agent messages provide status or request input
- Messages are part of the task’s
historyarray
- Central coordination unit tracking work lifecycle
- Created by server in response to user messages
- Contain status, history, and artifacts
- State transitions:
submitted→working→completed
- Final, immutable outputs attached to completed tasks
- Delivered as part of the task result
- Can be streamed in chunks for large outputs
- Multiple artifacts possible per task