Google ADK
axonPushADKCallbacks returns the before/after agent, model, and tool hooks that the Google Agent Development Kit expects.
axonPushADKCallbacks(config) returns an object with the six hooks the Google
Agent Development Kit calls around agents, models, and tools. Wire it into your
agent’s callback configuration and each hook publishes one axonpush event.
Tested against the public Google ADK preview (@google/adk ^0.1). The ADK
hook surface is still moving; this integration tracks the
before/after agent, model, and tool trio, which has been stable
since the developer preview.
Install
npm install @axonpush/sdk @google/adk
Wire up the callbacks
import { AxonPush, axonPushADKCallbacks } from "@axonpush/sdk";
const client = new AxonPush();
const callbacks = axonPushADKCallbacks({
client,
channelId: process.env.AXONPUSH_CHANNEL_ID!,
agentId: "adk-agent",
});
const agent = new Agent({
name: "assistant",
model: "gemini-2.0-flash",
tools: [webSearch, codeExecution],
callbacks,
});
The returned object is a plain bundle of six functions, so if the ADK version you are on names its callback config differently, destructure and attach the hooks individually rather than passing the bundle whole.
agentId defaults to "google-adk".
What gets emitted
| Hook | Identifier | axonpush eventType | Payload |
|---|---|---|---|
beforeAgent(agent) | agent.start | agent.start | agent_name |
afterAgent(agent, output) | agent.end | agent.end | agent_name, truncated output |
beforeModel(model, params) | llm.start | agent.start | model, truncated params |
afterModel(model, response) | llm.end | agent.end | model, truncated response |
beforeTool(tool, input) | tool.{name}.start | agent.tool_call.start | tool_name, truncated input |
afterTool(tool, output) | tool.{name}.end | agent.tool_call.end | tool_name, truncated output |
The model name is read from model.modelId, falling back to model.name, then
"unknown". Agent and tool names fall back to "unknown" the same way, so a
malformed hook argument degrades into a readable event rather than an
exception.
Every truncated field is JSON-serialised and cut at 500 characters, then run
through the client’s redactor, under the default metadata_only capture mode,
params, input, output, and response are replaced before transport. All
events carry metadata.framework: "google-adk" and share one trace for the
life of the callback bundle.