Is there any way to create one Hitl( human in the ...
# koog-agentic-framework
r
Is there any way to create one Hitl( human in the loop) with koog?
m
My untested thought with ktor support like shown in

https://www.youtube.com/watch?v=AGHONAx8gjQ

is as SSE events are going down, your users can react and hit api endpoints to affect what's happening with the agent. I don't have a concrete example of it. There is also https://connectrpc.com/docs/kotlin/getting-started/ with kotlin support https://connectrpc.com/docs/kotlin/using-clients/ to allow two way communication. That's another avenue I am planning on exploring...
d
@renato.java yes, you can do human in the loop agents with Koog. Basically, you can have custom graph nodes that do interactions with the user. Koog's nodes are suspending functions so you can suspend a node waiting for user interaction, whether it is directly through a UI, through an HTTP API, or whatever. There are examples in the
examples
directory of the Koog repository that e.g. use
readline
to do that. Do not hesitate to ask if you need further guidance.
👍 1
Furthermore, you can use an
nodeExecuteTool
to implement such a suspending node.
gratitude thank you 1
r
@Didier Villevalois But my question is more specific, because the hitl agent is usually long-lived, for example, a SDR sales agent can take days, so I understand that the agent would have to restart, there would be an API that creates the same agent and returns in the middle of the flow. I don't know if it would be right to do it this way, saving memory and persistence, or if there should be N interconnected agents with state.