AI / LangGraph LangChain Interview questions
What are LangChain Agents?
A LangChain Agent is a system where an LLM acts as the reasoning engine that decides, at each step, which action to take. Unlike a fixed chain where the sequence of operations is defined by the developer, an agent dynamically determines the order and selection of tool calls based on the user's input and intermediate results.
The core loop of an agent is:
- Receive user input
- LLM reasons about what to do (Thought)
- LLM selects a tool and provides its input (Action)
- Tool executes and returns a result (Observation)
- LLM receives the observation and decides whether to take another action or produce a final answer
- Repeat steps 2–5 until a final answer is reached
This pattern is called ReAct (Reasoning + Acting). Agents are most valuable when the number or order of steps needed to solve a task cannot be predetermined — for example, researching a question that may require 1 or 5 web searches depending on what the first search returns. The two main modern approaches are OpenAI Tools Agent (structured tool calling via OpenAI function calling API) and ReAct Agent (reasoning via text in the prompt for models without native function calling).
More Related questions...