Symptom
An AI Agent using a structured output parser plus memory works at first, then starts failing schema validation after several turns.
Evidence what you'll see
- Memory holds output: { output: ... } instead of the expected shape
- Later replies come back wrapped in an extra output key
- Schema validation error from the structured output parser
Cause
The agent wrapped already-formatted JSON in another output layer before parsing; that nested shape went into memory and the agent copied it in later replies.
Fix steps
0 of 2 done
Your check marks stay in this browser only.
Verify the fix worked
- Run a multi-turn conversation and confirm each reply matches your schema without an extra output key.
Sources and credit
Summarized in our own words from these public reports. Credit goes to their authors.
Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change
Hit an error we don't cover? Submit it