runtime-services
Configure and troubleshoot ADK runtime services: Runner, App, sessions, memory, artifacts, plugins, telemetry, code executors, environments, event persistence, and service lifecycles.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- runtime-services
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Configure and troubleshoot ADK runtime services: Runner, App, sessions, memory, artifacts, plugins, telemetry, code executors, environments, event persistence, and service lifecycles.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md12.8 KB
- 参考文档references/service-patterns.md12.8 KB
- 参考文档references/troubleshooting.md13.7 KB
- 脚本scripts/check_runtime_services.py6.7 KB
03 SKILL.md 正文
Runtime Services
Use this sub-skill when a task is about ADK execution services rather than agent design: Runner, InMemoryRunner, App, session persistence, memory, artifacts, plugins, telemetry, code executors, execution environments, event storage, lifecycle cleanup, or service migration cautions.
Route Here
- Create or debug a
Runner/InMemoryRunner, includingrun,run_async,run_live,run_debug,close, andauto_create_sessionbehavior. - Choose between
InMemorySessionService,SqliteSessionService,DatabaseSessionService, or cloud-backed session/memory/artifact services. - Explain why events, state, memory, artifacts, or live audio blobs were or were not persisted.
- Add an app-level
BasePluginthat observes model/tool/user/event callbacks while preserving runner-owned event persistence. - Configure OpenTelemetry/logging,
TelemetryConfig, orgoogle_adklogger behavior. - Attach a code executor or execution environment and assess local/container/cloud safety trade-offs.
- Diagnose optional dependency failures such as missing SQLAlchemy for DB sessions or missing extension/cloud packages.
Route Elsewhere
- Agent, tool, callback, schema, model, or sub-agent construction belongs in agent-construction.
Workflowgraph/node/edge/resume design belongs in workflow-orchestration.- CLI servers, app discovery, YAML config, and deployment commands belong in cli-configuration-deployment.
- Evaluation metrics, eval sets, and
adk test/adk evalassertion design belongs in evaluation-debugging.
Working Path
- Identify which service owns the symptom: runner lifecycle, session event persistence, memory ingestion/search, artifact storage, plugin callback order, telemetry export, or code execution.
- Confirm installation assumptions:
google-adk2.3.0, import rootgoogle.adk, Python 3.10+, and optional extras absent unless installed explicitly. - Use in-memory services for focused local tests; switch to persistent services only after checking dependencies, URLs/paths, concurrency, migrations, and credential requirements.
- Keep event persistence runner-owned: stream events through
Runner.run_async/run_liveand let the configured session service append non-partial events. - Close long-lived services with
await runner.close()orasync with Runner(...)when plugins, toolsets, or database engines need cleanup.
References And Scripts
- API Reference: constructor signatures, core methods, imports, service contracts, optional extras, and lifecycle notes.
- Service Patterns: safe recipes for runner setup, persistence choices, plugins, telemetry, memory/artifacts, and code execution.
- Troubleshooting: symptom-driven fixes for DB extras, event persistence, plugin callback order, blocking tools, code executors, credentials, and migrations.
- Runtime Services Diagnostic: safe local script that prints base runtime imports/signatures and reports optional DB-extra availability without touching databases or credentials.
Safety Defaults
- Prefer
InMemoryRunneror explicitRunner(..., session_service=InMemorySessionService())for examples and unit tests. - Treat
InMemorySessionService,InMemoryMemoryService, andInMemoryArtifactServiceas development/test services, not multi-process production stores. - Do not run destructive migrations or open user databases as a first diagnostic; inspect optional imports and backup plans before migration.
- Treat
UnsafeLocalCodeExecutorandLocalEnvironmentas high-trust local-only surfaces because model-generated code or shell commands can affect the host. - Do not assume base install includes DB, extension, MCP, GCP, or cloud service dependencies.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).