# Building AI Features in Kotlin Multiplatform Apps with Local Prompt Iteration

DevFeed: [Building AI Features in Kotlin Multiplatform Apps with Local Prompt Iteration](<https://devfeed.tech/articles/building-ai-features-isn-t-scary-26004.md>)

Original publisher: [Read original article](<https://medium.com/yazio-engineering/building-ai-features-isnt-scary-92817564e364?source=rss-fbf9b6d94e65------2>)

Author: Paul Woitaschek

Published: 2026-07-17T11:49:08Z

Content type: tutorial

Language: en

Sources: [Stories by Paul Woitaschek on Medium](<https://devfeed.tech/sources/stories-by-paul-woitaschek-on-medium.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [LLMs](<https://devfeed.tech/topics/llms.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>), [API](<https://devfeed.tech/topics/api.md>), [Back end](<https://devfeed.tech/topics/backend.md>), [voice ai](<https://devfeed.tech/topics/voice-ai.md>), [anthropic](<https://devfeed.tech/topics/anthropic.md>), [OpenAI](<https://devfeed.tech/topics/openai.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [anthropic](<https://devfeed.tech/tags/anthropic.md>), [api](<https://devfeed.tech/tags/api.md>), [backend](<https://devfeed.tech/tags/backend.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [llm](<https://devfeed.tech/tags/llm.md>), [llms](<https://devfeed.tech/tags/llms.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [mobile-app-development](<https://devfeed.tech/tags/mobile-app-development.md>), [openai](<https://devfeed.tech/tags/openai.md>), [speech](<https://devfeed.tech/tags/speech.md>), [voice](<https://devfeed.tech/tags/voice.md>)

## AI overview

This tutorial presents a workflow for building AI features in Kotlin Multiplatform mobile apps. It recommends defining the app interface first, implementing the feature locally with Koog to iterate quickly on prompts, and moving the implementation to a backend once the output is reliable. The example uses natural-language and voice-based nutrition tracking, with LLM output converted into proposed structured actions.

## Source excerpt

TLDR: Define the interface in the app, iterate locally with Koog, move the logic to the backend when it's done. AI features have a weird reputation among mobile developers. The model sits behind an API, the prompt lives on a server someone else owns, and every change means a ticket, a review, a deploy. So the whole topic feels like backend territory. But an AI feature is just a feature. Text in, structured data out, some logic in between. The only unusual part: the core of that logic is a prompt. And prompts are not designed, they are iterated. You try an input, look at the output, adjust, try again. Dozens of times. So the real problem is not building the feature. It's making that loop fast. The pattern I would like to show: define an interface in the app, build the real UI against it, implement it locally with Koog, iterate until the output is solid, then move the implementation to the backend. In Kotlin that last step is mostly copy paste. The example: track everything in one sentence We build Yazio, a nutrition tracking app, as Kotlin Multiplatform: one shared codebase for iOS and Android. That matters here, because everything below is written once and runs on both platforms. Tracking today is many small interactions: search a food, pick a portion, add water, log a workout. Now imagine the user just says what happened: "I had two scrambled eggs and a coffee for breakfast, drank half a liter of water, went for a 30 minute run, and for lunch I ate the same as yesterday."Users can track using voice The app answers with a list of proposed actions. The user deletes the wrong ones, speaks again to add what's missing, and confirms everything at once. Speech to text is solved on both platforms, so from our side the input is just a string. Messy natural language in, exact typed data out. That's what LLMs are good at. It's also the kind of logic you won't get right on the first try. The constraint: the key can't live in the app You can't ship an OpenAI or Anthropic API ke