Skip to main content
VeADK Go can wrap an agent as an HTTP service through 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.
Before exposing the service publicly or deploying it to a cloud runtime, provide model, tool, knowledge-base, memory, observability, and AgentKit credentials through environment variables or secrets. Do not bake API keys, AK/SK, tokens, or private endpoints into images or repositories.

Prerequisites

  • Use the github.com/volcengine/veadk-go/v2 module.
  • 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 PublicURL or trusted reverse-proxy strategy.

Minimal Service

The following example creates an agent and starts AgentKit Server App on local port 8000.
After startup, the default 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:
The health endpoint is /health:
If 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.
If browser clients can call the service cross-origin, do not allow every origin by default. When credentials are involved, pin trusted origins explicitly.

Configure the A2A Public Address

Agent Cards need to advertise a reachable A2A address. By default, the server does not trust Host, Forwarded, or X-Forwarded-* request headers, so production deployments should set PublicURL explicitly.
Use 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:
If you manage the OpenTelemetry provider yourself, set:

Production Notes

Last modified on October 20, 2026