apps/agentkit_server_app. The server combines Simple API, A2A, ADK REST, and optional WebUI routes. Use it for local integration, AgentKit Runtime deployment, or embedding an agent service in a Go application.
Prerequisites
- Use the
github.com/volcengine/veadk-gomodule. - Configure model credentials, such as the API key required by Ark or an OpenAI-compatible model.
- Make sure external tool, knowledge-base, memory, and observability services are reachable from the deployment environment.
- If you need an A2A Agent Card, decide the externally reachable
PublicURLor trusted reverse-proxy strategy.
Minimal Service
The following example creates an agent and starts AgentKit Server App on local port8000.
ApiConfig exposes Simple API, A2A, ADK REST, and WebUI routes. SetHost("127.0.0.1") listens only on localhost. In containers, use the default empty host or the listen address required by the platform.
Invoke and Verify
When Simple API is enabled, call/invoke to verify one agent turn:
/health:
ApiPathPrefix is configured, ADK REST routes are mounted under that prefix:
Configure RunConfig
apps.RunConfig passes the agent, sessions, memory, artifacts, plugins, and telemetry into the app server.
Production deployments should replace in-memory sessions with persistent storage when conversations must survive restarts.
Configure the HTTP Server
apps.ApiConfig controls listen address, paths, timeouts, CORS, request-body size, and the public A2A URL.
Configure the A2A Public Address
Agent Cards need to advertise a reachable A2A address. By default, the server does not trustHost, Forwarded, or X-Forwarded-* request headers, so production deployments should set PublicURL explicitly.
ForwardedAgentCardURL only behind a trusted reverse proxy that overwrites client-supplied forwarding headers:
Extend Routes and Middleware
AgentkitServerApp can add custom routes after built-in exact routes and before ADK REST/WebUI fallback routes. Middleware runs in declaration order.
Add Observability
apps.Run appends observability.NewPlugin() and observability.ADKTelemetryOptions() by default, then performs bounded shutdown after SIGTERM. The deployment environment only needs exporter configuration: