tezvyn:

Describe a ReAct agent architecture for multi-step dependent tool calls

AI-drafted, machine-checkedSource: research.googleintermediate
Describe a ReAct agent architecture for multi-step dependent tool calls
WHAT IT TESTS

Designing loops that interleave reasoning and tool use across steps.

ANSWER OUTLINE

Sketch ReAct's thought-action-observation cycle; keep state in an append-only trajectory; re-plan after each observation.

WHAT THIS TESTS: This question probes whether you understand that complex agentic tasks require an iterative loop rather than a single forward pass. The interviewer wants to see that you know how to ground an LLM in external tools, maintain working memory across dependent steps, and recover from unexpected observations.

A GOOD ANSWER COVERS: First, describe the ReAct loop as an interleaving of reasoning traces and actions. The LLM generates a thought about what it needs to know, then emits an action such as a tool call, receives an observation from the environment, and repeats. Second, explain state management through an append-only trajectory or scratchpad. Every thought, action, and observation is concatenated into the context window so the model has a complete working memory. Third, clarify decision making. The next action is chosen by the LLM itself based on the full trajectory and a system prompt or few-shot examples that define available tools. Fourth, address dependency handling. The agent does not pre-commit to a fixed sequence; it waits for the flight search observation before it can reason about calendar slots. Fifth, mention failure modes. If a flight is unavailable, the reasoning trace updates and the agent selects a different action.

COMMON WRONG ANSWERS: Proposing a static DAG or workflow engine that locks in all tool calls before execution. Treating tool use as a single batch of parallel function calls. Storing state only in external variables without feeding observations back into the LLM context. Assuming the LLM plans the entire itinerary in one shot without grounding in live data.

LIKELY FOLLOW-UPS: How do you prevent an infinite loop or runaway context window? What happens when the observation is too large to fit in the prompt? How would you add human-in-the-loop approval for expensive actions like booking? Can you compare ReAct with plan and execute or tree of thought approaches?

ONE CONCRETE EXAMPLE: For the San Francisco trip, the agent first thinks it needs flight options and emits a search_flights action. The observation returns three itineraries. The next thought reasons about price and timing, then emits a select_flight action. After confirmation, the agent thinks about calendar availability and calls add_to_calendar. If the flight search returns no results, the thought updates to consider different dates, and the next action is another search. The trajectory at every step includes the prior thoughts and observations so the model never loses context.

Source: research.google

Read the original → research.google

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.