๐๏ธ ๐ Lecture notes
Creating agents using LangGraph
๐๏ธ ๐ Define graph state
Let's start by defining the state of the agent's graph.
๐๏ธ ๐ Instantiate the LLM
Now let's instantiate the LLM that will serve as the "brain" of the agent, and give it access to the tools we defined previously.
๐๏ธ ๐ Define graph nodes
Let's define the nodes of the graph. The agent will have two nodes- an agent node and a tool node.
๐๏ธ ๐ Define conditional edges
Edges in a LangGraph graph can be fixed or conditional. For conditional edges, we need a routing function to conditionally route the workflow to different nodes.
๐๏ธ ๐ Build and execute the graph
Now that we have defined the nodes and edges of the graph, let's put the graph together and execute it to ensure that the agent is working as expected.