This directory contains reference implementations of AI Agents refactored from the Google Agent Development Kit (ADK).
These samples demonstrate the "Gemini 3" / Native Agentic architecture, where the orchestration logic (loops, state management, tool selection) is offloaded from client-side frameworks to the model itself via the Interactions API.
-
Install the SDK This requires the new
google-genailibrary (v1beta).pip install google-genai
-
Set your API Key You need a Gemini API key.
export GEMINI_API_KEY="your_api_key_here"
- Concept: Stateful, transactional bot with many tools.
- Key Feature: Demonstrates Automatic Function Calling. The model autonomously calls tools like
check_product_availabilityandmodify_cartto solve user requests. - Run:
python interactions_customer_service.py
- Concept: Integration Agent connecting to external systems (Mocked).
- Key Feature: Demonstrates API Integration. The agent acts as a bridge between a user and systems like a Ticket Database or StackOverflow.
- Run:
python interactions_software_assistant.py
- Concept: Hierarchical / Routing Agent.
- Key Feature: Demonstrates Native Reasoning. The model decides whether to query a SQL database (BigQuery) or perform Python analysis, without hardcoded "Router" logic. Watch the
[Root Agent Reasoning]logs. - Run:
python interactions_data_science.py
- Concept: Multi-Agent Orchestration.
- Key Feature: Demonstrates Workflow Planning. A single "Orchestrator" model manages a team of virtual sub-agents (Red Team, Target, Evaluator) by calling them as functions.
- Run:
python interactions_red_teaming.py
- Concept: Retrieval Augmented Generation.
- Key Feature: Demonstrates the Production Gap. While the model knows when to search, the infrastructure code (
retrieve_rag_documentation) must still be implemented by the developer using frameworks or libraries. - Run:
python interactions_rag_agent.py
- Logic: Moved from Python (
whileloops) to Model (output.thought). - State: Moved from Python (
messages=[]) to API (interaction_id). - Code: Significantly reduced boilerplate compared to framework-based implementations.