a2a-samples/samples/python/agents at main · a2aproject/a2a-samples

Sample Agents

All the agents in this directory are samples built on different frameworks highlighting different capabilities. Each agent runs as a standalone A2A server.

Each agent can be run as its own A2A server with the instructions on its README. By default, each will run on a separate port on localhost (you can use command line arguments to override).

Agents Directory

  • Google ADK Facts
    Sample agent to give fun facts using Grounding with Google Search and ADK

  • Google ADK Expense Reimbursement
    Sample agent to (mock) fill out expense reports. Showcases multi-turn interactions and returning/replying to webforms through A2A.

  • AG2 MCP Agent with A2A Protocol
    Demonstrates an MCP-enabled agent built with AG2 that is exposed through the A2A protocol.

  • Azure AI Foundry Agent Service
    Sample agent build with Azure AI Foundry Agent Service

  • LangGraph
    Sample agent which can convert currency using tools. Showcases multi-turn interactions, tool usage, and streaming updates.

  • CrewAI
    Sample agent which can generate images. Showcases use of CrewAI and sending images through A2A.

  • LlamaIndex
    Sample agent which can parse a file and then chat with the user using the parsed content as context. Showcases multi-turn interactions, file upload and parsing, and streaming updates.

  • Marvin Contact Extractor Agent
    Demonstrates an agent using the Marvin framework to extract structured contact information from text, integrated with the Agent2Agent (A2A) protocol.

  • Enterprise Data Agent
    Sample agent which can answer questions from any database, datawarehouse, app. - Powered by Gemini 2.5 flash + MindsDB.

  • Semantic Kernel Agent
    Demonstrates how to implement a travel agent built on Semantic Kernel and exposed through the A2A protocol.

  • travel planner Agent
    A travel assistant demo implemented based on Google's official a2a-python SDK, And Implemented through the A2A protocol.

  • Any-Agent Adversarial Multi-Agent
    Demonstrates an adversarial multi-agent system with competing attacker and defender agents using the A2A protocol and any-agent library.

  • Content Planner Agent
    Sample agent that creates a detailed content outline given a high-level description of the content that's needed by using Google Search and the Google ADK.

Other ADK Samples

The following samples showing ADK/A2A integration are available in the adk-python repository.

  • Basic A2A Multi-Agent System Multi-Agent System communicating with A2A. The sample implements an agent that can roll dice and check if numbers are prime.

  • A2A OAuth Authentication Agent This sample demonstrates the Agent-to-Agent (A2A) architecture with OAuth Authentication workflows in Agent Development Kit (ADK)

  • A2A Human-in-the-Loop Sample Agent This sample demonstrates the Agent-to-Agent (A2A) architecture with Human-in-the-Loop workflows in Agent Development Kit (ADK).

Disclaimer

Important: The sample code provided is for demonstration purposes and illustrates the mechanics of the Agent-to-Agent (A2A) protocol. When building production applications, it is critical to treat any agent operating outside of your direct control as a potentially untrusted entity.

All data received from an external agent—including but not limited to its AgentCard, messages, artifacts, and task statuses—should be handled as untrusted input. For example, a malicious agent could provide an AgentCard containing crafted data in its fields (e.g., description, name, skills.description). If this data is used without sanitization to construct prompts for a Large Language Model (LLM), it could expose your application to prompt injection attacks. Failure to properly validate and sanitize this data before use can introduce security vulnerabilities into your application.

Developers are responsible for implementing appropriate security measures, such as input validation and secure handling of credentials to protect their systems and users.