AI / LangGraph LangChain Interview questions
What are the different agent types in LangChain?
LangChain provides several agent types, each suited to different LLM capabilities and task requirements:
| Agent Type | How it works | Best for |
|---|---|---|
| OpenAI Tools Agent | Uses OpenAI's native tool/function calling API to select and call tools | OpenAI models (gpt-4o, gpt-4-turbo); most reliable structured tool use |
| OpenAI Functions Agent | Older version using the functions API (now superseded by Tools Agent) | Legacy gpt-3.5/gpt-4 function calling |
| ReAct Agent | Uses Thought/Action/Observation text format in the prompt; parses action from model output | Models without native function calling; transparent reasoning |
| Structured Chat Agent | Like ReAct but handles tools with multi-field structured inputs | Tools that require more than a single string input |
| XML Agent | Uses XML-formatted actions; designed for Anthropic Claude models | Claude models where XML is reliable output format |
| JSON Chat Agent | Uses JSON-formatted actions in the prompt | Models that reliably produce JSON without native tool calling |
In practice, create_openai_tools_agent() or create_react_agent() are the most common entry points. For anything requiring fine-grained control over the agent loop — including human-in-the-loop, persistent state, or multi-agent coordination — consider using LangGraph instead.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
