Skip to content

July 2025 · AI · LangChain · Node.js · LLM

AI in Web Apps: LangChain & LangGraph

What changes when an LLM needs to do real work, not just answer questions. Notes on agents, tools and streaming from building with LangChain and LangGraph.

AI in Web Apps: LangChain & LangGraph

Why a single prompt was not enough

A plain API call works well for one-shot answers. It starts to fall apart when the task has steps, such as looking something up, deciding what to do next, and checking the result. Trying to squeeze that into one giant prompt gives you something fragile that nobody wants to debug.

Thinking in graphs

LangGraph clicked for me once I stopped thinking of it as an AI tool and started seeing a state machine. Each step is a node, and the state moves between them. The model can loop back and check its own work, and you can see exactly where a run went wrong. That visibility is what makes it usable in production.

Tools keep the model honest

If someone asks for last month’s sales, the model should not guess. You give it a tool, which is just a normal function, and it fetches real data and explains it. Those functions should have the same permission checks as any other code. A model calling a tool should never be able to do more than the logged-in user could.

Do not make people stare at a spinner

Agent runs can take several seconds. Streaming tokens to the browser over a WebSocket, while showing which step is running, makes that wait feel much shorter. People are surprisingly patient when they can see progress.

What matters after the demo

Cost, accuracy and safety are what decide whether this survives. I log tokens per feature, keep a small set of test questions with known answers, and strip personal data before it leaves the server. For anything that changes a record, a person gets the final say.

Md. Fawjul Azim

Focusing on building high-performance web applications with modern tech stacks.