Under the hood: Runnables and LCEL (legacy-aware)
Notebook· 01.07· 90–120 min· Lesson 16 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
- Explain the
Runnableprotocol (invoke/stream/batch, async twins,config) shared by prompts, models, parsers, tools, agents and LangGraph graphs. - Read and write LCEL pipelines:
prompt | model | parser,RunnableLambda,RunnableParallel,RunnablePassthrough.assign, and visualize them. - Add resilience with
with_fallbacksandwith_retry, and detect when a fallback fired. - Build a streaming transform with
RunnableGenerator(the pattern used in LangChain's voice-agent tutorial). - Recognize legacy code (
LLMChain,AgentExecutor,ConversationChain, ...), know it lives inlangchain-classic, and know when not to use LCEL in v1.
Before you start
Lessons 01.01–01.06.
Python in this lesson
Python guideNew hereGenerators (yield)
