Skip to main content

ADK Utils Example

Build powerful AI chat applications with Google ADK, Next.js 16, and custom Ollama model support.

What is ADK Utils Example?

ADK Utils Example is a production-ready chat application that demonstrates how to integrate Google Agent Development Kit (ADK) with Next.js 16 and React 19. It showcases the power of @yagolopez/adk-utils, a utility package that extends ADK with Ollama model support and service helpers.

Quick Start

Get your chat app running in under 5 minutes

Installation

Step-by-step installation and setup guide

Agent Tools

Explore built-in tools for time, diagrams, and code

API Reference

Complete API documentation for all components

Key Features

Google ADK Integration

Build AI agents with Google’s official Agent Development Kit and custom Ollama model support

Modern Stack

Next.js 16, React 19, TypeScript, and Tailwind CSS 4 for cutting-edge development

Streaming Responses

Real-time streaming responses with markdown rendering and syntax highlighting

Mermaid Diagrams

Generate flowcharts, sequence diagrams, and more with built-in Mermaid.js support

Rate Limiting

Built-in rate limiting with @tanstack/react-pacer to protect your resources

Custom Tools

Extensible agent tools for time retrieval, code viewing, and diagram creation

Tech Stack

This project leverages modern technologies to deliver a high-performance chat experience:

Quick Example

Here’s how simple it is to create an AI agent with custom tools:
app/agents/agent1.ts
import { FunctionTool, LlmAgent } from "@google/adk";
import { OllamaModel } from "@yagolopez/adk-utils";
import { z } from "zod";

// Define a custom tool
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"),
  }),
  execute: ({ city }) => ({
    status: "success",
    report: `The current time in ${city} is ${new Date().toLocaleTimeString()}`,
  }),
});

// Create an agent with Ollama model
export const rootAgent = new LlmAgent({
  name: "agent1",
  model: new OllamaModel("gpt-oss:120b-cloud", "https://ollama.com"),
  description: "Agent with custom tools for time and diagrams",
  instruction: "You are a helpful assistant.",
  tools: [getCurrentTime],
});

Ready to Build?

Quickstart Guide

Follow our quickstart to get your chat app running

Architecture Deep Dive

Learn how the application processes requests

Build docs developers (and LLMs) love