# ADK for TypeScript

> Google's Agent Development Kit for Node.js and the browser, with typed tools and a dev UI

- Category: Agents & Automation / Agent Frameworks & Builders
- Language: TypeScript
- Licence: Apache-2.0
- Repository: https://github.com/google/adk-js
- Website: https://adk.dev
- Canonical page: https://ai-tldr.dev/tools/adk-js/

## In short

ADK for TypeScript (the `google/adk-js` repository, published on npm as `@google/adk`) is the TypeScript edition of Google's Agent Development Kit: an open-source, code-first toolkit for building, evaluating and deploying AI agents. It sits in the Agent Frameworks & Builders category of the Agents & Automation tools and is open-source, written in TypeScript and licensed Apache-2.0.

## Overview

ADK for TypeScript (the `google/adk-js` repository, published on npm as `@google/adk`) is the TypeScript edition of Google's Agent Development Kit: an open-source, code-first toolkit for building, evaluating and deploying AI agents. Agent behaviour, orchestration and tool use are written as ordinary TypeScript, so an agent can be debugged, versioned and deployed like the rest of a codebase, from a single assistant up to a multi-agent system.

What sets this edition apart is where it runs. It targets the Node.js and browser ecosystems and ships ESM, CommonJS and web bundles, so the same agent code can run on a server or directly in a browser. Tool parameters are declared with Zod (v3 or v4) schemas and get compile-time type inference, which means the arguments a model passes to a tool arrive already typed in your handler.

Development tooling lives in a separate dev-dependency package, `@google/adk-devtools`. It provides the `adk` CLI for scaffolding (`adk create`), local testing (`adk run`, `adk web`) and deployment (`adk deploy cloud_run`), plus a browser-based dev UI for chatting with an agent and inspecting its events, state, artifacts and evals. The Python edition of ADK covers the same ideas for Python projects; this one is for teams whose agents live in a TypeScript stack.

## What it does

- Typed tools: wrap any function as a FunctionTool whose parameters are a Zod v3 or v4 schema, with compile-time type inference
- Runs in Node.js or the browser, from ESM, CommonJS and web bundles
- Built-in tools for Google Search, Google Maps, Vertex AI Search and URL context, plus MCP servers via MCPToolset and code execution
- Multi-agent orchestration: sequential, parallel, loop and routed workflows, and delegation to remote agents over the A2A protocol
- Developer guides for sessions and state scopes, cross-session memory, versioned artifacts, auth for protected APIs, planners and telemetry spans
- Dev tools package with a CLI (adk create, run, web, deploy cloud_run) and an interactive dev UI for testing and debugging

## Getting started

This follows the official TypeScript quickstart: create an ES module project, install the SDK plus the dev tools, define an agent with one typed tool, add a Gemini API key, then talk to it from the terminal or the dev UI. The quickstart lists Node.js 24.13.0 and npm 11.8.0 or later as requirements.

1. Create the project and install ADK

   Make an empty directory, initialise it as an ES module, then install the core SDK and the dev tools (CLI and dev UI) as a dev dependency.

```bash
mkdir -p my-agent/
cd my-agent/
npm init --yes
npm pkg set type="module"
npm pkg set main="agent.ts"
npm install @google/adk
npm install -D @google/adk-devtools
```

2. Define the agent in agent.ts

   An LlmAgent gets a name, a model, an instruction and a list of tools. The tool here is a mock FunctionTool whose parameters are a Zod schema; export the agent as rootAgent so the dev tools can find it.

```typescript
import {FunctionTool, LlmAgent} from '@google/adk';
import {z} from 'zod';

/* Mock tool implementation */
const getCurrentTime = new FunctionTool({
  name: 'get_current_time',
  description: 'Returns the current time in a specified city.',
  parameters: z.object({
    city: z.string().describe("The name of the city for which to retrieve the current time."),
  }),
  execute: ({city}) => {
    return {status: 'success', report: `The current time in ${city} is 10:30 AM`};
  },
});

export const rootAgent = new LlmAgent({
  name: 'hello_time_agent',
  model: 'gemini-flash-latest',
  description: 'Tells the current time in a specified city.',
  instruction: `You are a helpful assistant that tells the current time in a city.
                Use the 'get_current_time' tool for this purpose.`,
  tools: [getCurrentTime],
});
```

3. Add your Gemini API key

   Create a key in Google AI Studio and write it to a .env file next to the agent. To use Vertex AI instead, the README says to set GOOGLE_GENAI_USE_VERTEXAI=1, GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION and authenticate with gcloud auth application-default login.

```bash
echo 'GEMINI_API_KEY="YOUR_API_KEY"' > .env
```

4. Chat with the agent in the terminal

   Run the agent file through the dev tools CLI. The README advises always naming the package: if @google/adk-devtools is not installed, a bare `npx adk` downloads an unrelated package called adk from the public registry.

```bash
npx @google/adk-devtools run agent.ts
```

5. Open the dev UI

   Start the web interface from the project directory, open http://localhost:8000, pick your agent in the upper right corner and type a request. The docs note that ADK Web is for development and debugging only, not for production deployments.

```bash
npx @google/adk-devtools web
```

## When to use it

- Add an agent to an existing Node.js or TypeScript service without switching to a Python stack
- Run an agent directly in the browser from ADK's web bundle
- Give a Gemini-backed agent typed tools, Google Search grounding or an MCP server, and debug its tool calls in the dev UI
- Compose several agents into sequential, parallel, loop or routed workflows, or hand work to remote agents over A2A
