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

    renato.java

    09/10/2025, 2:01 PM
    Hello @Vadim Briliantov I am trying to test persistence using koog.ai 74 / 5.000 but I'm struggling with a problem even in the git code example: ai.koog.agents.example.snapshot.FilePersistentAgentExample, the error Node not found always happens "heckpoint files in directory: f568e681-e90b-42da-8544-72a7e5c58ecf, ee2edd37-bb81-419e-9240-f31c52176f1f, 667efba9-6255-444d-8956-ccc7826feaff, da5be52c-2dd4-484d-be3a-effa21ad346e, 2a2758a4-406c-4f66-a475-8fdb9b5e571e, ffef4a12-b75f-41c1-91dc-ab3a246e99da, 1682b4d2-a718-4860-9a5b-203f93e066d4, 90c111d8-552e-4db4-8f80-e3d6720a61a2 Now creating a new agent instance with the same ID to demonstrate restoration... 105526.904 [main] INFO a.k.a.snapshot.feature.Persistency - Restoring checkpoint: ee2edd37-bb81-419e-9240-f31c52176f1f to node finish 105526.905 [main] ERROR a.k.agents.core.agent.GraphAIAgent - [agent id: persistent-agent-example, run id: a3207154-d0e5-4f08-a246-0d897f207735] Reporting problem: Node finish not found java.lang.IllegalArgumentException: Node finish not found"
    m
    n
    • 3
    • 5
  • m

    Mirzamehdi

    09/10/2025, 2:52 PM
    Hi everyone, I have a suggestion related to Koog. I think it’s missing triggers. For example, in many use cases, people might want a Telegram message to act as a trigger. This could be implemented easily separately from the Koog framework itself ofcourse, but I just wanted to share the idea.
    a
    • 2
    • 3
  • s

    Sergi Aguilar

    09/10/2025, 4:18 PM
    Hi everyone, can we force an agent to use a tool on a specific step of the workflow? I tried doing this but sometimes is not calling the tool
    Copy code
    forwardTo executeToolCall onToolCall { it.tool == "writeFilesTool" }
    a
    • 2
    • 2
  • r

    rocketraman

    09/11/2025, 1:39 PM
    The Langfuse exporter appears to hide the prompts (replaces them with
    HIDDEN:non-empty
    ). Is there a way to turn this obfuscation off?
    k
    l
    • 3
    • 6
  • s

    Sam

    09/11/2025, 5:47 PM
    Hi all, just throwing it out there that tool calls on Anthropic models on AWS Bedrock are still broken. Error message example:
    Copy code
    aws.sdk.kotlin.services.bedrockruntime.model.ValidationException: tools.0.custom.input_schema: Field required
    Issue post: https://github.com/JetBrains/koog/issues/549 PR: https://github.com/JetBrains/koog/pull/582 Could somebody please review the PR when they get a chance please 🙂 This is preventing me from using Koog at the moment 😞
    ✅ 1
    k
    • 2
    • 13
  • p

    Paolo Pasianot

    09/12/2025, 12:27 PM
    Good morning, I'm trying out Koog and, in the meantime, I'm exploring the world of LLMs and AI. My question is, is it possible to use a custom LLM or, if on mobile devices, a local LLM as an LLM?
    k
    • 2
    • 5
  • s

    Sam

    09/12/2025, 2:27 PM
    Hi guys, I'm looking to contribute to the project. I've made a branch off of
    develop
    , made a commit, and I am looking to push to remote so I can create a PR. However, when I do this I get this error:
    Copy code
    ERROR: Permission to JetBrains/koog.git denied to samDobsonDev.
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    git remote -v
    is showing that the remote is definitely correct:
    origin  git@github.com:JetBrains/koog.git (fetch)
    origin  git@github.com:JetBrains/koog.git (push)
    Is the only way to contribute by making a fork?
    a
    • 2
    • 1
  • l

    Leonhard Solbach

    09/12/2025, 7:46 PM
    Does koog break with Kotlin 2.2?
    a
    a
    • 3
    • 5
  • l

    Leonhard Solbach

    09/13/2025, 12:41 PM
    Copy code
    val agent = AIAgent(
                executor = openai,
                systemPrompt = SEGMENTATION_CREATION_SYSTEM_PROMPT,
                llmModel = OpenAIModels.Chat.GPT5
            ) {
                install(OpenTelemetry) {
    
                    addLangfuseExporter(
                        langfuseUrl = "<https://cloud.langfuse.com>",
                        langfusePublicKey = "<PUBLIC_KEY>",
                        langfuseSecretKey = "<SECRET_KEY>"
                    )
                }
            }
    
            val output = agent.run(
                INPUT HERE
            """.trimIndent()
            )
    a
    • 2
    • 2
  • l

    Leonhard Solbach

    09/13/2025, 12:42 PM
    Does anybody have an idea why the systemprompt it shown as "HIDDEN:non-empty"
    k
    • 2
    • 1
  • r

    rocketraman

    09/13/2025, 5:18 PM
    In my test I get this error -- I'm following the pattern shown in https://github.com/JetBrains/koog/blob/480d1c7c922096a7cba757ed2122f95d5d41a903/agents/agents-test/src/commonTest/kotlin/ai/koog/agents/testing/feature/GraphTestingFeatureTest.kt. The main difference I can see is that my tool is a class-based tool with structured types -- any ideas?
    Copy code
    Session UUID is not mocked
    kotlin.NotImplementedError: Session UUID is not mocked
    	at ai.koog.agents.testing.tools.DummyAIAgentContext.getRunId(DummyAIAgentContext.kt:86)
    	at ai.koog.agents.testing.feature.Testing$Feature.verifyGraph(TestingFeature.kt:1027)
    	at ai.koog.agents.testing.feature.Testing$Feature.access$verifyGraph(TestingFeature.kt:929)
    	at ai.koog.agents.testing.feature.Testing$Feature$install$2.invokeSuspend(TestingFeature.kt:973)
    	at ai.koog.agents.testing.feature.Testing$Feature$install$2.invoke(TestingFeature.kt)
    	at ai.koog.agents.testing.feature.Testing$Feature$install$2.invoke(TestingFeature.kt)
    	at ai.koog.agents.core.feature.AIAgentPipeline$interceptBeforeAgentStarted$1.handle(AIAgentPipeline.kt:586)
    	at ai.koog.agents.core.feature.handler.AgentHandler.handleBeforeAgentStarted(AgentHandler.kt:97)
    The call that produces this error is
    Copy code
    assertNodes {
      callLLM withInput "foo" outputs toolCallMessage(fooTool, FooInput("foo"))
    }
    I can workaround it by specifing
    runId = ""
    in
    assertNodes
    but then I get
    kotlin.NotImplementedError: Agent input is not mocked
    , and if I implement that I get something else, and so on.
  • l

    Leonhard Solbach

    09/14/2025, 3:20 PM
    Annotation based tools also don't seem to work correctly in koog 0.4.1
    Copy code
    private suspend fun calculateSearchParameters(input: String) {
    
            val toolsList = LeadSearchTools(companySearchService)
            println("B")
            val agent = AIAgent(
                executor = openai,
                systemPrompt = COMPANY_SEARCH_SYSTEM_PROMPT,
                llmModel = OpenAIModels.Chat.GPT5,
                toolRegistry = ToolRegistry {
    //                tool(ReadFileTool(JVMFileSystemProvider.ReadOnly))
                    tools(toolsList)
                }
            ) {
                install(OpenTelemetry) {
    
                    setServiceInfo("lead-search", "1.0.0")
                    setVerbose(true)
                    addSpanExporter(LoggingSpanExporter.create())
                    addLangfuseExporter(
    
                    )
                }
            }
    
            println("C@C")
            val result = agent.run(input)
    
            log.info("Ouput $result")
        }
    
    @LLMDescription(
        """
        Tools for searching B2B company leads by industry, keywords, location, size, founding year, CMS and a semantic query.
        """
    )
    class LeadSearchTools(private val companySearchService: CompanySearchService) : ToolSet {
    
    
        @Tool
        @LLMDescription(
            """
            
            Search companies using optional filters plus a semantic searchTerm; returns deduplicated matches sorted by similarity.
            
    ...
        """
        )
        fun searchLeads(
           ... params here
        ): List<CompanyMatchData> {
    
            val result = runBlocking {
                companySearchService.findCompanies(
                    wzCodes = wzCodes,
                    categoriesOrKeyword = categoriesOrKeyword,
                    excludedKeywords = excludedKeywords,
                    addressFilter = addressFilter,
                    cmsSystem = cmsSystem,
                    searchTerm = searchTerm,
                    minimumEmployeeCount = minimumEmployeeCount,
                    maximumEmployeeCount = maximumEmployeeCount,
                    minimumFoundingYear = minimumFoundingYear,
                    maximumFoundingYear = maximumFoundingYear,
                    limit = limit,
                    customerId = null
                )
            }
    
            return result.companyMatchData
        }
    a
    a
    • 3
    • 7
  • l

    Leonhard Solbach

    09/14/2025, 3:21 PM
    The code just stops at printing B in this scenario. There should be at least an exception or something in the logs in this case.
  • h

    Hien Nguyen

    09/14/2025, 11:00 PM
    @Vadim Briliantov Dude, your Medium posts are awesome! Can't wait to see what you write next when will you intend to post the next one ? 🥰
    ❤️ 2
    thank you color 1
    v
    • 2
    • 4
  • s

    Sam

    09/15/2025, 10:59 AM
    Bit of a open-ended question, but is anyone else getting reaaally slow responses from models? I'm using the
    OpenAILLMClient
    , and from the time
    <http://httpClient.post|httpClient.post>()
    is called, to the time the response from OpenAI is received, is roughly 40-50 seconds on average for a very simple prompt and response, like 40 tokens generated maximum
    s
    v
    • 3
    • 10
  • s

    strindberg

    09/15/2025, 2:52 PM
    I'm trying to run a koog/ktor application, with the configuration in application.yaml:
    Copy code
    ktor:
        application:
            modules:
                - se.example.ai.ApplicationKt.main
    
    koog:
        openai:
            apikey: $OPEN_AI_API_KEY
            baseUrl: <https://api.openai.com>
    However, at startup, there is an error saying "ERROR Application - Failed to read Koog configuration from application config io.ktor.server.config.ApplicationConfigurationException: Path timeout not found." I can't figure out where to put the timeout configuration, and I find no documentation about it. I do have "ktor-server-config-yaml" in my dependencies.
    s
    v
    • 3
    • 7
  • h

    Higor Oliveira

    09/16/2025, 12:56 PM
    I'm struggling with trying to instantiate the
    AIAgent
    class with input and output types different than
    String
    . I saw we have the class and 2 factory functions with the same name. In the first screenshot we can see the function I wanted to use. In the second one is the function Intellij is recognizing enforcing
    String
    as input and output types. Is there any way to use AIAgent with different types ?
    a
    • 2
    • 5
  • l

    Leonhard Solbach

    09/19/2025, 8:04 AM
    Fyi its working with class based toolsI've seen a lot of improvements on the Kotlin-Swift interop recently. What would be the easiest way to call the Koog Agentic Framework from a Swift/Linux (so basically Swift on server) based application?
    a
    • 2
    • 2
  • j

    James Ward

    09/19/2025, 12:11 PM
    I'm having an issue with the strategy graph when an LLM response includes two messages, one is an Assistant message and one is a Tool call request. This seems to cause
    edge(nodeCallLLM forwardTo nodeFinish onAssistantMessage { true })
    to handle it and
    edge(nodeCallLLM forwardTo executeToolCall onToolCall { true })
    doesn't. The Assistant message is a
    <thinking>
    block. Any ideas?
    e
    v
    • 3
    • 6
  • j

    John O'Reilly

    09/19/2025, 5:31 PM
    Just looking at migrating
    Toolset
    based class to something that work work in KMP code ....🧵
    a
    • 2
    • 6
  • f

    Filip Zalewski

    09/19/2025, 7:16 PM
    I have tried the Langfuse integration and it works seamlessly, which is great. However, I don't see token counts in my traces, which is a key metric I need to track. I am using the Gemini models. Wondering if there is a configuration setting I may have missed?
    r
    • 2
    • 2
  • l

    Leonhard Solbach

    09/20/2025, 8:42 AM
    Does anyone have an idea how i can controll the models reasoning behaviour if its an openrouter model? https://openrouter.ai/docs/use-cases/reasoning-tokens#controlling-reasoning-tokens
    a
    • 2
    • 3
  • j

    John O'Reilly

    09/20/2025, 9:33 AM
    Is there any way right now to access on device models when using Koog on Android/iOS?
    g
    a
    • 3
    • 2
  • j

    John O'Reilly

    09/20/2025, 3:11 PM
    I've mostly been testing Koog on JVM so far but trying to use in KMP code now. That works fine for JVM as before but when I try to run Android app I'm getting following build error (with dependency on
    ai.koog:koog-agents
    0.4.2 in
    commonMain
    in KMP module)
    Copy code
    Duplicate class io.modelcontextprotocol.kotlin.sdk.LibVersionKt found in modules kotlin-sdk-client-jvm-0.7.0.jar -> kotlin-sdk-client-jvm-0.7.0 (io.modelcontextprotocol:kotlin-sdk-client-jvm:0.7.0) and kotlin-sdk-core-jvm-0.7.0.jar -> kotlin-sdk-core-jvm-0.7.0 (io.modelcontextprotocol:kotlin-sdk-core-jvm:0.7.0)
    p
    • 2
    • 3
  • p

    PHondogo

    09/20/2025, 3:21 PM
    Is it possible to use Koog with local models?
    g
    e
    • 3
    • 5
  • p

    Pavan Badugucse

    09/21/2025, 6:03 AM
    Hi, Quite new here. i'm working on a chat interface with kmp and koog framework. need to basically pass listOfmessage to AIAgent so i get tools as well. couldn't find way to pass tools in PromptExecutors.
    v
    • 2
    • 1
  • j

    John O'Reilly

    09/21/2025, 8:48 AM
    Has anyone been able to get a koog agent running on iOS? I'm seeing what looks like possible problem with Ktor engine being used. It seems to default to CIO for all platforms which firstly causes issue in my app's own Ktor requests.....can workaround that by explicitly passing Darwin engine on iOS to
    HttpClient
    but then run in to what looks like same issue when I try to run the Koog agent code on iOS.
    Copy code
    [agent id: 52f1e23c-d6b6-4f86-a120-624e46b72a3d, run id: bc4a47ec-2bdf-430a-8348-e3a1d2dcfd40] Reporting problem: TLS sessions are not supported on Native platform.
    v
    • 2
    • 4
  • s

    Sergi Aguilar

    09/21/2025, 4:45 PM
    Hey I want to have a greater context window on the sonnet 4 model, but if I specify the llmModel on the agent with a greater context window it says that the model can not be found, is there a way to change it? Sonnet 4 allows until 1M tokens into the context window but it seems that on Koog is limited at 200k
    o
    • 2
    • 2
  • h

    Higor Oliveira

    09/22/2025, 4:29 PM
    Have you guys managed to trace koog using Langsmith ?
  • e

    El Anthony

    09/23/2025, 5:30 AM
    I have an agent with no defined tools, but in the strategy, I have a "subgraphWithTask" node with several tools. I'm getting a "tool not defined" error because the "subgraphWithTask.callTool" node is trying to use the agent's tools (none) instead of the "subgraphWithTask" ones. Is this normal?