Describe a basic ReAct / agent loop.
mediumAnswer
- Loop: (1) LLM receives system prompt + user goal + tool schemas + previous steps.
- (2) LLM decides between: emit a (name + arguments), or emit a final response.
- (3) If : execute the tool (calculator, search, code exec, HTTP fetch), append result to context, go back to step 1.
- (4) Terminate when LLM emits a final response, or on .
- ReAct (Yao 2022) formalized 'reason + act' interleaving.
- Modern implementations: OpenAI tool calling, LangGraph, LlamaIndex agents, CrewAI.
Check yourself — multiple choice
- One-shot response
- Loop: LLM reasons + emits → runtime executes → appends result → LLM reasons again → terminates on final answer or limit
- Only for chat
- No looping
Agent loop: reason → → execute → append → repeat; terminate on final answer or limit.
#agents#tools#function-calling
Practise LLMs & GenAI
214 interview questions in this topic.
Related questions
- How does function calling / tool use work in modern LLMs?
- What does an ideal function-calling schema look like?
- How should you write tool descriptions for reliable agent tool selection?
- How do you scale to hundreds of tools without overwhelming the LLM?
- How does a coding agent (SWE-agent, Aider, Cursor) actually work?
- How do parallel tool calls work?