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://docs.langchain.com/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]).
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.

