Hey, everyone. This is less a question about the f...
# koog-agentic-framework
m
Hey, everyone. This is less a question about the framework per se, and more about how folks are using it and what they are finding works or doesn't work. One thing that doesn't really seem to get much attention in the docs (AFAICT) is error handling. For instance, I've got a strategy worked out right now which parallelizes a couple of calls, then combines the results. Works well, but I had written the nodes to return
Result
types instead of throwing. But merging the result type back together makes things a bit messy. I'm wondering whether any has developed opinions/thoughts on how error handling works inside of strategy/subgraphs, what experiences have been, etc.
a
Result
outputs could be managed using conditions and transformations on the edges, e.g.:
Copy code
edge(nodeWithError forwardTo nextNode onCondition { it.isSuccess } transformed { it.getOrThrow() })

edge(nodeWithError forwardTo nodeHandleError onCondition { it.isFailure } transformed { it.exceptionOrNull()?.message })
Could it help or is your case more complicated?
m
Yeah, I'm aware of this possibility. Really the intent of the question was to see if anyone had any advice/recommendations about error handling in relatively complex agents/strategies. The question is more based off of curiosity about what others have tried than just what possibilities there are with the koog api.
v
Please feel free to also check out our new non-graph API where you can handle everything using the standard means of Kotlin (but you’ll lose the Persistence and nested observability. The rest will stay)
👍 1
m
Is the non-graph API documented somewhere?
v
just use
functionalStrategy
builder
And it’s called “functional” not because it’s coming from functional programming, it’s called functional because it’s defined by a kotlin function / lambda 🙂
m
Ah, thank you!