Project 12: A2A Interoperability Bridge

Build a planner that delegates to remote agents using A2A cards/tasks and merges results into one coherent output.


Quick Reference

Attribute Value
Difficulty Level 4: Expert
Time Estimate 14-24 hours
Language Python (alt: TypeScript, Go)
Prerequisites Projects 2, 5, 8, 11
Key Topics A2A tasks, delegation semantics, distributed fault handling

Learning Objectives

  1. Discover remote agents through agent cards.
  2. Delegate work as explicit task artifacts.
  3. Handle async progress, blocking, and failures.
  4. Merge heterogeneous outputs into one final decision.

The Core Question You’re Answering

“How do autonomous agents collaborate across runtime boundaries without shared memory?”


Concepts You Must Understand First

Concept Why It Matters Where to Learn
Agent cards Capability discovery and trust metadata A2A docs
Task lifecycle Reliable delegation state machine A2A protocol docs
Idempotency Safe retries in distributed delegation Distributed systems fundamentals

Theoretical Foundation

Planner Agent -> Discover Cards -> Delegate Tasks -> Gather Artifacts -> Reconcile

Delegation must be explicit and replayable. Hidden prompt-side delegation is untestable.


Project Specification

What You’ll Build

A bridge service that:

  • Calls 2+ remote A2A agents
  • Tracks task status and deadlines
  • Supports partial completion
  • Produces delegation trace artifacts

Functional Requirements

  1. Agent discovery from card endpoint
  2. Task creation with unique IDs and idempotency keys
  3. Status polling or callback handling
  4. Result normalization and merge policy

Non-Functional Requirements

  • Deterministic merge rules
  • Bounded retry behavior
  • Explicit degraded-mode outputs

Real World Outcome

$ python p12_a2a_bridge.py --goal "prepare launch risk report"
[a2a] discovered agents=4
[delegate] legal_review, infra_readiness, support_capacity
[progress] 1 blocked for approval
[merge] completed 3/3 with confidence map
[artifact] launch_risk_report.md + delegation_trace.json

Architecture Overview

Planner -> A2A Bridge -> Remote Agent A/B/C
   ^          |             |
   |          └-> Task Store <-
   └-------------- Merge Engine

Implementation Guide

Phase 1: Discovery + Single Delegation

  • One remote task with explicit lifecycle.

Phase 2: Multi-agent Coordination

  • Parallel delegation and timeout handling.

Phase 3: Merge + Recovery

  • Partial success semantics and reconciliation report.

Testing Strategy

  • Unit: lifecycle transitions
  • Integration: mixed success/failure outcomes
  • Chaos: delayed responses and duplicate callbacks

Common Pitfalls & Debugging

Pitfall Symptom Fix
Duplicate task execution repeated side effects enforce idempotency keys
Infinite waiting task never resolves deadline + fallback policy
Schema mismatch merge errors normalize into internal artifact schema

Interview Questions They’ll Ask

  1. What does A2A add over ordinary API calls?
  2. How do you prevent cascading retries?
  3. How do you merge contradictory agent outputs?
  4. How do you audit delegated decisions?

Hints in Layers

  • Hint 1: One planner + one worker first.
  • Hint 2: Persist all lifecycle transitions.
  • Hint 3: Separate transport errors from task failures.
  • Hint 4: Add partial-success report mode.

Submission / Completion Criteria

Minimum Completion

  • Planner successfully delegates and receives one remote artifact

Full Completion

  • Multi-agent delegation with timeouts and merge policy

Excellence

  • Human approval integration and replay debugger