Home – Datmt

  • Lesson 4.1: The "Save Game" (Checkpointers)

    Now that our graph has logic (Module 3) and short-term memory (Module 2), we face a new problem: Long-term Memory. If you restart your script, the Python dictionary (State) is destroyed. The bot forgets who you are. To build a real application (like ChatGPT), you need to save the state to a database and reload

    Read More


  • Lesson 3.2: The Loop (Cycles)

    Lesson 3.2: The Loop (Cycles)

    Table of Contents1 The Scenario2 The Code3 Output (Randomized)4 Key Concept: Recursion Limit The most powerful feature of LangGraph is that it allows Cycles. You can draw an edge from Node B back to Node A. This creates a loop. The Scenario A “Coin Flip” game. The agent keeps flipping a coin until it gets

    Read More


  • Lesson 3.1: The Router (Conditional Edges)

    Lesson 3.1: The Router (Conditional Edges)

    Table of Contents1 The Scenario2 The Code3 Output A standard edge (add_edge) is like a train track; the train must go there. A conditional edge (add_conditional_edges) is like a junction. The graph pauses, looks at the State, and decides which track to take. To implement this, we need a special Routing Function. This function doesn’t

    Read More


  • Lesson 2.2 The Solution: Reducers

    Lesson 2.2 The Solution: Reducers

    Table of Contents1 The Fixed Code1.1 What is the Annotated type?1.2 How LangGraph Uses It2 The Result3 Why is this Critical? (The Chatbot Use Case)4 Real-World Example: Chat State To fix the overwrite issue in lesson 1, we need to tell LangGraph: “When you receive new data for ‘topics’, do not replace the old data.

    Read More


  • Lesson 2.1 The Problem: The "Overwrite" Bug

    Table of Contents1 The Broken Code2 The Result Let’s look at what happens when two nodes try to write to the same field in the state using the method from Module 1. The Broken Code We want to collect a list of topics. Node 1 finds “AI”. Node 2 finds “Crypto”. The Result What happened

    Read More