Skip to content

supritR21/Agentic-LangGraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agentic-LangGraph

Hands-on LangGraph practice project with notebook-based workflows for building graph-driven agents, tool-calling chatbots, and LLM integrations.

Overview

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

Project Structure

Agentic-LangGraph/
	01-LangGraph/
		simple.ipynb
	02-LangGraph/
		chatbot.ipynb
	requirements.txt
	README.md

Tech Stack

  • Python
  • LangGraph
  • LangChain
  • LangChain Community
  • LangChain Groq
  • Pydantic
  • python-dotenv
  • Arxiv and Wikipedia tool wrappers

Installation

1. Clone the repository

git clone https://github.com/supritR21/Agentic-LangGraph.git
cd Agentic-LangGraph

2. Create and activate virtual environment

Windows (PowerShell):

python -m venv .venv
.\.venv\Scripts\Activate.ps1

macOS/Linux:

python3 -m venv .venv
source .venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

Environment Variables

Create a .env file in the project root:

GROQ_API_KEY=your_groq_api_key
TAVILY_API_KEY=your_tavily_api_key

The chatbot notebook loads these values with python-dotenv.

Running the Notebooks

You can run notebooks in VS Code or Jupyter Lab.

Option A: VS Code

  1. Open the project in VS Code
  2. Open 01-LangGraph/simple.ipynb or 02-LangGraph/chatbot.ipynb
  3. Select your Python kernel
  4. Run cells in order

Option B: Jupyter Lab

pip install jupyterlab
jupyter lab

Then open the notebook and execute cells sequentially.

Notebook Breakdown

01-LangGraph/simple.ipynb

  • Defines a State schema with graph data
  • Creates nodes like start_play, cricket, and badminton
  • Uses conditional edge routing via a random selector
  • Compiles and visualizes the graph
  • Invokes the graph with initial state

02-LangGraph/chatbot.ipynb

  • 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

Common Issues

  • Missing API keys: Ensure .env contains both GROQ_API_KEY and TAVILY_API_KEY.
  • Notebook import errors: Confirm virtual environment is active and dependencies are installed.
  • Kernel mismatch: Select the interpreter from your project virtual environment.

Notes

  • Keep API keys private and never commit .env to Git.
  • This repository is practice-oriented and notebook-first, ideal for learning LangGraph patterns quickly.

Author

Suprit Raj

About

Notebook-based LangGraph project demonstrating agent workflows, tool-calling chatbots, and LLM integrations with external tools.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors