Hands-on LangGraph practice project with notebook-based workflows for building graph-driven agents, tool-calling chatbots, and LLM integrations.
This repository contains two Jupyter notebook modules:
01-LangGraph/simple.ipynb: A beginner LangGraph flow with conditional routing.02-LangGraph/chatbot.ipynb: A tool-using chatbot workflow with Arxiv, Wikipedia, and Tavily search integrations.
The project demonstrates how to:
- Define graph state using
TypedDict - Add nodes and edges in
StateGraph - Build conditional branches and looping workflows
- Bind tools to an LLM
- Visualize graph topology with Mermaid PNG rendering
Agentic-LangGraph/
01-LangGraph/
simple.ipynb
02-LangGraph/
chatbot.ipynb
requirements.txt
README.md
- Python
- LangGraph
- LangChain
- LangChain Community
- LangChain Groq
- Pydantic
- python-dotenv
- Arxiv and Wikipedia tool wrappers
git clone https://github.com/supritR21/Agentic-LangGraph.git
cd Agentic-LangGraphWindows (PowerShell):
python -m venv .venv
.\.venv\Scripts\Activate.ps1macOS/Linux:
python3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtCreate a .env file in the project root:
GROQ_API_KEY=your_groq_api_key
TAVILY_API_KEY=your_tavily_api_keyThe chatbot notebook loads these values with python-dotenv.
You can run notebooks in VS Code or Jupyter Lab.
- Open the project in VS Code
- Open
01-LangGraph/simple.ipynbor02-LangGraph/chatbot.ipynb - Select your Python kernel
- Run cells in order
pip install jupyterlab
jupyter labThen open the notebook and execute cells sequentially.
- Defines a
Stateschema with graph data - Creates nodes like
start_play,cricket, andbadminton - Uses conditional edge routing via a random selector
- Compiles and visualizes the graph
- Invokes the graph with initial state
- Configures external tools:
- Arxiv query tool
- Wikipedia query tool
- Tavily search tool
- Initializes a Groq chat model
- Binds tools to the model
- Builds LangGraph chatbot workflows:
- Single-pass tool-calling flow
- Looping tool-calling flow until completion
- Executes sample prompts and prints message traces
- Missing API keys: Ensure
.envcontains bothGROQ_API_KEYandTAVILY_API_KEY. - Notebook import errors: Confirm virtual environment is active and dependencies are installed.
- Kernel mismatch: Select the interpreter from your project virtual environment.
- Keep API keys private and never commit
.envto Git. - This repository is practice-oriented and notebook-first, ideal for learning LangGraph patterns quickly.
Suprit Raj