The reasoning gap

Your SimpleAgent can have conversations, but it cannot do anything useful in the real world. It cannot check the weather, do math reliably, or look up data. LLMs generate text but do not execute code or call APIs.

02-react-pattern.ipynb
python
# Ask the LLM to do math + real data
response = completion(
    model=DEFAULT_MODEL,
    messages=[{
        "role": "user",
        "content": "What is the temperature in Tokyo multiplied by 2?"
    }]
)
print(response.choices[0].message.content)
# The LLM will GUESS because it cannot actually check weather or calculate

The LLM makes up an answer because it cannot access real weather data or do reliable math.

LLMs predict the next token and do not execute mathematical operations. When you ask "what is 847 * 293?", the model guesses based on patterns, not computation. For reliable math, you need Python. For real data, you need APIs. The solution: give the agent tools.

LLM limitations vs agent capabilities

LLMs alone can only generate text. Agents extend LLMs with tools to interact with the real world.

Quiz: Quiz

Loading practice…

So how do we give an LLM the ability to use tools? The answer is a pattern called ReAct (Reason + Act). It teaches the agent to think step by step, decide which tool to use, observe the result, and continue reasoning.