liveBook · Manning

Llmagenta2aexecutor

As explained in Build a Multi-Agent System (from Scratch)

LLMAgentA2AExecutor is the book framework's A2A executor class that wraps an LLMAgent for remote task execution.

LLMAgentA2AExecutor wraps an LLMAgent as a remote A2A agent. It implements the A2A AgentExecutor role, delegating incoming task execution to the wrapped agent while using A2A utilities to update task state. section 10.3.1

Its execution flow handles each incoming task through these steps:

  • Use the current A2A task from RequestContext, or create one from the user message and submit it through the event queue. section 10.3.1
  • Publish task-submitted and task-started status updates through TaskUpdater, then delegate execution to the wrapped LLMAgent. section 10.3.1
  • On success, attach an Artifact to the task; on failure, return an error Message. Update the task status in either case. section 10.3.1

The executor keeps active TaskHandler objects in _task_handlers so it can track concurrent tasks and cancel a specific task when requested by a client. This integration does not support server-side streaming, input-required workflows, or sharing prior task context through context_id. section 10.3.1 section 10.4.2

Figure 10.12 The sequence of interactions between an A2A server and an A2A AgentExecutor with a TaskUpdater for performing tasks

Follow the server, executor, and TaskUpdater interactions across task submission, execution, and completion. section 10.3.1

How Build a Multi-Agent System (from Scratch) covers it

How deep it goes
Implements construction and task lifecycle handling, including status updates and success or failure; defers streaming and context sharing.
Examples
Traces a client task through submission, start updates, agent execution, and artifact-or-error completion.
What it assumes
Assumes an LLMAgent and A2A request, event-queue, and task-updater types; delegates protocol plumbing to a2a-sdk.
What you can do after
Build it from scratch by wrapping an LLMAgent in an AgentExecutor and updating A2A task status through TaskUpdater.
How it connects
Connects LLMAgent to the A2A AgentExecutor, RequestContext, TaskUpdater, and TaskHandler interfaces.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Multi-Agent System (from Scratch). The section links point to the parts of the book it draws on.