What does a LangChain agent need that a simple chain does not?
- Exam domain
- LangChain for AI agents
- Difficulty
- Medium
- In this mock
- 5 questions on this domainPractise this domain
Why C is the answer
Tools that the model chooses to call
A chain runs fixed steps. An agent gives the model tools and lets it decide which to call, in what order, and when to stop.
Remember: Agent: model-chosen tools.
In detail
- Chain: fixed steps.
- Agent: the model picks tools in a loop.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. A prompt template that lists example answersWrong
Chains use prompt templates too.
B. An output parser that returns JSON every timeWrong
Parsers are optional in both.
C. Tools that the model chooses to callRight
Agent: model-chosen tools.
D. A vector store holding the whole webWrong
A vector store is one possible tool, not a requirement.
Use case
An illustrative scenario, not a real incident.
Illustrative: a fixed summary chain becomes an agent once it needs to choose between a CRM lookup and a web search.
See it in different ways
flowchart TD
Q{"Are the steps fixed?"}
Q -->|"Yes"| A0["Chain"]
Q -->|"No, the model decides"| A1["Agent with tools"]How to read this chart
- At "Are the steps fixed?": if "Yes", go to "Chain"; if "No, the model decides", go to "Agent with tools".
sequenceDiagram participant P0 as Agent runtime participant P1 as Model participant P2 as Tool P0->>P1: Prompt with tool schemas P1-->>P0: Tool call P0->>P2: Run the tool P2-->>P0: Result P0->>P1: Result for the next step
How to read this chart
- 1. Agent runtime sends "Prompt with tool schemas" to Model.
- 2. Agent runtime gets a reply from Model: "Tool call".
- 3. Agent runtime sends "Run the tool" to Tool.
- 4. Agent runtime gets a reply from Tool: "Result".
- 5. Agent runtime sends "Result for the next step" to Model.