Agentic Workflows and AI Agents
Learn the principles of autonomous AI Agents, the ReAct framework, and LLM tool calling loops.
What are AI Agents?
An AI Agent is an autonomous entity that uses an LLM as its "brain" to reason, plan, select tools, and interact with external environments to achieve a specific goal.
Unlike static chains, agents run in a loop: they receive a task, decide on an action, invoke a tool (like a calculator, web search, or database query), inspect the tool's output, and repeat this process until the goal is achieved.
The ReAct (Reason + Action) Pattern
ReAct combines reasoning and actions in a structured, step-by-step loop:
- Thought: LLM reasons about the current state ("I need to find Alice's age").
- Action: LLM decides to call a tool ("SearchDatabase(Alice)").
- Observation: The tool outputs data ("Alice is 24").
- Repeat: The agent continues reasoning based on this new observation.
ReAct Agent Execution Loop Example
Thought: The user wants to know the square root of their age. Action: GetUserAge("user123") Observation: 25
Thought: I have the age (25). Now I need to calculate the square root. Action: Calculator("sqrt(25)") Observation: 5
Thought: The calculations are complete. The answer is 5. Final Answer: Your age is 25, and the square root is 5.