Week 7 · Enterprise AI

Feed the error back

0:00 / 3:00

15 seconds

Column does not exist.

The agent shrugged and answered from memory instead of fixing the query.

ToolSQL errorContextError textAgentRewrites
Lesson notesFeed the error back: the short version+

Week 7 · Agents · about 3 minutes

What you will be able to do

Return a failed SQL tool error into the agent context so it can fix the query.

The idea

Tool failures are data. Put the error message back in the transcript and let the agent revise.

Do not invent a success. Do not drop the failure on the floor.

result = tool.run(args)
if result.error:
    messages.append({"role": "tool", "content": result.error})
    continue  # agent sees the error next step

An ignored tool error becomes a hallucination.

Key takeaways

  • Tool errors go into context.
  • Agent revises; it does not invent success.
  • Silence is worse than a loud failure.

Part of the Forward Deployed Engineer roadmap. New to the role? Start with what a Forward Deployed Engineer does.