Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building an AI Coding Agent in 100 lines of Kotlin

Building an AI Coding Agent in 100 lines of Kotlin

Coding agents like Claude Code look like magic: They generate, check and fix code without intervention which boosts developer productivity.

But in order to use tools efficiently it pays off to understand how they work.

Actually the way AI agents work is very simple. And in this presentation I will show you a simple coding agent and explain the concept behind it. All code is in Github.

Avatar for Sergio Carrilho

Sergio Carrilho

March 12, 2026

More Decks by Sergio Carrilho

Other Decks in Technology

Transcript

  1. Building an AI Coding Agent in <100 lines of Kotlin

    A mental model about how agents work Sergio Carrilho Code: https://github.com/scarrilho/code-agent-example Post: https://sergiocarrilho.medium.com/building-an-ai-coding-agent-in-100-lines-of-kotlin-f9af28e6aeb0
  2. Motivation Coding agents like Claude Code look like magic: They

    generate, check and fix code without intervention which boosts developer productivity. But in order to use tools efficiently it pays off to understand how they work. Actually the way AI agents work is very simple. And in this presentation I will show you a simple coding agent and explain the concept behind it. All code is in Github.
  3. What is an AI agent “a system that can perceive

    its environment and act upon that environment to achieve specific goals”* * Book: AI Engineering: Building Applications with Foundation Models
  4. Demo “Make me a new file in kotlin called HelloWorld.kts

    file and implement hello world in it”
  5. Conclusion Building a coding agent it’s about giving an LLM

    hands and a loop. The real complexity lies in the model’s reasoning capabilities and the quality of tools you provide. A AI agent concept is simple: Brain + hands + loop
  6. References Books AI Engineering: Building Applications with Foundation Models Building

    Applications with AI Agents Web How to Build an Agent (or: The Emperor Has No Clothes): https://ampcode.com/how-to-build-an-agent Koog: https://www.jetbrains.com/koog/ Choose a design pattern for your agentic AI system: https://docs.cloud.google.com/architecture/choose- design-pattern-agentic-ai-system