https://kotlinlang.org logo
Join Slack
Powered by
# koog-agentic-framework
  • k

    Konstantin

    06/27/2025, 11:53 AM
    Hi, I am not sure if supporting MCP Elicitations is on the radar https://modelcontextprotocol.io/specification/draft/client/elicitation
    v
    • 2
    • 1
  • j

    John O'Reilly

    06/28/2025, 9:06 AM
    I have an MCP Server working successfully with Koog. I'm trying now as a test to create a local annotation based tool (https://docs.koog.ai/annotation-based-tools/) to do same function but it's not being invoked for some reason. Is there any other setup needed to use that?
    d
    • 2
    • 13
  • j

    John O'Reilly

    06/28/2025, 1:20 PM
    If using
    MultiLLMPromptExecutor
    what determines when each one gets used? Also, which models get used in this case?
    Copy code
    val multiExecutor = MultiLLMPromptExecutor(
            LLMProvider.OpenAI to openAIClient,
            LLMProvider.Google to googleClient,
        )
    d
    • 2
    • 1
  • o

    Ofek Teken

    06/28/2025, 10:28 PM
    Hey guys, first of all I want to say - thanks for this great framework, showing great potential and absolutely leveraging all of K's best features: • Great DSL • First class support of coroutines (obviously!) • And much more Kotlin stuff that I looked for and didn't find on relevant projects such as LangChain4j/LangGraph4j. After my initial exploration of Koog, I noticed that Structured Outputs are being "injected" into the prompt and not provided as a
    json_schema response format
    like OpenAI and more providers state. Libraries like LangChain4j allow you to essentially give these providers the
    response_format
    . As far as I see, this isn't the current approach in Koog which seems rather more error-prone for my understanding? (Thus, the rising need of the
    fixingModel
    technique in
    PromptExecutor.executeStructured
    ). Is there any specific reason for not sending the
    response_format
    for models that support it? e.g. in via Koog's
    OpenAIRequest
    (OpenAI response_schema reference). I can only assume it would remove the need for
    fixingModel
    and similar techniques, allowing a reliable
    type-safe
    response for models that indeed support it. One more question, out of pure interest and because I didn't catch that in the awesome KotlinConf talk - Was this project open-sourced after begin used internally in Jetbrains? If not, are there any future plans to use Koog in Jetbrains products?
    b
    a
    n
    • 4
    • 8
  • f

    Finn Jensen

    06/29/2025, 10:45 PM
    Hey guys! Question on the new response tokens support. I'm trying to implement an observability feature to log/categorize all of my llm requests. I keep getting null for the
    inputTokensCount
    and
    outputTokensCount
    using the
    OpenAIModels.CostOptimized
    model family. Is there any flag I need to toggle to have the LLMClient return the tokens?
    a
    • 2
    • 2
  • f

    Felix

    07/02/2025, 11:59 AM
    Hi. I'm trying to create a simple ReAct (Reason-Act) agent, where an LLM is used in two different nodes. However I want to use a different "system prompt" on each of these two steps. Is there any example available on customising the "system prompt" on each node? I could only find examples that use a single system prompt per agent. Thanks.
    a
    a
    • 3
    • 8
  • d

    Dirk

    07/03/2025, 11:44 AM
    Hey 👋, running `SingleLLMPromptExecutor(client).execute(prompt, model, listOf())`/`agent.runAndGetResult("some prompt")` with a OpenAILLMClient returns “Error from OpenAI API: 400 Bad Request: JSON format issue: expected string at field messages.content got instead array”. It appears that the user message is created as an object, rather than as a string, unlike the system prompt. Is this by design, or am I using it incorrectly for a simple prompt?
    f
    a
    • 3
    • 7
  • a

    andrew

    07/04/2025, 9:11 PM
    Hey all, I've been playing around with Koog and I've been trying to get it hooked into Atlassian's MCP server. However, I'm running into this issue. What would be the best way to supply information to koog so I can hook into their MCP server?
    d
    v
    • 3
    • 8
  • r

    Ricardo Belchior

    07/06/2025, 1:52 PM
    Hey folks 👋 (sorry for the newbie question), Is there any model with a free tier where we can experiment with tools? ie
    ToolRegistry { tool(SayToUser) }
    For example, Gemini Flash throws an exception saying tools are not supported for that model; and Gemini Pro does not have a free tier.
    v
    w
    a
    • 4
    • 6
  • m

    mdepies

    07/07/2025, 1:28 PM
    I'm trying to use llm streaming, is there a more concrete example I can see? I'd like to send partial strings to the user as the llm is 'responding'. I've looked at the existing doc but it seems focused on streaming that content into structured data.
    p
    f
    a
    • 4
    • 10
  • s

    Sergio Casero

    07/10/2025, 4:24 PM
    Hello all! newbie question, what do you think is the best approach to serve an
    AIAgent
    through an API with ktor? The idea is to provide an API to the devs so the mobile team can integrate it in the apps
    m
    v
    • 3
    • 20
  • f

    Filip Zalewski

    07/11/2025, 1:00 PM
    Hi there. I had two questions about including documents in prompts. I currently have the following:
    Copy code
    attachments {
        document(Path(documentPath).toString())
    }
    However, I'm wondering if it's possible to include a Byte[]? I am processing a file received via upload, and would like to avoid writing it to disk if possible. Follow-up, is there a way to include documents in subsequent prompts?
    d
    v
    • 3
    • 9
  • v

    visakha

    07/14/2025, 7:40 PM
    Can you guys help me here, the code below runs without errors, but I do not see any kind of outputs ,
    Copy code
    val agentGemini = AIAgent(
        executor = simpleGoogleAIExecutor(System.getenv("GEMINI_API_KEY")),
        systemPrompt = "You are a helpful assistant. Answer user questions concisely.",
        llmModel = GoogleModels.Gemini2_0Flash ,
        temperature = 0.7,
        toolRegistry = ToolRegistry {
            tool(SayToUser)
        },
        maxIterations = 100
    )
    
    
    
    fun main() = runBlocking {
    //    val result = agentOpenAI.run("Hello! How can you help me?")
        val result2 = agentGemini.run("Hello! How can you help me?")
    }
    k
    c
    a
    • 4
    • 6
  • e

    Eduardo Ruesta

    07/15/2025, 1:47 PM
    Hey team!! i want to learn how to use Koog for create AI Agents... i want to see articles, youtube videos. Can you help me sharing info? Thanks
    a
    e
    +2
    • 5
    • 6
  • d

    Daniela

    07/16/2025, 8:00 AM
    ✨ Koog 0.3.0 is out! This release brings powerful new capabilities for building scalable and production-ready AI agents, including: 💾 Agent persistence 🗂️ Vector document storage 🔭 Native OpenTelemetry support 🍃 Spring Boot integration 🌟 And more! Learn more here.
    thank you color 2
    🚀 1
    kodee happy 7
    🔥 12
  • e

    Eduardo Ruesta

    07/16/2025, 5:15 PM
    Hey team! I wanted to ask you a question. Suppose I want to create an app that has an agent running. When the user chat with the agent, use tokens = $$. So, maintaining the agent would cost $$. Is that correct? Or is there another alternative? One would be to charge the user a subscription fee. Thanks ❤️
    ✅ 1
    a
    c
    • 3
    • 3
  • o

    Ofek Teken

    07/16/2025, 9:52 PM
    Hey team, having a lot of fun tinkering around with 0.3.0, definetely waited for this K! I have a quick question. I want to create a
    node
    that returns a structured output
    sealed class
    that has it's own system prompt. At first I thought about using
    subgraphWithTask
    because you can very easily write the prompt task there and supply my own
    finishTool
    to achieve so. I looked at
    ProvideStringSubgraphResult
    , but I didn't find a way to express
    sealed hierarchies
    when writing the
    ToolDescriptor
    . I might've missed though. I'd be happy to hear if this even sounds like the correct direction for this use-case. I've responded inside the thread with what I currently did to achieve so. Thanks!
    ✅ 1
    a
    v
    • 3
    • 6
  • o

    Ofek Teken

    07/20/2025, 9:45 PM
    Hey guys! Wanted to know if Koog already supports
    context-caching
    , and if not to suggest it as an upcoming feature 🙂
    a
    v
    • 3
    • 3
  • f

    Filip Zalewski

    07/21/2025, 12:42 PM
    This is more of a general question, and I apologize if it’s been covered elsewhere. Is there any information about the longer term commitment and investment JetBrains is making in Koog? I am personally excited about having first class Kotlin support in a framework like this, but the question of longevity is one that will be important to answer for any business trying to decide whether it’s a suitable solution.
    👍 1
    a
    v
    o
    • 4
    • 5
  • e

    Eduardo Ruesta

    07/21/2025, 3:57 PM
    Hey guys! one question for now Koog is not available to run on iOS right? only Android and JS... Are you going to add the iOS option? thanks
    p
    • 2
    • 2
  • v

    Victor

    07/21/2025, 6:22 PM
    Hi Koog community! i'm building a full-stack kotlin agent app using koog 0.3.0. its in public beta for ios and android & i would love some feedback. Thanks, 🍎 iOS users can join via TestFlight - https://testflight.apple.com/join/PuNIVhMv 🤖 Android users can join via Play Store • browse to the link & scroll down to 'become a tester' - https://play.google.com/apps/testing/com.victoryapplications.wsb • then navigate to the play store and search for 'wall street stats'
    ❤️ 1
    🔥 1
    e
    d
    • 3
    • 9
  • r

    Rhony

    07/22/2025, 1:41 PM
    Is anyone here taking AI certifications? I found this https://www.blockchain-council.org/. Is it worth taking AI certifications, or do you have any other recommendations?
    v
    • 2
    • 2
  • e

    Eduardo Ruesta

    07/22/2025, 1:51 PM
    I'm trying to understand how MCP works in Koog. Maybe a practical example will help me understand it better. For example, if I want to create an agent that creates an event in the user's mobile calendar, is this possible with MCP? Does MCP allow me to connect to other apps' APIs, for example, so the agent understands it and can, in this case, create events? Thanks!
    j
    • 2
    • 1
  • e

    Eduardo Ruesta

    07/24/2025, 9:05 PM
    Hey, is any example of a Koog agent and running on Wasm? I'm working on a Compose Multiplatform project, i know Koog is available for Android and Wasm, is that correct?
    v
    p
    s
    • 4
    • 6
  • e

    Eduardo Ruesta

    07/26/2025, 2:31 AM
    Hey team! sorry for the 100 questions 😁! but im working on a Koog agent and MCP server... i added this dependencies in the commonMain:
    Copy code
    implementation(libs.koog.agents)
    implementation(libs.mcp)
    mcp = { module = "io.modelcontextprotocol:kotlin-sdk", version.ref = "mcp" }
    and
    koog-agents = { module = "ai.koog:koog-agents", version.ref = "koog" }
    with this version:
    koog = "0.3.0"
    mcp = "0.6.0"
    but when i tried to add the mcp tool to my agent like this:
    Copy code
    // Start the MCP server (e.g., as a process)
    val process = ProcessBuilder("path/to/mcp/server").start()
    
    // Create a ToolRegistry with tools from the MCP server
    val toolRegistry = McpToolRegistryProvider.fromTransport(
        transport = McpToolRegistryProvider.defaultStdioTransport(process)
    )
    
    // Use the tools in an AI agent
    val agent = AIAgent(
        promptExecutor = executor,
        strategy = strategy,
        agentConfig = agentConfig,
        toolRegistry = toolRegistry
    )
    
    // Run the agent
    agent.run("Your task here")
    my Android Studio can't find these classes
    McpToolRegistryProvider
    ,
    McpTool
    and
    McpToolRegistryProvider
    a
    p
    • 3
    • 9
  • d

    Daniela

    07/29/2025, 1:53 PM
    Hey everyone, our colleague Denis Domanskii wrote this really nice article on how to summarize LLM context when a conversation contains many tool calls. Please check it out.
    🙌 7
    📌 3
    🔥 4
    🙌🏽 1
    g
    u
    • 3
    • 2
  • j

    John O'Reilly

    07/31/2025, 8:26 AM
    Some coverage of Koog here https://www.linkedin.com/pulse/july-rest-story-jvm-weekly-vol-139-artur-skowro%C5%84ski-crwxf/
    🙌 5
  • e

    Eduardo Ruesta

    07/31/2025, 1:20 PM
    Hey team! is any example how to connect a mcp-server into a koog agent? I created a google calendar mcp server and i want to connect with my koog agent (android app)
    m
    • 2
    • 2
  • e

    Eduardo Ruesta

    07/31/2025, 6:32 PM
    I'm stuck on something. I'm implementing an agent in an Android app to recommend movies. I'm consuming a movie API. I want the agent to respond to me visually, but not in plain text. Instead, I want to provide the user with a UI, for example, with a card showing the movie poster, name, and other information. What would be the best way to do this?
    a
    s
    • 3
    • 6
  • c

    caelum19

    08/01/2025, 1:35 PM
    I want an agent to run in a loop where the loop control lies outside of the agent's execution graph (e.g.
    while (true) { agent.step() }
    ). I want the chat history to persist between steps (windowing or self-redacting is fine). What's the best way to do this? For context, I want the agent to be more autonomous and run continuously, using tools to wait for periods of inactivity
    s
    a
    • 3
    • 10