Skip to main content
Parts are the fundamental building blocks for agent communication in A2A. Here’s how they work in practice:

TextPart: Simple Text Communication

Schema:
Use Case 1: User Instruction
Use Case 2: Agent Status with Metadata
What it’s for: Human-readable communication including instructions, status updates, error messages, and conversational text between agents and users.

FilePart: Binary Content Exchange

Schema:
Use Case 1: Image Upload with Bytes (Client → Agent)
What it’s for: Binary content exchange including images, documents, media files, and data files. Use bytes for small files (< 1MB), uri for large files to avoid payload bloat.

DataPart: Structured Information Exchange

Schema:
Use Case 1: Form Data Submission
What it’s for: Structured, machine-readable information including API responses, form data, query results, analytics, payment details, and any JSON-serializable data that needs programmatic processing.

Key Takeaways: A2A Part Usage

Part Types (A2A Standard):
  1. TextPart (kind: "text"): For conveying plain textual content
    • Use for: Instructions, descriptions, status updates, conversational text
  2. FilePart (kind: "file"): For conveying file-based content
    • FileWithBytes: Small files provided as base64-encoded bytes
    • FileWithUri: Large files referenced by URI
    • Optional: name and mimeType fields
  3. DataPart (kind: "data"): For conveying structured JSON data
    • Use for: Forms, parameters, machine-readable information
    • Data is a JSON object (dict[str, Any])
Common Features:
  • All parts support optional metadata field for additional context
  • Parts can be used in both Messages and Artifacts
  • Multiple parts can be combined in a single message
Bindu Extensions <NotPartOfA2A>:
  • embeddings: list[float] - Vector embeddings for semantic search and similarity
Best Practices:
  • Use bytes for small files, uri for large files to avoid payload bloat
  • Always specify mimeType for files to help agents process content correctly
  • Use metadata for 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:
Message Roles:
  1. user: Messages from humans or client applications
    • Task instructions and requests
    • Follow-up questions
    • Input responses
  2. agent: Messages from AI agents
    • Status updates (“Processing your request…”)
    • Thought processes and reasoning
    • Coordination between agents
    • Progress notifications
  3. system: Protocol-level messages <NotPartOfA2A>
    • Error notifications
    • Authentication warnings
    • Protocol-level events
Use Case 1: User Instruction with Context
What it’s for: Real-time communication during task execution including instructions, status updates, questions, coordination, and context sharing. Messages enable interactive, multi-turn conversations between users and agents.

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:
Key Differences from Messages:
  • Messages = Operational communication during work (ephemeral)
  • Artifacts = Final deliverable results after work (persistent)
Use Case 1: Analysis Report Artifact
What it’s for: Persistent, immutable deliverables that represent the completed work of an agent. Artifacts are the tangible outputs that users receive after task completion - reports, generated code, processed files, analysis results, or any final product of agent execution.

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 history array
Tasks:
  • Central coordination unit tracking work lifecycle
  • Created by server in response to user messages
  • Contain status, history, and artifacts
  • State transitions: submittedworkingcompleted
Artifacts:
  • 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
Example: Simple Question