> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fundamental Communication Elements

> Defines core elements and flow for agent-to-agent communication including agent cards, messages and parts, tasks with streaming, artifacts as deliverables, discovery, transport, and authentication

Below is a clearer, more structured explanation of the core elements used in A2A (agent-to-agent) communication. The sequence follows discovery → messaging → long-running work → deliverables so you can map each technical diagram to the corresponding definitions and examples.

Agent Card
An Agent Card is essentially a "business card" for an AI agent. It tells other agents:

* Who the agent is (name, description, provider)
* Where to reach it (URL / endpoint)
* What it can do (capabilities and skills)
* How to authenticate (security requirements)

Capabilities can include features like streaming, push notifications, or state transition history. Skills are detailed entries that list name, id, description, tags, examples, and supported input/output modes — effectively the agent's advertised abilities.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/73ATcw8OTjZq5HIJ/images/KAgent-Host-Your-AI-Agents-on-Kubernetes/KAgent-Installation-Architecture-Overview/Fundamental-Communication-Elements/agent-card-who-where-what-authentication.jpg?fit=max&auto=format&n=73ATcw8OTjZq5HIJ&q=85&s=01b087210e129e2c0641dad509dbc25d" alt="A slide titled &#x22;Fundamental Communication Elements&#x22; showing an &#x22;Agent Card&#x22; described as &#x22;like a business card for an AI agent.&#x22; Below it are four colored boxes listing: Who the agent is (name/description/provider), Where to find it (URL/endpoint), What it can do (skills/capabilities), and How to authenticate (security requirements)." width="1920" height="1080" data-path="images/KAgent-Host-Your-AI-Agents-on-Kubernetes/KAgent-Installation-Architecture-Overview/Fundamental-Communication-Elements/agent-card-who-where-what-authentication.jpg" />
</Frame>

Example Agent Card (Kubernetes-focused agent):

```json theme={null}
{
  "name": "k8s_a2a_agent",
  "description": "An example A2A agent that knows how to use Kubernetes tools.",
  "url": "http://127.0.0.1:8083/api/a2a/kagent/k8s-a2a-agent/",
  "capabilities": {
    "streaming": true,
    "pushNotifications": false,
    "stateTransitionHistory": true
  },
  "skills": [
    {
      "id": "get-resources-skill",
      "name": "Get Resources",
      "description": "Get resources in the Kubernetes cluster",
      "tags": ["k8s", "resources"],
      "examples": [
        "Get all resources in the Kubernetes cluster",
        "Get the pods in the default namespace"
      ],
      "inputModes": ["text"],
      "outputModes": ["text"]
    }
  ]
}
```

<Callout icon="lightbulb" color="#1CB2FE">
  Agent discovery returns the Agent Card so other agents know how to connect, which capabilities are available, and what authentication is required. Exposing accurate capabilities and skill metadata improves automated routing and orchestration in multi-agent systems.
</Callout>

Messages and Parts
Messages are the basic units that agents exchange. Each message typically includes metadata (sender, unique ID) and a list of parts. A part contains the actual content and can be one of:

* text (plain user or system text)
* file (binary content encoded as Base64 with a MIME type)
* structured data (JSON payloads)

Example message parts:

```json theme={null}
{
  "type": "text",
  "text": "Get the pods in default namespace"
}
```

```json theme={null}
{
  "type": "file",
  "mimeType": "application/json",
  "data": "base64-encoded-content"
}
```

```json theme={null}
{
  "type": "data",
  "data": {
    "namespace": "default",
    "resourceType": "pods"
  }
}
```

Artifacts
Artifacts are the tangible outputs produced by agents. Unlike messages (which are transient communication), artifacts are deliverables: reports, structured results, files, images, or any persistent output. Artifacts have unique IDs, names, and parts (using the same parts schema as messages).

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/73ATcw8OTjZq5HIJ/images/KAgent-Host-Your-AI-Agents-on-Kubernetes/KAgent-Installation-Architecture-Overview/Fundamental-Communication-Elements/fundamental-communication-artifact-deliverable.jpg?fit=max&auto=format&n=73ATcw8OTjZq5HIJ&q=85&s=665fa8dbd6c93eeb1b18a630d978ed0f" alt="A presentation slide titled &#x22;Fundamental Communication Elements&#x22; highlighting element 03 labeled &#x22;Artifact.&#x22; It defines an artifact as &#x22;actual results or deliverables from an agent&#x22; and includes a blue note that it's a real output, not just a message." width="1920" height="1080" data-path="images/KAgent-Host-Your-AI-Agents-on-Kubernetes/KAgent-Installation-Architecture-Overview/Fundamental-Communication-Elements/fundamental-communication-artifact-deliverable.jpg" />
</Frame>

Example artifact (pod listing):

```json theme={null}
{
  "taskId": "task-001",
  "status": { "state": "completed" },
  "artifacts": [
    {
      "artifactId": "artifact-001",
      "name": "Pod List",
      "parts": [
        {
          "type": "text",
          "text": "Found 3 pods:\n- pod-1\n- pod-2\n- pod-3"
        }
      ]
    }
  ]
}
```

Common artifact types and examples:

| Artifact Type     | Typical Use Case                             | Example                                           |
| ----------------- | -------------------------------------------- | ------------------------------------------------- |
| Text artifact     | Human-readable reports                       | `Finished analysis: 12 issues found`              |
| Data artifact     | Structured output for machine consumption    | `{"reservationId":"abc123","status":"confirmed"}` |
| File artifact     | Images, documents, or binary outputs         | Base64-encoded image bytes                        |
| Mixed (Text/Data) | Aggregated outputs (e.g., list of resources) | `["pod-1","pod-2","pod-3"]`                       |

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/73ATcw8OTjZq5HIJ/images/KAgent-Host-Your-AI-Agents-on-Kubernetes/KAgent-Installation-Architecture-Overview/Fundamental-Communication-Elements/real-world-artifact-cards.jpg?fit=max&auto=format&n=73ATcw8OTjZq5HIJ&q=85&s=dd650f522c519aa0e061d589a8cfe19c" alt="A presentation slide titled &#x22;Real-World Examples&#x22; showing four rounded cards labeled Text Artifact, Data Artifact, File Artifact, and Text/Data Artifact. Each card lists an example: a completed report, a booking confirmation, a generated image, and a list of Kubernetes resources." width="1920" height="1080" data-path="images/KAgent-Host-Your-AI-Agents-on-Kubernetes/KAgent-Installation-Architecture-Overview/Fundamental-Communication-Elements/real-world-artifact-cards.jpg" />
</Frame>

Artifacts can also be streamed incrementally as they are produced (useful for large or long-running tasks).

Tasks
Tasks model long-running or multi-step work that originates from a message. Tasks have well-defined lifecycles (submitted → working → completed/failed/canceled). While a task executes, it may stream status updates and partial artifacts before delivering final artifacts.

Example task lifecycle with streaming partial results then final results:

```json theme={null}
// Initial task submission
{
  "taskId": "task-789",
  "status": { "state": "submitted" }
}

// Update while working (streaming partial artifact)
{
  "taskId": "task-789",
  "status": { "state": "working", "message": "Processing your request..." },
  "artifacts": [
    {
      "artifactId": "artifact-1",
      "name": "Partial Results",
      "parts": [{"type": "text", "text": "Found 2 pods so far..."}]
    }
  ]
}

// Final result
{
  "taskId": "task-789",
  "status": { "state": "completed" },
  "artifacts": [
    {
      "artifactId": "artifact-2",
      "name": "Final Results",
      "parts": [{"type": "text", "text": "Found 3 pods total"}]
    }
  ]
}
```

End-to-end Example
This short flow demonstrates discovery → message → task updates → artifact results.

```http theme={null}
# Step 1: Discover Agent Card (Agent discovery endpoint)
GET http://127.0.0.1:8083/api/a2a/kagent/k8s-a2a-agent/.well-known/agent-card
# Server → Returns the Agent Card JSON shown earlier
```

```json theme={null}
# Step 2: Send Message
{
  "messageId": "msg-001",
  "role": "user",
  "parts": [
    {
      "type": "text",
      "text": "Get all pods in the default namespace"
    }
  ]
}
```

```json theme={null}
# Step 3: Agent responds with a Task update (working)
{
  "taskId": "task-001",
  "status": {
    "state": "working",
    "message": "Querying Kubernetes cluster..."
  }
}
```

```json theme={null}
# Step 4: Agent sends final Artifact (result)
{
  "taskId": "task-001",
  "status": { "state": "completed" },
  "artifacts": [
    {
      "artifactId": "artifact-001",
      "name": "Pod List",
      "parts": [
        {
          "type": "text",
          "text": "Found 3 pods:\n- pod-1\n- pod-2\n- pod-3"
        }
      ]
    }
  ]
}
```

Summary

* Agent discovery returns an Agent Card.
* Clients send Messages composed of Parts (text, files, structured data).
* Agents create Tasks for long-running work, stream status and partial Artifacts while working, and return final Artifacts when done.

Other important concepts

* Context: Groups related messages and tasks into sessions or conversations for consistent state.
* Transport: Use secure channels such as HTTPS. See: [HTTPS](https://developer.mozilla.org/en-US/docs/Glossary/HTTPS)
* Format: Standardize on formats like JSON and JSON-RPC 2.0. See: [JSON](https://www.json.org/json-en.html) and [JSON-RPC 2.0](https://www.jsonrpc.org/specification)
* Authentication: Prefer robust schemes such as OAuth 2.0 or API keys. See: [OAuth 2.0](https://oauth.net/2/)
* Agent discovery & extensions: Protocol-level mechanisms for how agents locate each other and how optional extensions are negotiated

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/73ATcw8OTjZq5HIJ/images/KAgent-Host-Your-AI-Agents-on-Kubernetes/KAgent-Installation-Architecture-Overview/Fundamental-Communication-Elements/other-important-concepts-slide-teal-boxes.jpg?fit=max&auto=format&n=73ATcw8OTjZq5HIJ&q=85&s=3d7c97ee5a9048370a32d6d9e445b649" alt="A dark-themed presentation slide titled &#x22;Other Important Concepts&#x22; listing items like Context, Format, Agent Discovery on the left and Transport and Authentication on the right. The items are shown as horizontal rounded boxes with teal accent bars." width="1920" height="1080" data-path="images/KAgent-Host-Your-AI-Agents-on-Kubernetes/KAgent-Installation-Architecture-Overview/Fundamental-Communication-Elements/other-important-concepts-slide-teal-boxes.jpg" />
</Frame>

<Callout icon="warning" color="#FF6B6B">
  Security reminder: always authenticate and encrypt agent endpoints. Exposing discovery endpoints without proper authentication or TLS can leak capabilities and create attack surfaces.
</Callout>

References

* Kubernetes Basics: [https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/](https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/)
* JSON: [https://www.json.org/json-en.html](https://www.json.org/json-en.html)
* JSON-RPC 2.0: [https://www.jsonrpc.org/specification](https://www.jsonrpc.org/specification)
* OAuth 2.0: [https://oauth.net/2/](https://oauth.net/2/)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/kagents-host-your-ai-agents-on-kubernetes/module/45e1f0ac-8ec5-4cb3-8804-9953a96a67b5/lesson/0bf2ea88-d093-4254-94ba-f063c806baec" />
</CardGroup>
