This guide shows you how to deploy a Google Agent Development Kit (ADK) agent on LangSmith Agent Server using theDocumentation Index
Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-cbpriv-1780098138-8a5fd76.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
deployments-wrap-sdk package.
deployments-wrap-sdk provides a thin wrapper that turns a configured ADK Runner into a LangGraph-compatible graph, so you can deploy ADK agents without writing the Functional API glue yourself. The wrapper:
- Bridges ADK sessions to Agent Server’s checkpoint persistence, so session state survives restarts and resumes across runs.
- Forwards ADK token events through LangGraph’s streaming pipeline, so partial tokens show up in
stream_mode="messages"and in LangSmith Studio. - Automatically enables LangSmith tracing for ADK when
LANGSMITH_TRACINGis set.
Prerequisites
- Python 3.11+
- LangGraph CLI for local dev and deployment
- A LangSmith API key, refer to Create an account and API key
- A Google AI API key if you use Gemini models, refer to Google AI Studio
Installation
Install the package with thegoogle-adk extra. The extra pulls in google-adk and other dependencies needed for the wrapper:
The PyPI distribution name is
deployments-wrap-sdk, but the Python import path is saf_sdk. Both refer to the same package.Quickstart
This minimal example builds an agent that returns the input as its response and does not require a model API key. The agent bypasses the LLM call so you can verify that the deployment works correctly before connecting a real model. Createagent.py:
agent.py
- Pass
LangsmithSessionService()as the runner’ssession_service.wrap()raises aTypeErrorif you forget. Agent Server needs this hook to load and save ADK session state through its checkpointer. - Export the wrapped
agentas a module-level variable. Agent Server imports this symbol when serving the graph.
before_model_callback and configure a model directly. For example, use Gemini by setting model="gemini-2.0-flash" with GOOGLE_API_KEY set, or use Claude/OpenAI via ADK’s LiteLLM adapter (google.adk.models.lite_llm.LiteLlm, available through google-adk[extensions]).
Capabilities and limitations
wrap() bridges a defined subset of ADK’s runtime to Agent Server. Review the boundaries below before porting an existing ADK agent, since some ADK features are passed through unchanged while others are intentionally not supported.
Supported
- Agent primitives:
Agent,SequentialAgent, andParallelAgent, including nested sub-agent delegation through thesub_agentsparameter. - Tools: Python function tools and
LongRunningFunctionTool. - Models: Gemini models directly, and any model supported by ADK’s LiteLLM adapter (
google.adk.models.lite_llm.LiteLlm, available throughgoogle-adk[extensions]). Set the provider’s API key on the deployment. - Token streaming: ADK partial events are forwarded through LangGraph’s async callback manager, so token chunks reach clients consuming
stream_mode="messages"and the Studio chat view. - Structured output: agents configured with
output_schemaandoutput_keyexpose the typed value on the graph’s response in addition tomessages. - Session persistence:
LangsmithSessionServicestores ADK session state in the deployment’s checkpoint store. State survives restarts and is loaded on each subsequent turn of the same thread. - Tracing: when
LANGSMITH_TRACING=true, the wrapper callsconfigure_google_adk()automatically (see Enable tracing). - Authentication: if Agent Server authentication is enabled, the authenticated user id becomes ADK’s
user_id. Otherwise the user id is"anonymous".
Not supported
- Multimodal input: the wrapper forwards only
messages[-1].contentas a single text part. Inbound images, files, audio, or inline binary blocks are not passed to the ADK runner. - Multiple new messages per turn: only the last item in
messagesis treated as the new user message. Conversation history is reconstructed from ADK session state, not from the LangGraph message list. - Bidirectional / live streaming: the wrapper hard-codes
RunConfig(streaming_mode=StreamingMode.SSE). ADK’sRunner.run_live()and the bidirectional streaming mode used for audio or voice agents are not invoked, so live audio and voice agents cannot be deployed throughwrap(). - Non-text output parts: only
part.textvalues are collected from ADK events. Inline images, audio, or files produced by the agent are not surfaced on the graph’smessagesoutput. - Intermediate events as messages: the response is emitted as one
AIMessagecontaining the concatenated text. Tool calls, tool results, and intermediate sub-agent turns are not exposed as separate items in the graph’smessagesfield. Inspect them in LangSmith traces instead. - Alternative ADK session services:
runner.session_servicemust be aLangsmithSessionService. ADK’sInMemorySessionService,DatabaseSessionService, andVertexAiSessionServiceare rejected with aTypeError, because session state is held in the LangGraph checkpoint. - Native LangGraph interrupts: the wrapper does not expose LangGraph’s
interruptorCommand(resume=...)mechanism. Human-in-the-loop flows built onLongRunningFunctionToolfollow ADK’s own pattern: the tool returns a status such aspending_approval, the agent replies, and a follow-up turn resolves the pending call.
Project layout
A deployable project needs three files:langgraph.json points Agent Server at the exported symbol:
langgraph.json
pyproject.toml declares dependencies:
pyproject.toml
Install dependencies
Run locally
Start the local Agent Server with the LangGraph CLI:http://127.0.0.1:2024 and opens LangSmith Studio so you can chat with the agent. Send a request directly with curl:
Deploy to LangSmith
Once the agent runs locally, deploy it to LangSmith withlanggraph deploy:
Enable tracing
wrap() calls langsmith.integrations.google_adk.configure_google_adk() automatically whenever LangSmith tracing is enabled, so all you need to do is set the environment variables on the deployment:
.env
API reference
wrap(runner)
Wraps a configured google.adk.runners.Runner and returns a LangGraph Pregel graph that can be exported from your module and served by Agent Server.
| Argument | Type | Description |
|---|---|---|
runner | google.adk.runners.Runner | A configured ADK Runner. Its session_service must be a LangsmithSessionService. |
Pregel graph whose name is runner.app_name.
Raises: TypeError if runner.session_service is not a LangsmithSessionService.
If runner.agent defines an output_key, that key’s value is also exposed on the graph’s output, in addition to messages. This is what makes ADK structured-output agents (output_schema=..., output_key=...) work with Studio and the /runs/wait response.
LangsmithSessionService
A google.adk.sessions.BaseSessionService implementation backed by Agent Server’s checkpoint store. The wrapper manages session lifecycle automatically. It creates a session on the first turn of a thread, loads it from the checkpoint on subsequent turns, and writes the updated session back when the run completes.
Use a fresh instance per Runner:
wrap() drives them through ADK’s normal session lifecycle.
ADKInput
The default input schema for a wrapped agent.
| Field | Type | Description |
|---|---|---|
messages | list[AnyMessage] | (Required) Conversation messages; the wrapper sends messages[-1].content to the ADK runner as the new user message. |
state_delta | dict[str, Any] | None | (Optional) Passed through to runner.run_async(state_delta=...) to mutate ADK session state for this turn. |
ADKOutput
The default output schema for a wrapped agent.
| Field | Type | Description |
|---|---|---|
messages | list[AnyMessage] | The agent’s response messages, appended to the thread via LangGraph’s add_messages reducer. |
messages as a typed field (rather than a plain dict) is what lets Studio detect the graph as chat-compatible and enable the chat-mode toggle.
How it works
When a run arrives:- The wrapped graph reads
thread_idfrom the run config and uses it as the ADKsession_id. If authentication is enabled, the authenticated user’s id becomes the ADKuser_id; otherwise the user id is"anonymous". - The wrapper loads the previous session (if any) from the LangGraph checkpoint into
LangsmithSessionService, then asks the runner to handle the latest message. - The runner emits ADK events. The wrapper forwards partial-token events through LangGraph’s async callback manager so they stream out via
stream_mode="messages", and collects final text for the response message. - When the run finishes, the wrapper serializes the ADK session and saves it to the checkpoint via
entrypoint.final(save=...). The next run on the same thread resumes from that state.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

