5 Agentic workflows with LangGraph
This chapter covers
- Overview of agentic workflows and agents
- LangGraph fundamentals and state management
- Transition from LangChain chains to an agentic workflow
Large language models are driving a new generation of applications that require more than simple prompt-response exchanges. As applications become more complex, agentic workflows have become essential—a pattern where the LLM orchestrates a structured, multi-step process using predefined components and explicit state management. Agentic workflows follow a well-defined and consistent sequence of steps. Instead of adapting their behavior dynamically during execution, they emphasize reliability, transparency, and control. In this approach, the LLM makes decisions within clearly defined boundaries, ensuring that each stage of the process remains structured and reproducible. Later in the book, we’ll explore agent architectures that build on these principles to achieve greater autonomy and adaptability.
5.1 Understanding Agentic Workflows and Agents
LLM-powered agent-based systems typically follow one of two core design patterns: agentic workflows and agents. Each pattern shapes how the application operates, as illustrated in figure 5.1. Because these terms are often used interchangeably—but have important differences—it’s essential to understand exactly what is meant by “agentic workflow” and “agent” before diving deeper.