You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/a2a/index.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
With Agent Development Kit (ADK), you can build complex multi-agent systems where different agents need to collaborate and interact using [Agent2Agent (A2A) Protocol](https://a2a-protocol.org/)! This section provides a comprehensive guide to building powerful multi-agent systems where agents can communicate and collaborate securely and efficiently.
4
4
5
-
Navigate through the guides below to learn about ADK's A2A capabilities:
5
+
Navigate through the guides below to learn about ADK\'s A2A capabilities:
6
6
7
7
**[Introduction to A2A](./intro.md)**
8
8
@@ -16,6 +16,10 @@ Navigate through the guides below to learn about ADK's A2A capabilities:
16
16
17
17
This quickstart covers: **"There is a remote agent, how do I let my ADK agent use it via A2A?"**.
18
18
19
+
**[A2A Logging](./logging.md)**
20
+
21
+
Learn how to enable and interpret the detailed and structured logs for A2A communication, which is invaluable for debugging and monitoring multi-agent systems.
22
+
19
23
[**Official Website for Agent2Agent (A2A) Protocol**](https://a2a-protocol.org/)
The ADK provides detailed and structured logging for A2A (Agent-to-Agent) communication, which is invaluable for debugging and monitoring multi-agent systems. When you enable debug-level logging, the ADK will output rich information about A2A requests and responses.
4
+
5
+
## Enabling A2A Logging
6
+
7
+
To enable A2A logging, you can set the log level to `debug` when running your ADK server. For example:
-**Message**: Core details of the message, including its ID, role, task ID, and context ID.
38
+
-**Message Parts**: The content of each part of the message. For text parts, a snippet of the text is shown. For data parts, a summary of the data keys is provided.
39
+
40
+
### A2A Response Logs
41
+
42
+
When an agent receives a response from another agent, a log entry is generated that can represent either a `Task` or a `Message`:
-**Result Type**: The type of the result, which can be a `ClientEvent` (containing a `Task`) or a `Message`.
63
+
-**Result Details**: Detailed information about the result, such as task status, message content, and metadata.
64
+
-**Status Message**: If the response is a task update, this section contains the status message from the remote agent.
65
+
-**History**: The conversation history associated with the task.
66
+
67
+
By inspecting these logs, you can trace the flow of communication between your agents, understand the content of the messages being exchanged, and diagnose any issues that may arise.
As you'll see, the folder structure is as follows:
44
+
As you\'ll see, the folder structure is as follows:
45
45
46
46
```text
47
47
a2a_basic/
@@ -70,7 +70,7 @@ a2a_basic/
70
70
71
71
### 2. Start the Remote Prime Agent server { #start-the-remote-prime-agent-server }
72
72
73
-
To show how your ADK agent can consume a remote agent via A2A, you'll first need to start a remote agent server, which will host the prime agent (under `check_prime_agent`).
73
+
To show how your ADK agent can consume a remote agent via A2A, you\'ll first need to start a remote agent server, which will host the prime agent (under `check_prime_agent`).
74
74
75
75
```bash
76
76
# Start the remote a2a server that serves the check_prime_agent on port 8001
This will give richer logs for you to inspect when testing your agents.
85
+
This will give richer logs for you to inspect when testing your agents. To learn more about A2A logging, see the [A2A Logging](./logging.md) guide.
86
86
87
87
??? note "Why use port 8001?"
88
-
In this quickstart, when testing locally, your agents will be using localhost, so the `port` for the A2A server for the exposed agent (the remote, prime agent) must be different from the consuming agent's port. The default port for `adk web` where you will interact with the consuming agent is `8000`, which is why the A2A server is created using a separate port, `8001`.
88
+
In this quickstart, when testing locally, your agents will be using localhost, so the `port` for the A2A server for the exposed agent (the remote, prime agent) must be different from the consuming agent\'s port. The default port for `adk web` where you will interact with the consuming agent is `8000`, which is why the A2A server is created using a separate port, `8001`.
89
89
90
90
Once executed, you should see something like:
91
91
@@ -127,7 +127,7 @@ In the sample, the `check_prime_agent` already has an agent card provided:
127
127
128
128
??? note "More info on agent cards in ADK"
129
129
130
-
In ADK, you can use a `to_a2a(root_agent)` wrapper which automatically generates an agent card for you. If you're interested in learning more about how to expose your existing agent so others can use it, then please look at the [A2A Quickstart (Exposing)](quickstart-exposing.md) tutorial.
130
+
In ADK, you can use a `to_a2a(root_agent)` wrapper which automatically generates an agent card for you. If you\'re interested in learning more about how to expose your existing agent so others can use it, then please look at the [A2A Quickstart (Exposing)](quickstart-exposing.md) tutorial.
131
131
132
132
### 4. Run the Main (Consuming) Agent { #run-the-main-consuming-agent }
133
133
@@ -217,13 +217,13 @@ Bot: Yes, 7 is a prime number.
217
217
This interaction uses both the local Roll Agent and the remote Prime Agent:
218
218
219
219
```text
220
-
User: Roll a 10-sided die and check if it's prime
220
+
User: Roll a 10-sided die and check if it\'s prime
221
221
Bot: I rolled an 8 for you.
222
222
Bot: 8 is not a prime number.
223
223
```
224
224
225
225
## Next Steps
226
226
227
-
Now that you have created an agent that's using a remote agent via an A2A server, the next step is to learn how to connect to it from another agent.
227
+
Now that you have created an agent that\'s using a remote agent via an A2A server, the next step is to learn how to connect to it from another agent.
228
228
229
-
-[**A2A Quickstart (Exposing)**](./quickstart-exposing.md): Learn how to expose your existing agent so that other agents can use it via the A2A Protocol.
229
+
-[**A2A Quickstart (Exposing)**](./quickstart-exposing.md): Learn how to expose your existing agent so that other agents can use it via the A2A Protocol.
0 commit comments