---
title: "Build a Recipe AI Agent with Koog and Docker"
description: "A small Kotlin AI agent built with JetBrains' Koog framework can run entirely on a local model served by Docker Model Runner, wired up through Docker Compose's agentic models feature."
url: "https://swe.quest/articles/build-a-recipe-ai-agent-with-koog-and-docker-5af82c75d41ec7f4"
canonical: "https://www.docker.com/blog/build-a-recipe-ai-agent-with-koog-and-docker/"
source: "Docker"
published: "2025-08-08"
difficulty: "medium"
kind: "How-to"
reading_minutes: 12
tags: ["ai-agents","jvm","containers","llms"]
---

# Build a Recipe AI Agent with Koog and Docker

A post on [Docker](https://swe.quest/sources/docker.md), published 2025-08-08, 12 min read, How-to. Original: [https://www.docker.com/blog/build-a-recipe-ai-agent-with-koog-and-docker/](https://www.docker.com/blog/build-a-recipe-ai-agent-with-koog-and-docker/)

## Summary

A small Kotlin AI agent built with JetBrains' Koog framework can run entirely on a local model served by Docker Model Runner, wired up through Docker Compose's agentic models feature. Compose injects the model endpoint and name as environment variables, and Koog's OpenAI-compatible client talks to the llama.cpp-based runner using the small Lucy 128k GGUF model, which runs without a GPU. When the model produces an inaccurate ratatouille recipe, the walkthrough fixes it by adding the Docker MCP Gateway over SSE to expose a DuckDuckGo search tool. The Kotlin changes are a Koog MCP tool registry and enabling the Tools capability on the model so it can call functions.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Java & JVM](https://swe.quest/tags/jvm.md) (Languages)
- [Containers](https://swe.quest/tags/containers.md) (Infrastructure)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)

## Prerequisites

- Kotlin and Gradle ([easy posts on Java & JVM](https://swe.quest/tags/jvm.md?difficulty=easy))
- Docker Compose ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))
- LLM function calling basics ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))

## Keywords

Koog, Docker Model Runner, Docker MCP Gateway, Docker Compose, Model Context Protocol, DuckDuckGo, Lucy 128k, llama.cpp

## Related posts

- [Breaking Free From AI Vendor Lock-in: Integrating GitHub Models with Docker cagent](https://swe.quest/articles/breaking-free-from-ai-vendor-lock-in-integrating-github-models-with-docker-8fc971be1201fa24.md): Docker · 2025-12-11 · Medium · 7 min read · AI agents, LLMs, Containers
  Docker cagent, an open-source multi-agent runtime driven by declarative YAML, can use GitHub Models as a custom OpenAI-compatible provider.
- [Building AI agents made easy with Goose and Docker](https://swe.quest/articles/building-ai-agents-made-easy-with-goose-and-docker-05962e3d4c772056.md): Docker · 2025-08-12 · Medium · 7 min read · AI agents, Containers, LLMs, Inference & serving
  A local, containerized AI agent can be assembled from Goose as the agent, Docker Model Runner serving a Qwen3 30B GGUF model through an OpenAI-compatible endpoint, and Docker MCP Gateway exposing a YouTube transcript tool over SSE, all wired together with Docker Compose.
- [Building an Easy Private AI Assistant with Goose and Docker Model Runner](https://swe.quest/articles/building-an-easy-private-ai-assistant-with-goose-and-docker-model-runner-6cdc8d1a08ce794b.md): Docker · 2025-06-27 · Medium · 4 min read · AI agents, LLMs, Inference & serving, Developer tools
  Goose, a CLI AI assistant, can run entirely on a local model by pointing its OpenAI provider at Docker Model Runner's OpenAI-compatible endpoint.
- [How to Build, Run, and Package AI Models Locally with Docker Model Runner](https://swe.quest/articles/how-to-build-run-and-package-ai-models-locally-with-docker-model-runner-acbc6d65548e5373.md): Docker · 2025-06-12 · Medium · 6 min read · Inference & serving, LLMs, Containers, Developer tools
  Docker Model Runner, enabled as a beta feature in Docker Desktop 4.40+, pulls GGUF-format LLMs from Docker Hub or Hugging Face and runs them locally via the \`docker model\` CLI or an OpenAI-compatible HTTP endpoint on localhost.
- [Build a Multi-Agent System in 5 Minutes with cagent](https://swe.quest/articles/build-a-multi-agent-system-in-5-minutes-with-cagent-b6fd900693f4f3cc.md): Docker · 2025-10-14 · Medium · 4 min read · AI agents, LLMs, Developer tools
  cagent is an open-source Docker tool that defines multi-agent AI systems declaratively in a single YAML file.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
