Phase 08 · LangChain & LangGraph agentic systems Core

LangChain Roadmap

LangChain is a framework for composing LLM apps from Chat Model calls, Prompt Template objects, messages, parsers, tools and retrievers.

In plain terms

Think of LangChain as plumbing for model apps. A Human Message enters, a Prompt Template fills in variables, a Chat Model responds with an AI Message, and Message History stores the previous turns so the next call has context.

Why it matters

Raw API calls are enough at first, but real apps repeat the same patterns: assemble prompts, call a model, parse output, retrieve documents, stream tokens, retry failures and log every Run. LangChain gives names and interfaces to those patterns.

How it works

A basic Chain connects steps. LCEL, the LangChain Expression Language, uses the pipe operator (|) to connect components: prompt | model | parser. Each component is usually a Runnable, meaning it can be executed the same way. The common execution methods are invoke() for one input, batch() for many inputs, stream() for token streaming, ainvoke() for async one-shot calls, and astream() for async streaming.

When you use it

Use it when you need repeatable LLM workflows, RAG, tool calling, streaming, callbacks or observability. For a tiny one-off script, raw provider SDKs are often simpler.

Common mistakes

  • Learning framework syntax before understanding the raw model call underneath.
  • Treating Message History as magic memory instead of context you deliberately pass back in.
  • Making every app a Chain when one clear function would do.

Best practices

  • Build one raw API version first, then recreate it as LangChain components.
  • Print the filled Prompt before debugging the model.
  • Know the execution surface: invoke(), batch(), stream(), ainvoke() and astream().

Try it yourself

Create a Prompt Template, pass a Human Message into a Chat Model, store the AI Message in Message History, then run the same Chain with invoke() and stream().

Deep dive

LangChain gives reusable building blocks for model calls, prompts, parsers, retrievers, tools, agents, and workflows.

What it is

LangChain is a framework for building repeatable LLM workflows. LangGraph extends that into stateful graph-based agents.

Why it matters

As AI apps grow, you need named components for prompts, models, retrievers, tools, state, tracing, and evaluation.

How it works

Learn messages and prompts first, then chains and parsers, then retrievers and RAG, then agents, and finally LangGraph state and checkpoints.

Common mistakes

  • Using frameworks before understanding raw API calls.
  • Hiding the filled prompt from yourself.
  • Adding agents before a simple chain works.

Best practices

  • Build one raw version first.
  • Inspect every retrieved document.
  • Use LangGraph when workflow state and branching matter.

Resources

FAQ

Should beginners start with LangChain?

Build one raw API project first, then use LangChain when repeated workflow patterns appear.

When should I use LangGraph?

Use LangGraph for stateful, branching, resumable, or human-in-the-loop agent workflows.