Skip to content
All paths
Build agentsBeginnerFor developers8 chapters152 min

Build your first agents

From one model call to a guarded agent, with LangChain.js and LangGraph.js, in your browser.

For developers starting with agents. You build one small support agent step by step: a model call, messages and state, a graph, tools, the agent loop, callbacks with human approval, and guardrails. Every chapter runs the real libraries in your browser with a scripted model, so you need no key; you can connect your own model when you want.

Chapters

  1. Chapter 2Locked

    One model call

    Calling a chat model with LangChain.js, reading the AIMessage it returns, and using your own key safely.

    15 min
  2. Chapter 3Locked

    Messages and state

    The four message types, why the whole conversation is sent every time, and how LangGraph merges state with reducers.

    18 min
  3. Chapter 4Locked

    Your first graph

    Building a StateGraph from nodes and edges, routing with a conditional edge, and running it step by step.

    20 min
  4. Chapter 5Locked

    Tools and tool calls

    Defining tools with zod, binding them to a model, and handling the tool calls the model makes.

    20 min
  5. Chapter 6Locked

    The agent loop: a minimal ReAct agent

    A model node, a tool node and one conditional edge: the whole agent loop as a LangGraph graph.

    20 min
  6. Chapter 7Locked

    Callbacks and human approval

    Watching a run with callbacks, and pausing it before a risky tool so a person can approve or reject it.

    22 min
  7. Chapter 8Locked

    Guardrails

    Checks in code around the model: input and output checks, tool allow-lists and step caps, in layers.

    22 min