Worked example: Google A2A
This walkthrough shows how to pass a plan from a Planner agent to a Coder agent via Attach Gateway, using:
Google’s A2A task protocol (
/a2a/tasks/send+/status/{id})Attach Gateway’s
X‑Attach‑*headersWeaviate as the shared memory store
The same pattern applies to any engine (vLLM, llama.cpp, commercial APIs).
0 · What A2A expects
POST /a2a/tasks/send
Submit a task & choose target agent
UI → Gateway
GET /a2a/tasks/status/{task_id}
Poll until state:"done"
UI → Gateway
Attach Gateway forwards both calls to the chosen agent, adds the Attach headers, and records every hop in Weaviate.
1 · Planner → Coder flow (with memory)
sequenceDiagram
participant UI as Browser
participant GW as Attach Gateway
participant PL as Planner Agent
participant CD as Coder Agent
participant WV as Weaviate
UI ->> GW: POST /a2a/tasks/send { messages:[…], target:"planner" }
Note right of UI: Authorization: Bearer JWT
GW ->> PL: same body + X‑Attach‑User / Session
PL ->> WV: MemoryEvent(role=planner, content=plan)
PL -->> GW: { mem_id:123, plan:"…" }
GW ->> CD: POST /a2a/tasks/send { mem_id:123, … }
CD ->> WV: fetch plan 123
CD ->> WV: MemoryEvent(role=coder, content=answer)
CD -->> GW: TaskStatus(state="done", result=answer)
GW -->> UI: state="done"2 · Skeleton agents
Planner – saves a plan, returns mem_id
mem_idCoder – receives mem_id, fetches plan, prepends it
mem_id, fetches plan, prepends it3 · Smoke‑test locally
Ask Planner → JSON contains a
mem_id.Ask Coder → its prompt now includes the plan.
Inspect memory: http://localhost:8080/mem/events?limit=10
4 · cURL only
5 · What Attach handles vs. what you write
JWT verification & /a2a routing
✔︎
–
Memory utils (write_plan, fetch_doc)
✔︎
–
Agent FastAPI skeletons
Examples
Prompts / business logic
Swap in any engine (vLLM, llama.cpp, OpenAI, etc.) and you still get SSO + memory + hand‑off out‑of‑the‑box.
Last updated