From the course: LangGraph.js: Building Agents with Javascript
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Understanding edges: Defining agent flow
From the course: LangGraph.js: Building Agents with Javascript
Understanding edges: Defining agent flow
In this video, we'll be discussing another building block of agentic workflows in LandGraphJS. And that's edges. We'll also be building out the graph for our suggested tags feature using edges. So what are edges in LandGraph? If nodes are the workstations in your factory, then edges are the conveyor belts that move work from one station to the next. Simply put, they define the flow of work. Which node runs after which. Edges are the parts of your graph that determines which node runs next, whether the workflow continues or ends, and if we need to conditionally route to a different workflow path. Every workflow starts from a special start node. This node can be represented by a special __start__ string or a start constant provided by LandGraph. You then connect your nodes, which are your units of work, using edges. Based on the sequence of your workflow, once you are on the final node, you would then connect it with an edge to a special end node. This node can be represented by a…