Skip to content

Repository files navigation

🦜🕸️ LangGraph — Learning Journey

What is LangGraph?

LangGraph is a library built on top of LangChain that allows you to build stateful, multi-step applications using Large Language Models (LLMs). While LangChain provides the building blocks (models, prompts, tools, chains), LangGraph takes things further by letting you define your application as a graph — with nodes (functions that do work) and edges (connections that control flow).

Think of it like a flowchart for your AI application: you define what each step does, and how data moves between steps.

Why Use LangGraph?

Traditional LLM applications are often simple input → output pipelines. But real-world AI applications need more:

  • Multiple steps — Break complex tasks into smaller, manageable pieces
  • Decision making — Route to different logic based on LLM output
  • Tool usage — Let the LLM call external APIs, search engines, databases
  • Iteration — Loop back and retry until quality is good enough
  • Parallel execution — Run multiple tasks at the same time for speed
  • State management — Keep track of data as it flows through your application

LangGraph makes all of this possible with a clean, graph-based architecture.

Tech Stack Used

Technology Purpose
LangGraph Graph-based orchestration framework
LangChain LLM integration, prompts, tools, chains
Groq LLM provider (using qwen/qwen3-32b model)
Python Programming language
Jupyter Notebooks Interactive development environment

Topics Covered

This repository contains 9 notebooks, each covering a key LangGraph concept. They are organized in a progressive learning order:

# Topic Description Folder
01 First Graph Build your first LangGraph — learn about State, Nodes, and Edges 01_First_Graph
02 Messages Understand message types (HumanMessage, AIMessage) and manual vs. auto state management using Annotated reducers 02_Messages
03 Prompts & Chains Use ChatPromptTemplate and LCEL (LangChain Expression Language) to chain prompts with models 03_Prompts_and_Chains
04 Tools & Binding Create custom tools (@tool decorator), integrate DuckDuckGo, Arxiv, Wikipedia, and bind them to the LLM 04_Tools_and_Binding
05 ReAct Agent Build a full ReAct (Reasoning + Acting) agent with tool calling loops and conditional edges 05_ReAct_Agent
06 Parallelization Fan-out pattern — run multiple nodes in parallel (Instagram, Twitter, LinkedIn posts simultaneously) 06_Parallelization
07 Router Dynamic routing using Pydantic structured output and conditional edges to direct flow based on LLM classification 07_Router
08 Orchestrator Orchestrator-Worker-Collector pattern — decompose tasks, execute in parallel with ThreadPoolExecutor, and summarize results 08_Orchestrator
09 Generator-Evaluator Iterative generation loop — generate content, evaluate quality, and refine based on feedback with iteration limits 09_Generator_Evaluator

Getting Started

Prerequisites

  • Python 3.10+
  • A Groq API key (set as GROQ_API_KEY environment variable)

Setup

# Clone the repository
git clone https://github.com/Salik-web/LangGraph.git
cd LangGraph

# Create a virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
pip install langchain langchain-community langchain-core langgraph duckduckgo-search arxiv wikipedia pydantic

# Set your API key
# Create a .env file (this is gitignored for security)
echo "GROQ_API_KEY=your_key_here" > .env

Running

Open any notebook in Jupyter and run the cells sequentially:

jupyter notebook

⚠️ Important Note

The .env file containing API keys is not included in this repository for security reasons. You must create your own .env file with your API keys.

Author

Salik — Learning and building with LangGraph 🚀

About

This repository explores LangGraph for building stateful, multi actor LLM applications. It features Python based examples, from basic routing to complex, cyclic multi agent workflows. Ideal for developers looking to master graph based agent orchestration, tool integration, and persistent memory management in modern AI architectures.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages