# budioktaviyan/agentic-kotlin architecture

> Architecture diagram of the GitHub repository budioktaviyan/agentic-kotlin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/budioktaviyan/agentic-kotlin
- Repository: https://github.com/budioktaviyan/agentic-kotlin

## Overview

This small Kotlin example configures a Koog assistant for current news in Indonesia. The principal workflow starts in main(), runs the agent with a news prompt, and prints the result. The agent is configured with a Google model executor, a user-facing SayToUser tool, and event handlers that log tool calls and completion. Only Main.kt is present as runtime source; framework-internal dispatch details are not shown.

Main entry points: [`src/main/kotlin/id/kotlin/agent/Main.kt`](https://github.com/budioktaviyan/agentic-kotlin/blob/main/src/main/kotlin/id/kotlin/agent/Main.kt) (News agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("Invoker"))
node_main["Program entry<br/>[Main.kt]"]
node_agent["News agent<br/>[Main.kt]"]
node_executor["Prompt executor<br/>[Main.kt]"]
node_google["Google LLM"]
node_tool["SayToUser tool"]
node_events["Event handlers<br/>[Main.kt]"]
node_console["Console"]

node_user -->|"starts"| node_main
node_main -->|"runs prompt"| node_agent
node_agent -->|"requests completion"| node_executor
node_executor -->|"uses client"| node_google
node_agent -->|"registers tool"| node_tool
node_agent -->|"handles events"| node_events
node_events -->|"logs events"| node_console
node_main -->|"prints result"| node_console

click node_main "https://github.com/budioktaviyan/agentic-kotlin/blob/main/src/main/kotlin/id/kotlin/agent/Main.kt"
click node_agent "https://github.com/budioktaviyan/agentic-kotlin/blob/main/src/main/kotlin/id/kotlin/agent/Main.kt"
click node_executor "https://github.com/budioktaviyan/agentic-kotlin/blob/main/src/main/kotlin/id/kotlin/agent/Main.kt"
click node_events "https://github.com/budioktaviyan/agentic-kotlin/blob/main/src/main/kotlin/id/kotlin/agent/Main.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user,node_google,node_console toneIndigo
class node_main,node_agent,node_executor toneTeal
class node_tool toneBlue
class node_events toneMint
```

## Components

### Other components

- **Invoker**
- [Program entry](https://github.com/budioktaviyan/agentic-kotlin/blob/main/src/main/kotlin/id/kotlin/agent/Main.kt): `src/main/kotlin/id/kotlin/agent/Main.kt`
- [News agent](https://github.com/budioktaviyan/agentic-kotlin/blob/main/src/main/kotlin/id/kotlin/agent/Main.kt): `src/main/kotlin/id/kotlin/agent/Main.kt`
- [Prompt executor](https://github.com/budioktaviyan/agentic-kotlin/blob/main/src/main/kotlin/id/kotlin/agent/Main.kt): `src/main/kotlin/id/kotlin/agent/Main.kt`
- **Google LLM**
- **SayToUser tool**
- [Event handlers](https://github.com/budioktaviyan/agentic-kotlin/blob/main/src/main/kotlin/id/kotlin/agent/Main.kt): `src/main/kotlin/id/kotlin/agent/Main.kt`
- **Console**

## Connections

- Invoker → Program entry: starts
- Program entry → News agent: runs prompt
- News agent → Prompt executor: requests completion
- Prompt executor → Google LLM: uses client
- News agent → SayToUser tool: registers tool
- News agent → Event handlers: handles events
- Event handlers → Console: logs events
- Program entry → Console: prints result
