Describe a basic ReAct / agent loop.
medium- 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.