A minimal demo of deploying a Google Agent Development Kit (ADK) agent to LangSmith Agent Server, following the Deploy Google ADK agents guide.
The agent is a personal task manager: a single ADK LlmAgent whose tools read and write a per-session to-do list via tool_context.state. Because state is persisted through saf_sdk.adk.wrap and LangsmithSessionService, tasks survive across turns (and restarts) on the same thread.
agent.py defines:
- Tools that mutate a task list stored in session state:
add_task(title, priority)— add a task (low/medium/high)list_tasks(include_done)— list open (or all) tasks, sorted by prioritycomplete_task(task_ref)— mark a task done by id or exact titledelete_task(task_ref)— remove a task by id or exact titlesummarize()— counts by status and priority
- An
Agent(task_manager) usinggemini-2.5-flashthat drives those tools. - A module-level
agentproduced bywrap(Runner(...)), which Agent Server imports and serves.
Two things make this deployable:
- The runner uses
LangsmithSessionService()so session state is stored in the deployment's checkpoint store. - The wrapped graph is exported as the module-level
agentsymbol, whichlanggraph.jsonregisters under the graph idadk_echo.
adk-demo/
├── agent.py # exports the wrapped ADK agent
├── langgraph.json # Agent Server config (graph id: adk_echo)
├── pyproject.toml # Python dependencies
├── uv.lock # pinned dependency lockfile
├── .python-version # pinned Python version (3.12)
├── .env.example # environment variable template
└── README.md
- uv (package manager; installs Python 3.12 for you via
.python-version) - A LangSmith API key
- A Gemini API key (the agent uses a Gemini model)
The LangGraph CLI is pulled in as a project dependency (langgraph-cli[inmem]), so syncing the project gives you the langgraph command.
Install dependencies (creates a virtualenv and installs from the lockfile):
uv syncCopy the environment template and fill in your credentials:
cp .env.example .envGEMINI_API_KEY=your-gemini-api-key
LANGSMITH_API_KEY=your-langsmith-api-key
LANGSMITH_TRACING=true
LANGSMITH_PROJECT_NAME=adk-demouv run langgraph devThis serves the agent at http://127.0.0.1:2024 and opens LangSmith Studio. Try messages like:
- "Add 'write the demo readme' as a high priority task"
- "What's on my list?"
- "Mark the readme task done"
- "How am I doing?"
Or call it over HTTP:
# Create a thread
THREAD=$(curl -s -X POST http://127.0.0.1:2024/threads \
-H "Content-Type: application/json" -d '{}' \
| python -c "import sys, json; print(json.load(sys.stdin)['thread_id'])")
# Run the agent and wait for the final response
curl -s -X POST "http://127.0.0.1:2024/threads/$THREAD/runs/wait" \
-H "Content-Type: application/json" \
-d '{
"assistant_id": "adk_echo",
"input": {"messages": [{"type": "human", "content": "Add buy milk as a low priority task"}]}
}'Reusing the same THREAD across requests demonstrates that the task list persists in session state.
uv run langgraph deploy --name adk-demoSee Deploy to cloud for environment configuration, deployment types, and revision management.