Skip to main content
com.volcengine.veadk.Runner is the convenient execution entry point for VeADK Java. It wraps ADK Java Runner, exposes direct run(...) calls, and connects short-term sessions and long-term memory.

Minimal Call

After creating an agent with Agent.builder(), pass it to Runner. run(String) uses the default user default_user, creates a fresh session, and returns the final text response.
Runner extracts text from ADK events. It prefers final response text; if there is no final response, it returns the last non-empty model text. If no text is available, it raises a clear error.

Multi-Turn Sessions

Pass a stable userId and sessionId when you need conversation context. Reusing the same IDs keeps the same short-term session history.
When no short-term session is configured, Runner uses local in-memory sessions. For production persistence, configure short-term memory through Agent.builder().shortTermMemory(...) or new Runner(agent, appName, shortTermMemory).

Session resolution

The default RunConfig used by Runner is autoCreateSession(true).
When autoCreateSession(false) is set and the session does not exist, Runner throws an IllegalArgumentException that includes the missing sessionId and userId.

Constructors

Choose the constructor that matches the runtime dependency you need: When the agent is a VeADK Java Agent, Runner reads its configured shortTermMemory and longTermMemory. An explicitly supplied ShortTermMemory constructor argument takes precedence.

Relationship to ADK Java Runner

VeADK Java Runner extends ADK Java Runner. Its convenience run(...) methods convert text into Content, call the underlying runAsync(...), collect events, and return a text result. If you need complete event handling, native ADK Web routes, or server-side streaming, choose one of these paths:
  • Use the underlying ADK Java Runner / runAsync(...) event stream.
  • Use the ADK Web example for native /run, /run_sse, and session APIs.
  • Use the AgentKit Runtime example for /invoke, with AGENTKIT_STREAMING=true when SSE is needed.

Use cases

  • Direct Runner: synchronous agent calls inside Java services, CLIs, tests, or scripts.
  • ADK Web: native ADK Web APIs, session CRUD, or /run_sse.
  • AgentKit Runtime: HTTP contract, container runtime, gateway integration, or managed deployment.

Troubleshooting

Last modified on October 20, 2026