Category

langchain

20 articles across 6 sub-topics

LangChain Tools and Agents: The Classic Agent Loop

🎯 Quick TLDR: The Classic Agent Loop TLDR: LangChain's @tool decorator plus AgentExecutor give you a working tool-calling agent in about 30 lines of Python. The ReAct loop β€” Thought β†’ Action β†’ Observation β€” drives every reasoning step. For simple l...

β€’22 min read
LangChain 101: Chains, Prompts, and LLM Integration

LangChain 101: Chains, Prompts, and LLM Integration

TLDR: LangChain's LCEL pipe operator (|) wires prompts, models, and output parsers into composable chains β€” swap OpenAI for Anthropic or Ollama by changing one line without touching the rest of your code. πŸ“– One LLM API Today, Rewrite Tomorrow: The...

β€’20 min read

From LangChain to LangGraph: When Agents Need State Machines

TLDR: LangChain's AgentExecutor is a solid starting point β€” but it has five hard limits (no branching, no pause/resume, no parallelism, no human-in-the-loop, no crash recovery). LangGraph replaces the implicit loop with an explicit graph, unlocking e...

β€’19 min read
LangGraph Tool Calling: ToolNode, Parallel Tools, and Custom Tools

LangGraph Tool Calling: ToolNode, Parallel Tools, and Custom Tools

TLDR: Wire @tool, ToolNode, and bind_tools into LangGraph for agents that call APIs at runtime. πŸ“– The Stale Knowledge Problem: Why LLMs Need Runtime Tools Your agent confidently tells you the current stock price of NVIDIA. It's from its training d...

β€’18 min read

Streaming Agent Responses in LangGraph: Tokens, Events, and Real-Time UI Integration

TLDR: Stream agents token by token with astream_events; wire to FastAPI SSE for zero-spinner UX. πŸ“– The 25-Second Spinner: Why Streaming Is a UX Requirement, Not a Nice-to-Have Your agent takes 25 seconds to respond. Users abandon after 8 seconds....

β€’20 min read

The ReAct Agent Pattern in LangGraph: Think, Act, Observe, Repeat

TLDR: ReAct = Think + Act + Observe, looped as a LangGraph graph β€” prebuilt or custom. πŸ“– The Single-Shot Failure: Why One LLM Call Isn't Enough for Complex Tasks Your agent is supposed to write a function, run the tests, fix the failures, and re...

β€’23 min read

Multi-Agent Systems in LangGraph: Supervisor Pattern, Handoffs, and Agent Networks

TLDR: Split work across specialist agents β€” supervisor routing beats one overloaded generalist every time. πŸ“– The Context Ceiling: Why One Agent Can't Do Everything Your research agent is writing a 20-page report. It has 15 tools. Its context windo...

β€’27 min read

LangGraph Memory and State Persistence: Checkpointers, Threads, and Cross-Session Memory

TLDR: Checkpointers + thread IDs give LangGraph agents persistent memory across turns and sessions. πŸ“– The Amnesia Problem: Why Stateless Agents Frustrate Users Your customer support agent is on its third message with a user. The user says: "As I ...

β€’18 min read

Human-in-the-Loop Workflows with LangGraph: Interrupts, Approvals, and Async Execution

TLDR: Pause LangGraph agents mid-run with interrupt(), get human approval, resume with Command. πŸ“– The Autonomous Agent Risk: When Acting Without Permission Goes Wrong Your autonomous coding agent refactored the authentication module while you were...

β€’18 min read
Deploying LangGraph Agents: LangServe, Docker, LangGraph Platform, and Production Observability

Deploying LangGraph Agents: LangServe, Docker, LangGraph Platform, and Production Observability

TLDR: Swap InMemorySaver β†’ PostgresSaver, add LangServe + Docker, trace with LangSmith. πŸ“– The Demo-to-Production Gap: Why Notebook Agents Fail at Scale Your LangGraph agent works perfectly in the demo. You deploy it to a single FastAPI instance. ...

β€’26 min read
LangGraph 101: Building Your First Stateful Agent

LangGraph 101: Building Your First Stateful Agent

TLDR: LangGraph adds state, branching, and loops to LLM chains β€” build stateful agents with graphs, nodes, and typed state. πŸ“– The Stateless Chain Problem: Why Your Agent Forgets Everything You built a LangChain chain that answers questions. Then y...

β€’18 min read
Ai(5)

Skills vs LangChain, LangGraph, MCP, and Tools: A Practical Architecture Guide

TLDR: These are not competing ideas. They are layers. Tools do one action. MCP standardizes access to actions and resources. LangChain and LangGraph orchestrate calls. Skills package business outcomes with contracts, guardrails, and evaluation. Most ...

β€’15 min read

Mastering Prompt Templates: System, User, and Assistant Roles with LangChain

TLDR: A production prompt is not a string β€” it is a structured message list with system, user, and optional assistant roles. LangChain's ChatPromptTemplate turns this structure into a reusable, testable, injection-safe blueprint. TLDR: LangChain p...

β€’15 min read

How to Develop Apps Using LangChain and LLMs

TLDR: LangChain is a framework that simplifies building LLM applications. It provides abstractions for Chains (linking steps), Memory (remembering chat history), and Agents (using tools). It turns raw API calls into composable building blocks. TLD...

β€’17 min read

Guide to Using RAG with LangChain and ChromaDB/FAISS

TLDR: RAG (Retrieval-Augmented Generation) gives an LLM access to your private documents at query time. You chunk and embed documents into a vector store (ChromaDB or FAISS), retrieve the relevant chunks at query time, and inject them into the LLM's ...

β€’14 min read
Mastering Prompt Templates: System, User, and Assistant Roles with LangChain

Mastering Prompt Templates: System, User, and Assistant Roles with LangChain

TLDR: Prompt templates are the contract between your application and the LLM. Role-based messages (System / User / Assistant) provide structure. LangChain's ChatPromptTemplate and MessagesPlaceholder turn ad-hoc strings into versioned, testable pipel...

β€’14 min read