The event table
CREATE TABLE adk_events (
id bigserial PRIMARY KEY,
session_id uuid NOT NULL,
turn bigint NOT NULL,
event_type text NOT NULL, -- tool_call, tool_result, llm_call, hook_fire
payload jsonb NOT NULL,
created_at timestamptz NOT NULL DEFAULT now()
);
CREATE INDEX ON adk_events (session_id, turn);
CREATE INDEX ON adk_events (event_type, created_at DESC);Advertisement
Why not use messages table
Events are higher volume (5-20 per turn) and read patterns differ — you filter by event_type more than by session. Separate table = separate index strategy.
Advertisement
Payload examples
tool_call: tool name, arguments, correlation ID. llm_call: prompt token count, completion token count, model, cost, latency. hook_fire: hook name, outcome.