A comprehensive laboratory for building resilient, stateful, and cyclic LLM applications using LangGraph. Master the transition from linear chains to complex agentic graphs.
This repository is a structured learning journey into LangGraph, the framework for building stateful, multi-actor applications with LLMs. It covers the complete spectrum of graph-based orchestration, starting from basic mathematical logic to advanced persistent chatbots.
- 0_test_installation: Verification of the graph execution environment.
- 1_bmi_workflow: Introduction to
StateGraph,TypedDict, and basic node-to-node transitions. - 2_simple_llm_workflow: Integrating LLMs as functional nodes within a graph.
- 6_quadratic_equation: Handling complex mathematical reasoning and multi-step logic.
- 3_prompt_chaining: Implementing sequential prompt logic for refined outputs.
- 4_batsman_workflow: Dynamic routing and domain-specific logic implementation.
- 7_review_reply_workflow: Automated customer sentiment analysis and response generation.
- 5_CSS_essay_workflow: Multi-stage content generation with refinement loops.
- 8_X_post_generation: Automating social media content creation using agentic workflows.
- 10_persistence: Mastering Checkpointers for state recovery, human-in-the-loop, and time-travel debugging.
- 9_basic_chatbot: Building a standard conversational interface using stateful memory.
- langgraph-chatbot/: A full-scale implementation of a persistent, tool-enabled chatbot.
- State Management: Using
TypedDictto maintain and update application state across nodes. - Nodes & Edges: Defining functional units and the logic that connects them (including
STARTandEND). - Conditional Routing: Implementing branches based on the graph's current state.
- Persistence: Using
MemorySaverto persist graph state across sessions. - Visualization: Generating Mermaid diagrams to visualize complex logic flows.
# Create and activate virtual environment
python -m venv myenv
source myenv/Scripts/activate # Windowspip install langgraph langchain_openai langchain_groq ipykernelLaunch Jupyter and explore the modules in order:
jupyter notebookWhile standard LangChain is excellent for linear DAGs, LangGraph enables:
- Cycles: Iterative refinement where an LLM can check its own work.
- Persistence: Seamlessly saving and resuming long-running agent workflows.
- Fine-Grained Control: Explicitly defining exactly how data flows between actors.