Skip to content

[integration]Google-adk with OPIK - #14

Merged
LeoRoccoBreedt merged 17 commits into
comet-ml:mainfrom
lucifertrj:googleadk-integration
Jul 2, 2026
Merged

[integration]Google-adk with OPIK#14
LeoRoccoBreedt merged 17 commits into
comet-ml:mainfrom
lucifertrj:googleadk-integration

Conversation

@lucifertrj

@lucifertrj lucifertrj commented Jun 22, 2026

Copy link
Copy Markdown
Contributor
  • Added a Google ADK example that shows how to trace an Agentic RAG workflow with Opik
  • Demonstrate a router agent that chooses between local PDF retrieval using Qdrant vector engine and web search based on the user query

@LeoRoccoBreedt

Copy link
Copy Markdown
Collaborator

Hi @lucifertrj , thank you very much for your contribution!

We just updated our contribution guide and standardised our example addition pattern - could you review and apply the changes to your example please 🙏 I'd be happy to review the example once done!

I also wanted to find out if this type of example is something you put together specifically for this repo or if you've used a similar pattern for your own agent development? Do you use Google ADK often?

@lucifertrj

Copy link
Copy Markdown
Contributor Author

Sure, I will go through the updated contributing guide.

Yes, I use Google ADK quite often and have also used it in my talks. For my own agent development work, I have used LangGraph extensively as well. This example was added specifically for this repository.

@LeoRoccoBreedt

Copy link
Copy Markdown
Collaborator

Thanks then! Appreciate the contribution.

@fschlz

fschlz commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Thanks @lucifertrj for this integration! Rather than send you back through our (newly added) contributor harness, we pushed the compliance changes straight onto your branch — your commits and authorship stay intact, and these get it green against the new CI:

  • requirements.txtpyproject.toml — converted the full pip-freeze to a uv project with direct deps only ([tool.uv] package = false, mirroring the otel example).
  • run.sh (what the CI matrix runs) exporting OPIK_PROJECT_NAME, plus .gitignore (ignores db/, the downloaded PDF, .env) and .env.example.
  • Runs credentials-freeindex.py and main.py fall back to DRY_RUN and exit 0 when keys are unset, with the heavy ADK/embedding imports deferred. This is what the secrets-free CI job (the one fork PRs get) needs to pass.
  • Dropped the assets/dashboard.png reference (the image wasn't in the PR), switched the README to uv, and fixed small things (str path to QdrantClient, a parts guard, zip(strict=…), ruff).

Maintainer note: CI has no GOOGLE_API_KEY secret, so even live-run will DRY_RUN this example (exits 0, doesn't hit Gemini). To exercise the real traced path in CI, add a GOOGLE_API_KEY secret and reference it in the pr-test.yml / scheduled.yml env.

Integrations are detected at <vendor>/<example> (3-level, like otel/).
google_adk sat at 2 levels, so detect-changes + compliance skipped it and
false-passed. Nest the example under agentic_rag/, add a vendor README, and
point the root index row at the example.
@fschlz

fschlz commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

One more change: nested the example under integrations/google_adk/agentic_rag/ (added a vendor README.md at integrations/google_adk/). Our integrations live at <vendor>/<example> — e.g. integrations/otel/distributed_tracing — and the CI's folder detection keys off that 3-level shape. At the original 2-level path the example slipped past detection (checks skipped, compliance vacuously passed), so this nesting is what makes CI actually run + enforce it.

CI is green now: lint + dry-run + compliance all pass on integrations/google_adk/agentic_rag; live-run is skipped (fork PRs don't receive secrets). Ready for a maintainer review + merge.

@fschlz
fschlz requested a review from LeoRoccoBreedt June 30, 2026 02:57
@lucifertrj

Copy link
Copy Markdown
Contributor Author

cool. I had issues with lint, it seems you fixed it. Thanks

@lucifertrj

Copy link
Copy Markdown
Contributor Author

Dropped the assets/dashboard.png reference (the image wasn't in the PR), switched the README to uv, and fixed small things (str path to QdrantClient, a parts guard, zip(strict=…), ruff).

  • Should I add the assets/dashboard.png that can be used for readme, or is it fine to be excluded?

LeoRoccoBreedt and others added 4 commits June 30, 2026 14:34
…urable, align dry-run gate

- OpikTracer now logs to os.environ.get("OPIK_PROJECT_NAME", "google-adk-rag")
  so a direct `python main.py` lands in the right project instead of the
  ambient default (matches the otel integration pattern).
- Gemini model reads GADK_MODEL (default gemini-2.5-flash) so an unavailable
  model can be swapped via env instead of a code edit.
- index.py dry-run gate now also requires GOOGLE_API_KEY, matching main.py, so
  partial creds no longer trigger the heavy PDF download + embedding for a run
  that then dry-runs.
- Renamed leftover APP_NAME/USER_ID copy-paste constants; named the agent router_agent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rd web_search

- README: replace bare env block with the required env-vars table (adds
  GADK_MODEL, OPIK_PROJECT_NAME); fix "notebook-style router_agent" drift.
- .env.example: document optional GADK_MODEL override.
- .gitignore: trim to example-specific artifacts (db/, annual_report.pdf);
  generic ignores live in the repo-root .gitignore.
- tools.py: guard web_search results missing "body" to avoid KeyError.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@LeoRoccoBreedt

Copy link
Copy Markdown
Collaborator

Thanks @lucifertrj ! I pushed some fixes just to match the updated contribution style and ran it locally -- all successful! I've also merged and it looks good, don't worry about the image. Thanks again!

@LeoRoccoBreedt
LeoRoccoBreedt merged commit 821f62c into comet-ml:main Jul 2, 2026
7 checks passed
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