Google Agent Development Kit (ADK) Introduction (2): Building a Multi-Agent Meeting Scheduling System
Jonathan Huang

Jonathan Huang @jnth

About: Happy Coding

Location:
Taipei
Joined:
Mar 11, 2021

Google Agent Development Kit (ADK) Introduction (2): Building a Multi-Agent Meeting Scheduling System

Publish Date: May 12
0 0

Learning Objectives

  • Master Tool Development and Integration Patterns: Learn how to design, implement, and integrate multiple tools within a multi-agent architecture.
  • Implement Complex Task Decomposition and Execution: Break down complex tasks like meeting scheduling into multiple steps, executed collaboratively by different agents.
  • API Permission Management and Error Handling: Understand Google Calendar API permission application, token management, and common error handling strategies.
  • Technical Breadth: Compare Google ADK with OpenAI Function Calling for multi-step task planning.

System Architecture and Project Structure

This project uses the Google ADK (Agent Development Kit) multi-agent architecture, breaking the meeting scheduling process into three specialized agents:

  • Validator Agent: Validates attendee email formats
  • Scheduler Agent: Integrates with Google Calendar API, responsible for scheduling and conflict detection
  • Notifier Agent: Generates and sends meeting notifications

These three agents are connected via SequentialAgent, forming a complete multi-step workflow.

meeting_workflow/
├── meeting_workflow_adk.py  # Main ADK implementation
├── streamlit_app.py         # Web interface
├── common/                  # Shared utilities
│   └── google_auth.py       # Google authentication functionality
├── agents/                  # Agent configurations
│   └── .../.well-known/agent.json
├── requirements.txt         # Dependencies
└── README.md                # Project documentation
Enter fullscreen mode Exit fullscreen mode

Tool Development and Integration

Tool Implementation

Each agent’s core capability is implemented as a Tool, inheriting from BaseTool and implementing the execute method.

Example: Email Validation Tool

class ValidateAttendeesTool(BaseTool):
    def execute(self, context, attendees: list):
        invalid_emails = [email for email in attendees if '@' not in email or '.' not in email]
        if invalid_emails:
            return {"valid": False, "invalid_emails": invalid_emails}
        return {"valid": True}
Enter fullscreen mode Exit fullscreen mode

Example: Meeting Scheduling Tool (Google Calendar Integration)

class ScheduleMeetingTool(BaseTool):
    def execute(self, context, summary, start_time, duration_min, attendees, description=None):
        # 1. Get Google Calendar credentials
        service = get_calendar_service()
        # 2. Check for time conflicts
        # 3. If no conflicts, create the meeting event
        # 4. Return the result
Enter fullscreen mode Exit fullscreen mode

Example: Notification Tool

class SendMeetingNotificationTool(BaseTool):
    def execute(self, context, event_id, summary, start_time, duration_min, attendees, description=None):
        # Generate notification content; can be integrated with Email/Line/Slack, etc.
        return {"status": "success", "message": "Notification sent"}
Enter fullscreen mode Exit fullscreen mode

Integrating Tools into Agents

Each Agent is built around its tools and can be given an instruction:

validate_agent = Agent(
    name="attendee_validator",
    model="gemini-pro",
    tools=[ValidateAttendeesTool()],
    instruction="Validate meeting attendee email formats"
)
Enter fullscreen mode Exit fullscreen mode

Multi-Step Task Planning (Workflow)

Use SequentialAgent to connect the three agents, forming a multi-step workflow:

meeting_workflow = SequentialAgent(
    name="meeting_workflow",
    sub_agents=[validate_agent, scheduling_agent, notification_agent],
    instruction="Complete meeting scheduling workflow"
)
Enter fullscreen mode Exit fullscreen mode

The main process process_meeting_request will:

  1. Validate email formats
  2. Attempt to schedule the meeting (if conflicts, return suggested times)
  3. Send meeting notifications

Google Calendar API Permission Management and Error Handling

Permissions and Token Management

  • You must first create a project in Google Cloud Console, enable the Calendar API, set up OAuth, and download credentials.json.
  • On first run, token.json is generated automatically and refreshed as needed.
def get_calendar_service():
    if os.path.exists('token.json'):
        creds = Credentials.from_authorized_user_file('token.json', SCOPES)
    # ... If not, guide through OAuth flow ...
    return build('calendar', 'v3', credentials=creds)
Enter fullscreen mode Exit fullscreen mode

Error Handling

  • Email format errors, API errors, time conflicts, and network issues are all clearly reported.
  • All exceptions are logged for easy debugging.
try:
    # Google Calendar API operations
except HttpError as error:
    logger.error(f"Calendar API error: {error}")
    return {"status": "error", "message": f"API Error: {str(error)}"}
Enter fullscreen mode Exit fullscreen mode

Web Interface (Streamlit)

A simple web interface is provided for users to enter meeting information and instantly see scheduling results and conflict suggestions.

# streamlit_app.py
summary = st.text_input("Meeting Subject", "Product Development Discussion")
meeting_date = st.date_input("Meeting Date", ...)
meeting_time = st.time_input("Meeting Time", ...)
# ... On submit, call process_meeting_request ...
Enter fullscreen mode Exit fullscreen mode

Comparison with OpenAI Function Calling

Item Google ADK Multi-Agent/Tool OpenAI Function Calling
Multi-step Task Flow Supports SequentialAgent Must design multi-step logic manually
Tool Integration Register as Tool class Register as function schema
Permission & API Mgmt Handle OAuth yourself Handled by external code
Error Handling Customizable granularity Must wrap yourself
Multi-Agent Workflow Built-in sub-agent support Must decompose manually

Conclusion:

Google ADK is suitable for applications requiring multi-agent collaboration and complex task decomposition, with clear Tool/Agent concepts. OpenAI Function Calling is suitable for single-step, single-model-driven tasks; complex workflows must be designed manually.

Certainly! Here’s the revised conclusion section, now including clear instructions on how to execute the Python app from both the command line and the web interface:


Conclusion

This project demonstrates how to use Google ADK to develop a multi-agent meeting scheduling system, covering tool development, API integration, multi-step task planning, permission management, and error handling. You are encouraged to further try:

  • Adding cross-timezone support
  • Integrating meeting room reservations
  • Supporting natural language input and parsing

How to Run This Python App

Command Line Usage:

You can schedule a meeting directly from the command line by running:

python meeting_workflow_adk.py --summary "Product Meeting" --time "2025-05-15T14:00:00" --duration 60 --attendees "alice@example.com,bob@example.com" --description "Product development meeting"
Enter fullscreen mode Exit fullscreen mode

Or, for a demonstration with example parameters, simply run:

python meeting_workflow_adk.py
Enter fullscreen mode Exit fullscreen mode

Web Interface:

To use the Streamlit web interface, run:

streamlit run streamlit_app.py
Enter fullscreen mode Exit fullscreen mode

Then open the displayed URL in your browser (typically http://localhost:8501).


For complete code and examples, please refer to this project’s GitHub Repo.


Next Article Preview

Multi-Agent Collaboration System: Project Management Collaboration Platform

In the next article, we will explore how to build a multi-agent collaboration system for project management, featuring Manager, Engineering, and QA/Test agents. This system will demonstrate advanced agent collaboration patterns for handling project planning, task assignment, and quality assurance workflows. Stay tuned!

Comments 0 total

    Add comment