TypeScriptADK-TS

Agents

Build autonomous AI agents for reasoning, tool usage, and multi-agent coordination in ADK-TS

Agents are the foundational building blocks of the ADK-TS framework. They represent autonomous AI programs that can understand instructions, make decisions, use tools, and coordinate with other agents to accomplish complex tasks. Every agent extends from the BaseAgent class and implements specific execution patterns for different use cases.

What You'll Learn in This Section

This section covers everything you need to know about building and working with agents in ADK-TS:

  • Core agent types - From simple LLM agents to complex multi-agent systems
  • Orchestration patterns - How to coordinate multiple agents using workflows
  • Agent architecture - Understanding the base classes and inheritance hierarchy
  • Practical implementation - Using AgentBuilder for rapid development
  • Advanced patterns - Custom agents, multi-agent coordination, and specialized behaviors

Agent Types Overview

ADK-TS provides several agent types, each optimized for specific use cases:

Essential Tools & Configuration

Understanding Agent Architecture

All agents in ADK-TS follow a common architecture:

  • BaseAgent - Abstract foundation providing lifecycle management, callbacks, and hierarchy support
  • Agent Hierarchy - Agents can have sub-agents, creating parent-child relationships for delegation
  • Event-Driven Execution - Agents communicate through events in the ADK-TS runtime
  • Tool Integration - Agents can use tools to extend their capabilities beyond text generation

Key Concepts

  • Agent Names must be unique identifiers (no spaces, start with letter/underscore)
  • Sub-agents enable delegation and specialization within your agent system
  • Callbacks provide hooks into agent execution for monitoring and control
  • Sessions maintain conversation state and memory across agent interactions

Choosing the Right Agent Type

Selecting the appropriate agent type depends on your specific use case and requirements. Most developers start with LLM Agents for conversational AI and reasoning tasks, then move to more specialized types as their needs grow.

Decision Framework:

  • Need AI reasoning and conversation?LLM Agent (most common choice)
  • Sequential processingSequential Agent (one step after another)
  • Independent parallel tasksParallel Agent (simultaneous execution)
  • Iterative improvementLoop Agent (retry until success/condition)
  • Complex coordinationMulti-Agent System (specialized roles)
  • Custom business logicCustom Agent (extend BaseAgent directly)

Common Patterns by Use Case

The following table maps real-world scenarios to the most appropriate agent types. This helps you quickly identify which agent pattern fits your specific requirements:

Use CaseRecommended Agent TypeWhy
Chatbot/AssistantLLM AgentConversational AI with reasoning
Data PipelineSequential AgentStep-by-step data processing
Content GenerationParallel AgentGenerate multiple pieces simultaneously
Quality AssuranceLoop AgentIterate until quality standards met
Customer SupportMulti-AgentRoute to specialized departments
API IntegrationCustom AgentSpecific business logic and error handling

Development Pattern

Once you've chosen your agent type, most development follows this pattern:

  1. Configure the agent with models, instructions, and tools
  2. Add sub-agents if you need specialization or delegation
  3. Test and iterate using the built-in evaluation tools
  4. Scale up by adding more agents or switching to multi-agent patterns

Next Steps

Ready to start building agents? Here's the recommended learning path:

How is this guide?