John O'Reilly
10/02/2025, 5:19 PMonAgentCompleted callback being invoked (as it had been before). I realise of course that version hasn't officially been released but just fyi in case of use.
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Agent was already started
at ai.koog.agents.core.agent.StatefulSingleUseAIAgent.run(StatefulSingleUseAIAgent.kt:103)John O'Reilly
10/02/2025, 5:36 PMAIAgent instance....is expectation now perhaps that it has to be recreated for each run?Vadim Briliantov
10/02/2025, 7:24 PMVadim Briliantov
10/02/2025, 7:28 PMAIAgentService which has all similar constructors as AIAgent (so you can literally just append “Service” after “AIAgent” — and it should construct you a matching agent service), and then it has createAgent(/** id = "optional-id" */) that would give you an instance of single-use AIAgent or you can use createAgentAndRun(input = "input for your agent")
Also you can now monitor agent state (using agent.getState(), or roll it back using persistence() in runtime)Vadim Briliantov
10/02/2025, 7:30 PMAIAgent is now essentially a single-run state-machine that can keep track of it’s state, take input and eventually produce some output (actually same as before, but now with state management and with explicit single-use contract)
AIAgentService is a service for launching multiple agentic flows.