An AI agent is an autonomous system that perceives its environment, reasons using an LLM, takes actions through tools, and iterates until a goal is achieved — going far beyond simple question-answering.
# Agent vs LLM call
# LLM call: prompt -> response (one shot)
# Agent: goal -> [think -> act -> observe] * N -> result
# Simple ReAct loop
while not done:
thought = llm.think(goal, history, observations)
action = llm.decide_action(thought)
result = execute_tool(action)
observations.append(result)
done = llm.check_if_complete(result)