Prebuilt middleware tour
Notebook· 04.02· 150–180 min· Lesson 34 of 129
The notebook opens in your lab, in a new tab. If your server is stopped, it starts first (a few seconds).
By the end you can
- Apply the reliability middleware: model retry, model fallback, tool retry and tool error.
- Cap runaway agents with model-call and tool-call limits, per run and per thread.
- Shape what the model sees with the LLM tool selector, context editing and the to-do list.
- Measure each middleware's effect (model calls, failed calls, tool calls, tokens) from a run trace, locally and in LangSmith.
- Stack retry and fallback in the right order, and explain why.
Before you start
Lesson 04.01 (hooks and their order).
Python in this lesson
Python guideNew herevars() and dir()
