AI Agent response sometimes nests / double wraps "output" JSON key

Hi @Ventsislav_Minev

Thanks very much for your reply!

I have no idea what’s happening under the hood, but the problem seems to be that the response from the model can be in different places. Even though the model returns JSON, sometimes it’s interpreted as free text and re-wrapped.

This thread has some good advice:

Namely, instead of attaching the Structured Output Parser to the Agent node, pipe the Agent’s output to a Basic LLM Chain node and connect the Structured Output Parser there instead. This seems to be more reliable (so far!).

1 Like