GENERATIVE-AI-ENGINEER-ASSOCIATE · Question #39
A Generative AI Engineer is using LangGraph to define multiple tools in a single agentic application. They want to enable the main orchestrator LLM to decide on its own which tools are most…
The correct answer is B. 1. Define or import the tools 2. Define the agent 3. Initialize the agent with ReAct, the LLM, and. The correct LangGraph ReAct pattern follows three steps: (1) define or import the tools the agent can invoke, (2) define the agent's graph structure and state, (3) initialize the agent using create_react_agent() passing in the LLM and tools together. Option B correctly captures…
Question
A Generative AI Engineer is using LangGraph to define multiple tools in a single agentic application. They want to enable the main orchestrator LLM to decide on its own which tools are most appropriate to call for a given prompt. To do this, they must determine the general flow of the code. Which sequence will do this?
Options
- A
- Define or import the tools 2. Add tools and LLM to the agent 3. Create the ReAct agent
- B
- Define or import the tools 2. Define the agent 3. Initialize the agent with ReAct, the LLM, and
- C
- Define the tools 2. Load each tool into a separate agent 3. Instruct the LLM to use ReAct to call
- D
- Define the tools inside the agents 2. Load the agents into the LLM 3. Instruct the LLM to use
How the community answered
(53 responses)- A2% (1)
- B91% (48)
- C2% (1)
- D6% (3)
Explanation
The correct LangGraph ReAct pattern follows three steps: (1) define or import the tools the agent can invoke, (2) define the agent's graph structure and state, (3) initialize the agent using create_react_agent() passing in the LLM and tools together. Option B correctly captures this sequence. Option A incorrectly adds tools and the LLM to the agent before the ReAct agent is created, inverting the initialization order. Option C incorrectly loads each tool into a separate agent - tools are bound to a single agent, not split across many. Option D incorrectly embeds tool definitions inside agents and passes agents into the LLM, which inverts the entire architecture.
Topics
Community Discussion
No community discussion yet for this question.