Main backend modules
Agent run flow
ADKExecutorV2.execute() is the main runtime interface for chat-driven agent execution.
It performs these steps:
1
Validate attachments
Multimodal inputs are checked before model execution.
2
Guard the prompt
Prompt extraction attempts are blocked before agent creation.
3
Build the agent
AgentFactoryV2 loads the agent, model, tools, planner, and generation config.4
Run the agent
AgentRunner streams events back to the client.5
Persist the run
Messages, token usage, and traces are saved after execution completes.
Agent construction
AgentFactoryV2.create_agent(agent_id) loads an agent record and creates the correct ADK agent type.
The factory also merges the 5-pattern instruction fields into a single instruction:
- Identity.
- Mission.
- Methodology.
- Boundaries.
- Examples.
Tool reference formats
Thetools array on an agent can contain:
Workflow executor
ADKWorkflowExecutor.execute() runs graph workflows and returns JSON: