Why I Stopped Using One Agent and Built a Multi-Agent Pipeline Instead
A practical walkthrough explaining why a single LLM agent fails at complex tasks like text-to-SQL, and how to replace it with a multi-agent pipeline. The author breaks the problem into five specialized agents: Intent Parser, Schema Agent, Query Builder, Critic, and Response Agent, wired together using LangGraph with explicit state management and conditional retry logic. The post covers the LangGraph graph definition, node implementations using Gemini 2.5 Flash, feedback loops that pass critic output back to the builder, and production failure modes including context bleed, schema hallucination on large databases, compounding token costs, and silent JSON parsing failures. Ends with honest guidance on when NOT to use multi-agent architecture.