Agent Skills with Google ADK and DNS Agent
Same agent, different framework
Section titled “Same agent, different framework”examples/demo_dns_adk.py implements exactly the same DNS Agent with the same 6 skills, but using Google ADK instead of SkillAgent. The behavior is identical — the difference is in the framework infrastructure.
Comparison: pure Python vs ADK
Section titled “Comparison: pure Python vs ADK”# ── Pure Python (skill_engine.py) ──────────────────────────────────────────from skill_engine import SkillAgentfrom dns_skills import list_dns_records, create_dns_record, ...
agent = SkillAgent( skills=[list_dns_records, create_dns_record, find_dns_record, update_dns_record, validate_dns, check_propagation], instructions="You are a DNS agent...", name="DNS Agent")agent.run("Create api.yourdomain.com pointing to 203.0.113.50")
# ── Google ADK (demo_dns_adk.py) ────────────────────────────────────────────from google.adk import Agent, Runnerfrom google.adk.sessions import InMemorySessionServicefrom dns_skills import list_dns_records, create_dns_record, ...
agent = Agent( name="dns_agent", model="gemini-2.5-flash", tools=[list_dns_records, create_dns_record, find_dns_record, update_dns_record, validate_dns, check_propagation], instruction="You are a DNS agent...")
session_service = InMemorySessionService()runner = Runner(agent=agent, session_service=session_service, app_name="dns_demo")The skills (dns_skills.py) are exactly the same Python functions in both cases — nothing needs to be rewritten.
ADK components
Section titled “ADK components”Defines the agent: model, tools and instructions.
agent = Agent( name="dns_agent", model="gemini-2.5-flash", tools=[...], # The same Python functions from dns_skills.py instruction="..." # System prompt — Layer 1)Runner
Section titled “Runner”Orchestrates execution: connects the agent with the session service and manages the conversation cycle.
runner = Runner( agent=agent, session_service=session_service, app_name="dns_demo")InMemorySessionService
Section titled “InMemorySessionService”Keeps conversation history in memory. ADK manages it automatically.
session_service = InMemorySessionService()session = session_service.create_session(app_name="dns_demo", user_id="user")Async execution
Section titled “Async execution”ADK uses asyncio. The main function is async:
import asynciofrom google.genai import types
async def run_agent(user_message: str): content = types.Content( role="user", parts=[types.Part(text=user_message)] ) async for event in runner.run_async( user_id="user", session_id=session.id, new_message=content ): if event.is_final_response(): print(event.content.parts[0].text)
asyncio.run(run_agent("Create api.yourdomain.com pointing to 203.0.113.50"))Run the demo
Section titled “Run the demo”python examples/demo_dns_adk.py --demo # 3 pre-defined scenariospython examples/demo_dns_adk.py # interactive modepython examples/demo_dns_adk.py "your request" # direct modeThe output is equivalent to demo_dns.py — same scenarios, same behavior.
When to use ADK vs pure Python
Section titled “When to use ADK vs pure Python”Pure Python (SkillAgent) | Google ADK | |
|---|---|---|
| Dependencies | Only google-genai | Full google-adk |
| Session state | Doesn’t persist between calls | InMemorySessionService handles it |
| Multi-agent / A2A | Not native | Native support with RemoteA2aAgent |
| Ideal for | Simple scripts, quick demos | Production systems, A2A integration |