Lets look into what agent is ?
-
Agent (created from create_agent) is a graph at its core

-
Langgraph is what makes this graphs possible
-
Langgraph helps in creating custom agents with your workflows.

Langgraph terminology
- Graph is a collection of nodes connected with each other
- Langraph uses the same terms
- Nodes (where processing happens)
- Edges (Define the direction)
- State (Data being processed by graph)
Lets play with langgraph
-
Steps:
- Create a new folder
- initialize using uv
- add the following packages
- langgraph
- langchain-google-genai
- python-dotenv
-
Graph will start with some inputs and state is that
-
State can be any class
- dervied from TypedDict
- pydantic model
-
To make graph executions visual add a package
langgraph-cli[inmem] - Create a file called as langgraph.json with followng contents
{
"dependencies": ["."],
"graphs": {
"agent_1": "./hello_agent_1.py:graph"
}
}
- Now execute
uv pip install colorama -
Run the command
langgraph dev -
Refer Here for the notes
