What does LangChain Expression Language (LCEL) let you do?
- Exam domain
- LangChain for AI agents
- Difficulty
- Easy
- In this mock
- 5 questions on this domainPractise this domain
Why D is the answer
Pipe a prompt, model and parser into one chain
LCEL composes runnables, such as a prompt template, a chat model and an output parser, into a chain with the pipe operator. The chain can then be invoked, streamed or batched.
Remember: LCEL: pipe components into a chain.
In detail
- Compose components with the | operator.
- Each component is a runnable.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Write SQL queries in plain English for any databaseWrong
Text to SQL is a separate feature, not what LCEL is.
B. Train a new language model from scratchWrong
LangChain uses models; it does not train them.
C. Host an MCP server inside the modelWrong
MCP servers are separate programs.
D. Pipe a prompt, model and parser into one chainRight
LCEL: pipe components into a chain.
Use case
An illustrative scenario, not a real incident.
Illustrative: a team pipes a summary prompt into a chat model and a JSON parser, then reuses the chain in three services.
See it in different ways
flowchart LR S0["Prompt template"] --> S1["Chat model"] --> S2["Output parser"] --> S3["Result"]
How to read this chart
- Read it in order: Prompt template, then Chat model, then Output parser, then Result.
mindmap
root(("LangChain"))
n1["Prompts"]
n2["Templates"]
n3["Models"]
n4["Chat models"]
n5["Parsers"]
n6["Structured output"]
n7["Tools"]
n8["Functions the agent can call"]How to read this chart
- The centre is "LangChain".
- "Prompts" covers "Templates".
- "Models" covers "Chat models".
- "Parsers" covers "Structured output".
- "Tools" covers "Functions the agent can call".