Skip to content
PodSubs
ShowsPeopleGuestsJobsNewsEvents
More
BlogPodCred
Menu
ShowsPeopleGuestsJobsNewsEventsBlogPodCredNetworksSign in
Join nowSign in
  • Shows
  • People
  • Jobs
  • News
  • More
    • Guests
    • Events
    • Blog
    • PodCred
    • Networks
    Join nowSign in

The AI Practitioner Podcast

The AI Practitioner Podcast artwork

PODCAST — From Chains to Graphs: Smarter and Safer Agentic Systems with LangGraph (Part 1)

Oct 28, 20258 minAudio
ShareXLinkedInFacebookWhatsAppEmail

Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. Linear AI chains fail the moment reality gets messy: when APIs break, reasoning loops infinitely, or context is lost between steps. In this episode, we dive into how LangGraph reimagines agent design with stateful, graph-based reasoning that mirrors how scientists actually think. You’ll learn: * Why linear chains can’t handle non-linear thought or adaptive reasoning * How graph-based agents recover from failures using state, loops, and conditional logic * How LangGraph Studio and LangSmith provide full observability - from local debugging to production monitoring If you’d rather read than listen, the full article (with diagrams, code examples, and implementation details) is available on Substack: 👉 Enjoyed this episode? Subscribe to The AI Practitioner to get future articles and podcasts delivered straight to your inbox. Get full access to The AI Practitioner at aipractitioner.substack.com/subscribe

Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Transcript

From the show. Tap a time to play from there.

SPEAKER_00Welcome to The AI Practitioner, the show where we bridge the gap between AI theory and what actually works in the real world. I'm Liam. And I'm Chloe. Today, we are getting into something I think every single person building with LLMs has struggled with. Why do our agents, which seem so smart in testing, suddenly fall apart? Right. We're going to talk about moving away from simple, fragile chains of thought and into something much more robust, thinking in graphs. So this is the classic scenario, right? You've built an agent,

SPEAKER_00it's nailing all your unit tests, it looks brilliant, and then you deploy it. And it just breaks. It hits an edge case you never predicted, and the whole thing comes crashing down.

SPEAKER_03Exactly. We've all been there. And you start hunting for a bug in the code. But more often than not, the problem isn't the code itself.

SPEAKER_00That's the core idea we're digging into. The problem is more fundamental. It's the architecture of the agent's reasoning. We're forcing it to think in a straight line, when real-world problems are anything but linear.

SPEAKER_03You're basically giving it a script to follow. And the moment the world goes off script, the agent has no idea what to do next. Which brings us to the central failure point of these simple step-by-step agents.

SPEAKER_00This linear model is easy to build, which is why we all start there. But it's just not equipped for complexity. You can really see the contrast here. On the left, you've got linear chains. They're rigid, one way. If a step fails, the whole process is done for. There's no recovery.

SPEAKER_02But on the right, you have stateful graphs. The key words here are adaptive and resilient. A graph can have cycles, it can have branches, it can try something, fail, and decide to go down a different path. And crucially, it's stateful. It remembers what it's already done.

SPEAKER_00And this slide really breaks down why they fail in practice. An API call times out, a Lindier chain just dies. It can't loop back and retry. Right, or what if its initial strategy for solving a problem isn't working? A chain can't branch off to try a different approach. And that last point, no state, is everything. Without a memory of what's happened, it can't learn or recover from a failure mid-process. So if straight lines are the problem, the solution is to adopt a model that's much closer to how we as humans actually

SPEAKER_00solve problems. We don't think in a straight line. We explore, we backtrack, we connect ideas, we think in graphs. This quote from the Landgraf docs just nails it. The goal isn't to build agents that just execute a predefined sequence. It's to build agents that reason. And reasoning is iterative. Exactly. They need to remember context, try things, and, my favorite part, recover gracefully. Graceful failure is the holy grail for production systems. And you just can't get there with a rigid chain.

Okay, let's make this concrete with an example, an AI research assistant.

SPEAKER_00It starts, clarifies the user's question, and then searches for papers. But here's the brilliant part. After summarizing what it finds, it doesn't just stop. It hits a decision point. Are these results good enough or should I search again? That conditional loop back to step two is the graph in action. It's a cycle. A simple chain literally cannot do that. This all sounds powerful, but maybe a little abstract. So how do you, as a data scientist or developer, actually build one of these things? Well, the good news is that it breaks down into some really clear

modular components.

SPEAKER_00It's not as complex as it might sound. It all starts with this one concept, agent state. From a practical standpoint, this is just a Python object, like a dictionary, that you define. It's the agent's working memory. And this is the container that carries all the context, the user's original question, the papers it's found, the running summary, from one step in the graph to the next. It's the thread that connects everything. And the whole construction process is basically these three steps. One, you define that agent state object we just talked about. Two, you write your functions, which are the nodes in your graph.

SPEAKER_00And three, you define the edges, which are the rules that connect those nodes and control the flow. The beauty of this is how modular it is. Each node is just a function with one single job. You have a clarifier node, a researcher node, a summarizer node.

SPEAKER_03And this is huge for development. Let's say you want to switch from searching RSEC to searching Google Scholar. You don't have to rewrite your whole agent. You just swap out the researcher node function and everything else stays exactly the same. Okay, so we've built our shiny new graph-based agent, but billing it is just step one. Making it reliable enough for a real product, that is a whole different ballgame. 100%. This is where we move from a cool proof of concept to production-grade engineering, and that requires a totally new class of tools.

SPEAKER_00Think about it. Your standard debugger is built for linear execution. You set a breakpoint. You step through the code line by line. How on earth do you do that for a system that can decide to loop back on itself or jump to a completely different branch based on an LLM's output? You can't. Your old tools just won't work. It's like trying to navigate a city with a straight line ruler instead of a map. This is exactly why you need tools that are purpose-built for this new paradigm. You need something visual, an IDE that lets you see the graph and the agent's path through

it.

SPEAKER_00A tool like this is a total game changer. Being able to visually trace the agent's steps is one thing, but being able to pause it, look inside its memory, that agent state, and even change it to see what would happen?

SPEAKER_03That time travel debugging is incredible. It saves so much time. Instead of rerunning the whole expensive chain from the beginning, you can just rewind one step, tweak the state, and see how the agent reacts.

SPEAKER_00But debugging and development is only half the story. The moment you deploy this thing, you're flying blind unless you have a way to monitor it in the real world. That's where production observability comes in. For any real application, you absolutely need a dashboard like this. You have to track your key metrics in real time. How long is this agent taking to respond? How many tokens is it using? And what is that costing us? And what's our actual error rate with real user queries? Without this data, you can't operate at scale. And this is maybe the most important technical detail for

anyone running a production system. How do you get all of this rich, detailed tracing without slowing down the user's experience?

SPEAKER_03The answer is asynchronous tracing. All the logging and data collection happens in the background on a separate thread. So you get this incredibly deep visibility into your agent's behavior and it adds exactly zero latency to the actual application. It's the best of both worlds.

SPEAKER_00all right, that was a pretty deep dive from high-level concepts all the way down to production tooling. So let's wrap up with the key things you should take away from this.

SPEAKER_03What are the big ideas for the practitioner listening to this right now?

SPEAKER_00Okay, here we go. Number one, think in graphs, not chains. It's the only way to build adaptive agents. Number two, state is not optional. It's the core of your agent's memory. Three, build with modular nodes. It keeps your code clean and flexible. And finally, number four, you can't build what you can't see. You absolutely need specialized tools for visualizing, debugging, and monitoring these complex systems. Don't even try to fly blind. So we'll leave you with a final question to chew on. If your agent can't loop back on itself,

SPEAKER_00if it can't reconsider a problem when its first attempt fails, can you really say it's reasoning? Or is it just a very, very sophisticated script?

SPEAKER_01It's a fundamental distinction, and it's something we all need to be thinking about as we build the next generation of AI. Thanks for tuning in to The AI Practitioner.

Open the transcript file

Hosts and Guests

Nobody is credited on this episode yet.

Credit the people on this episode

Be the first to rate this episode

More episodes

All episodes
  1. PODCAST — Beyond Static Prompts: Building Self-Improving LLM Agents with ACE

    Nov 19, 202611 minAudio

    Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if AI agents could learn from every interaction...

    Credit the people on this episode

  2. PODCAST — Inside GEPA: Evolving LLM Agent Prompts with Reflective Feedback

    Nov 11, 202611 minAudio

    Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if AI agents could continuously improve their...

    Credit the people on this episode

  3. PODCAST — TextGrad in Practice: Optimizing LLM Agent Prompts with Textual Gradients

    Nov 3, 202615 minAudio

    Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if AI agents could improve their own prompts...

    Credit the people on this episode

  4. PODCAST — Continuously Optimizing AI Agent Prompts in Production

    Oct 28, 202615 minAudio

    Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if the key to better AI agents isn’t writing...

    Credit the people on this episode

  5. PODCAST — From Prompt Engineering to Harness Engineering: Where the Real Leverage Moved

    Oct 16, 202613 minAudio

    Prefer reading instead? The full article is available here. The podcast is also available on Spotify and Apple Podcasts. Subscribe to keep up with the latest drops. What if improving an AI agent’s performance had less...

    Credit the people on this episode