Skip to content

Conversation

@KellySit
Copy link

New Example: ADK Agent

Adds a new example demonstrating ADK agent training with Agent-Lightning. ADK is an observability framework for agent traces with span visualization and Cloud Trace integration.

Files Added:

  • examples/google_adk/adk_agent.py - LitAdkAgent implementation
  • examples/google_adk/train_adk.py - Training script with CI support
  • examples/google_adk/adk_debug.py - Sanity check script
  • examples/google_adk/prepare_dataset.py - Dataset conversion utility
  • docs/how-to/train-adk-agent.md - Comprehensive training guide
  • Updated pyproject.toml with adk optional dependency group

…d dependencies at pyproject.toml. Created google_adk under examples (adk_agent.py, adk_debug.py, prepare_dataset.py, README.md, train_adk.py)
@KellySit
Copy link
Author

@microsoft-github-policy-service agree [company="KellySit"]

@KellySit
Copy link
Author

@microsoft-github-policy-service agree

Copy link
Contributor

@ultmaster ultmaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! Let's work together to polish this work!

@@ -0,0 +1,395 @@
# Train ADK Agent with Agent-lightning and VERL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's refine this example. Users might have already read the how-to with verl + langchain. This how-to should focus on the differences -- how to make ADK agent available for training. Omitting other unnecessary details.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much! I have updated and made a latest commit based on the feedback. Ready for the review.

```

This allows you to verify that the agent logic and reward computation behave as expected before reinforcement learning is introduced.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's a how-to, please write the training results here.

algorithm=algo,
# Increase the number of runners to run more rollouts in parallel
n_runners=8,
strategy={
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

@@ -0,0 +1,8 @@
vendor/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think most of these ignores have been included in global gitignore. Please check,

logger = logging.getLogger(__name__)

try: # pragma: no cover - import guarded for optional dependency.
from google.genai import types as genai_types
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for try except here. This example assumes user have installed google ADK.

console = Console()


def parse_args() -> argparse.Namespace:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's work together to add CI for this example.

print(f"Wrote {len(df)} rows to {out_path}")


def create_toy_dataset(n_train: int = 8, n_test: int = 2) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you use a toy dataset. Any real dataset we can use?


This example demonstrates training a Google ADK (Application Development Kit) agent using Agent-Lightning with reinforcement learning. The agent processes user instructions and generates ADK actions for Google applications. It's compatible with Agent-lightning v0.2 or later.

## Requirements
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have decided to create a how-to tutorial, this README can be greatly simplified and only keeps necessarily installation and running guidance.

agentlightning/dashboard/**/*.js
agentlightning/dashboard/**/*.html
agentlightning/dashboard/**/*.svg
.claude/*.local.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to change this I think.

@KellySit KellySit force-pushed the examples/google_adk branch 2 times, most recently from 6a05b16 to 4ddfe51 Compare November 19, 2025 10:26
@KellySit
Copy link
Author

@ultmaster Thank you so much for the feedback. I have made some updates based on the feedback:

  • Fixed unnecessary changes (examples/apo/room_selector_apo.py)
  • Updated adk_agent.py and adk_debug.py
  • Added training result showcase to docs/how-to/train-adk-agent.md
  • Added CI and renewed prepare_dataset.py
  • Omitted unnecessary things (docs/how-to/train-adk-agent.md, examples/google_adk/README.md)

The changes are now pushed and ready for re-review. The latest commit is the ready one. Thanks.

@JasonHonKL
Copy link

@KellySit Great work but seems you have to resolve the conflict before the CI can run !

@KellySit
Copy link
Author

@ultmaster PTAL, conflicts resolved. Thank you!

@ultmaster
Copy link
Contributor

ultmaster commented Nov 20, 2025

Hi. Appreciate the improvements.

Given the implementation of current LitAdkAgent, I recommend using the style of @agl.rollout, which would be more concise. You only need to keep the async version. No need for both.

Another question is, would you mind changing a dataset? I don't want all the examples focusing on a single spider dataset. If you want to stick to spider, you can augment the existing how to train sql how-to document by adding a section about ADK; and merge the examples into spider directory. There is no need for another example directory --- which could cause confusion on why this is not called spider, do we prefer langchain over ADK, or whatever.

Also, would you allow me to edit the PR so that I can make some minor improvements and verify with CI?

instruction = self._compose_instruction(task)
agent_name = task["app_id"] or "adk_agent"

return LlmAgent(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about how ADK works. Is this agent equivalent to a single non-agentic LLM?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically yea, ADK agent example here wraps in its own orchestration/runtime. No use of tools or multi-step planning, so behavior is close to a non-agentic LLM, with a structured system prompt. But ADK supports multi‑step, agentic workflow too. I try to keep things simple for this example, but if necessary, we can extend it too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ultmaster Thanks! I will update this later, adopt the style @agl.rollout and switch to a different dataset. Feel free to edit the PR, improve it, or help with verification, let’s make this project great together!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KellySit maybe we can discuss more on what tasks, datasets and the expected outcomes of this example. Are you available on Discord or Wechat or X?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ultmaster Sure! I am available on Discord, here is my username: ivylavender.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KellySit Sorry I've been laggy on responses.

It seems I can't add you on Discord:

image

Would you be able to DM me in our discord community: https://discord.gg/RYk7CdvDR7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants