{"slug": "thursdays-with-koog-other-agent-settings", "title": "Thursdays with Koog: Other Agent Settings", "summary": "Knosh 0.3.0, an open-source tool, now uses Koog's AIAgent with configurable temperature and maxIterations parameters. Temperature controls the randomness of token selection in LLMs, while maxIterations limits the agent's iterations to prevent excessive token usage. Koog supports temperature for many models and allows custom models to specify support.", "body_md": "[Knosh](https://knosh.commonsware.com) `0.3.0`\n\nuses this code to create a [Koog](https://docs.koog.ai) `AIAgent`\n\n:\n\n```\n    return AIAgent(\n      promptExecutor = promptExecutor,\n      llmModel =\n        resolveModel(\n          descriptor.provider,\n          agentConfig.modelName,\n          agentConfig.contextLength,\n          descriptor.modelDefinitions,\n        ),\n      toolRegistry =\n        toolSet.build(\n          agentConfig,\n          config.commandPermissions,\n          config.commandExternalDirectories,\n          config.logFullToolCalls,\n          config.allowedToolIds,\n          knoshConfig.toolLimits,\n          knoshConfig.webFetch,\n        ),\n      temperature = config.temperature ?: agentConfig.temperature,\n      maxIterations = config.maxIterations,\n      systemPrompt =\n        assembleSystemPrompt(\n          listOf(agentConfig.systemPrompt) +\n            loadAgentsMarkdown(\n              configDir = context.userHome / \".config\" / \"knosh\",\n              workingDir = context.workingDir,\n              fileSystem = fileSystem,\n            )\n        ),\n    ) {\n      if (onMetrics != null) {\n        install(MetricsFeature.Feature) { callback = onMetrics }\n      }\n\n      if (onStatus != null) {\n        install(StatusFeature.Feature) { callback = onStatus }\n      }\n    }\n  }\n```\n\nWe have discussed most of those parameters in earlier issues of this newsletter. Two remain: `temperature`\n\nand `maxIterations`\n\n.\n\nTemperature is fun... where it is available. Temperature sometimes is described as controlling how \"creative\" and LLM is. In truth, it just controls how random numbers get applied.\n\nLLMs are stochastic parrots. Given a prompt, they generate additional words, a token at a time. The tokens are chosen based on probabilities based on the prompt text.\n\nFor example, suppose our prompt is purely the following, without any sort of system prompt from the agent harness:\n\nWhere does the line \"Four score and seven years ago\" appear?\n\nMost Americans hopefully recognize that as the opening line of [Lincoln's Gettysburg Address](https://en.wikipedia.org/wiki/Gettysburg_Address). LLMs do not \"know\" anything, but they will have ingested lots of documents that refer to that line.\n\nWhen it comes to the first word to generate for a response to the prompt, high-probability words includes \"Lincoln's\" and \"That\" (to begin a sentence like \"That is Lincoln's Gettysburg Address\"). In this case, \"Lincoln's\" is high probability based purely on context, and \"That\" is high probability because it is a common first word of a sentence in a response to a question. Other words that are contextually relevant (e.g., \"Gettysburg\", \"Address\") are lower in likelihood, just because fewer sentences will start with them. And there are plenty of words that are rather unlikely to be chosen (e.g., \"rutabaga\"). The LLM \"chooses\" a word based on this sort of weighted probability distribution, making a random selection.\n\nTemperature affects how random that selection can be. A low temperature steers the LLM towards the highest-probability words. Higher temperatures allow the LLM potentially to pull in words from deeper in the \"long tail\" of candidates.\n\nTemperature is a capability of an LLM. Some have dropped it, while others still use it. We supply a value to Koog, and Koog decides whether to pass it along to the LLM based on the model's capabilities. Koog knows capabilities for many popular models, and if you create your own (e.g., for a local model), you need to indicate if you think that it supports temperature or not.\n\n`maxIterations`\n\nhelps you prevent the agent from wandering around aimlessly for extended periods, burning tokens as it goes.\n\nWe've talked about how `AIAgent`\n\nhandles [prompts](https://pac.commonsware.com/archive/thursdays-with-koog-prompts-everywhere/) and [tool calls](https://pac.commonsware.com/archive/thursdays-with-koog-tools/). It does all that without your involvement.\n\n[ maxIterations](https://docs.koog.ai/agents/basic-agents/#adjust-agent-iterations) effectively caps how much of that happens. It definitely caps tool calls. It might cap \"thinking\" messages — the precise scope of\n\n`maxIterations`\n\nis unclear. But, the idea is that you can control how long the LLM goes before your agent harness \"pulls the plug\".Both of those parameters are driven by agent frontmatter, with built-in defaults. You can have `temperature`\n\nand/or `maxIterations`\n\nfrontmatter values in an agent definition Markdown file, and those will flow through to the `AIAgent`\n\nconstructor call. So you can fine-tune these things if you want or ignore them if the defaults work well enough for you.\n\nSpeaking of frontmatter, next week's \"Thursdays with Koog\" will explore another facet of the Knosh frontmatter: the tool security system. This determines which tools Knosh will make available to an agent or command and what those tools can do.", "url": "https://wpnews.pro/news/thursdays-with-koog-other-agent-settings", "canonical_source": "https://pac.commonsware.com/archive/thursdays-with-koog-other-agent-settings/", "published_at": "2026-08-20 13:00:00+00:00", "updated_at": "2026-08-20 13:14:07.227960+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-agents", "developer-tools"], "entities": ["Knosh", "Koog", "AIAgent", "Lincoln's Gettysburg Address"], "alternates": {"html": "https://wpnews.pro/news/thursdays-with-koog-other-agent-settings", "markdown": "https://wpnews.pro/news/thursdays-with-koog-other-agent-settings.md", "text": "https://wpnews.pro/news/thursdays-with-koog-other-agent-settings.txt", "jsonld": "https://wpnews.pro/news/thursdays-with-koog-other-agent-settings.jsonld"}}