Plug router providing Python ADK-compatible HTTP endpoints.
This module implements the same REST API as Python ADK's adk web FastAPI server,
enabling the adk-web React frontend to work with an Elixir backend as a drop-in
replacement.
Endpoints
GET /list-apps— List available agent appsGET /apps/:app_name/users/:user_id/sessions— List sessionsPOST /apps/:app_name/users/:user_id/sessions— Create sessionGET /apps/:app_name/users/:user_id/sessions/:session_id— Get sessionDELETE /apps/:app_name/users/:user_id/sessions/:session_id— Delete sessionPOST /run_sse— Run agent with SSE streaming responsePOST /run— Run agent synchronouslyGET /health— Health checkGET /version— Version infoGET /debug/trace/:event_id— Get span attributes for a specific eventGET /debug/trace/session/:session_id— Get all spans for a session
Usage
Add to your Phoenix router or use standalone:
# In a Phoenix router
forward "/", ADK.Phoenix.WebRouter,
agent_loader: MyApp.AgentLoader,
session_store: {ADK.Session.Store.InMemory, []}
# Standalone with Bandit/Cowboy
Bandit.start_link(plug: {ADK.Phoenix.WebRouter, opts})Options
:agent_loader— Module implementinglist_agents/0andload_agent/1callbacks, or a map of%{app_name => agent}for simple cases.:session_store—{module, opts}tuple for session persistence. Defaults to{ADK.Session.Store.InMemory, []}.:allow_origins— List of allowed CORS origins. Defaults to["*"].
Summary
Functions
Callback implementation for Plug.call/2.
Initialize the router with options.
Options
:agent_loader— Map of%{app_name => agent}or module withlist_agents/0andload_agent/1:session_store—{module, opts}tuple:allow_origins— CORS origins list