> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-service-account.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Basic A2A Messaging with A2AClient

> Simple message sending with user identification using the A2A protocol.

```python basic_messaging.py theme={null}
"""
Basic A2A Messaging with A2AClient

This example demonstrates simple message sending with user identification
using the A2A protocol.

Prerequisites:
1. Start an AgentOS server with A2A interface:
   python cookbook/05_agent_os/client_a2a/servers/agno_server.py

2. Run this script:
   python cookbook/05_agent_os/client_a2a/01_basic_messaging.py
"""

import asyncio

from agno.client.a2a import A2AClient

# ---------------------------------------------------------------------------
# Create Example
# ---------------------------------------------------------------------------


async def main():
    """Send message with user identification."""
    print("=" * 60)
    print("A2A Messaging with User ID")
    print("=" * 60)

    client = A2AClient("http://localhost:7003/a2a/agents/basic-agent")
    result = await client.send_message(
        message="Remember my name is Alice.",
        user_id="alice-123",
    )

    print(f"\nTask ID: {result.task_id}")
    print(f"Context ID: {result.context_id}")
    print(f"Status: {result.status}")
    print(f"\nResponse: {result.content}")

    if result.is_completed:
        print("\nTask completed successfully!")
    elif result.is_failed:
        print("\nTask failed!")


# ---------------------------------------------------------------------------
# Run Example
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    asyncio.run(main())
```

## Run the Example

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno
    ```
  </Step>

  <Step title="Run the example">
    Save the code above as `basic_messaging.py`, then run:

    ```bash theme={null}
    python basic_messaging.py
    ```
  </Step>
</Steps>

Full source: [cookbook/05\_agent\_os/client\_a2a/01\_basic\_messaging.py](https://github.com/agno-agi/agno/blob/main/cookbook/05_agent_os/client_a2a/01_basic_messaging.py)
