Failure Index / Data & schema · warning · LangChain

OutputParserException: could not parse LLM output

The model's reply didn't match the format the agent framework expected (the ReAct 'Action:/Action Input:' shape or a JSON schema), so the framework couldn't extract the next action and gave up.

The error

OutputParserException Could not parse LLM output
langchain agent could not parse llm output
Invalid or incomplete response agent parser

Root cause

Smaller/cheaper models drift out of format, long contexts push the model to ramble, and prompts that mix instructions with formatting rules degrade compliance. One malformed reply kills the run when there is no retry-on-parse-failure.

The fix

Enable parse-error retries (handle_parsing_errors=True in LangChain, or a retry wrapper that re-prompts with 'respond ONLY with valid JSON'), tighten the format instructions at the END of the prompt, or switch structured outputs / function-calling mode so the model cannot answer off-format.

Preventing it next time

Prefer native tool-calling / structured output APIs over free-text formats — format compliance becomes the provider's job, not the parser's.

Stop debugging this by hand. Vorlo watches your agent and, when this failure happens, hands you the diagnosis and the fix — verified by developers who hit it before you — in your dashboard, Slack, or your editor. Two lines of code: pip install vorlo-trace · npm install vorlo-trace. Start free

Related failures