How does an AI agent answer with no tools (ReAct, version 2, reason only)?
The previous note built an agent that thinks, acts and observes. This note removes two of the three steps. No action, no observation — the model can only think, in the style known as chain-of-thought, and then answer from its own memory. Nothing it says is checked against the real world. The question it faces is deliberately awkward: “When did Mark launch Muse?”
The script
This is ReAct02.py as it stands:
# "Reason only" (Chain-of-Thought): NO tool and NO loop.
# The model can only THINK step by step and answer from its own memory.
# Nothing is checked against the real world, so the answer may be wrong (hallucination).
# Compare the result with react03.py (Reason + Act), which searches the web with Tavily.
import os
from openai import OpenAI
from dotenv import load_dotenv
load_dotenv()
client = OpenAI(
api_key=os.environ.get('DEEPSEEK_API_KEY'),
base_url="https://api.deepseek.com")
def ask(prompt):
"""Send one prompt to the model and return its text reply."""
response = client.chat.completions.create(
model="deepseek-flash",
messages=[{"role": "user", "content": prompt}],
)
return response.choices[0].message.content
task = ("When did Mark launch Muse")
# ---- THINK only (Reasoning) — no Action, no Observation ----
prompt = f"""Task: {task}
You have NO tools. Think step-by-step using only what you already know,
then end with one line: Answer: <your answer>"""
reply = ask(prompt)
print("=== Thought (reasoning trace, no tools) ===")
print(reply)
What each part does
-
The DeepSeek client and
ask()are exactly the same as in the previous note: one key from a.envfile, one helper that sends a prompt and returns the reply. - The task names no surname and no product category. “Mark” could be Mark Zuckerberg; “Muse” could be the band, an app, or nothing at all. A good answer requires facts the model almost certainly does not have.
-
The prompt forbids tools. It tells the model to think
step-by-step using only what it already knows, and to finish with one line
beginning
Answer:. That is the whole program: one call, one print.
One real run
=== Thought (reasoning trace, no tools) ===
Mark Zuckerberg launched Muse? I don't have knowledge of Mark launching something called Muse. There is a band Muse, but not launched by Mark. Perhaps you mean Meta's AI model? I'm not aware.
Answer: I don't know.
Two things are worth noticing. First, the reasoning is genuinely useful: the model spots the ambiguity (“There is a band Muse, but not launched by Mark”) instead of pretending the question is clear. Second, the final answer is honest — this time. Nothing in the program forces honesty. Ask a question that sounds more ordinary, and the same memory-only reasoning can produce a confident, fluent, wrong answer: a hallucination. There is no observation step to catch it.
Running it on your own computer
Download the demo program
(Folder-AI-ReAct02.zip). The zip holds three files:
ReAct02.py (the script above), pyproject.toml (the
package list) and README.md.
- Open the folder in Visual Studio Code.
-
Create a file named
.envin the folder with one line:
Get a key from the DeepSeek console; new accounts come with trial credit.DEEPSEEK_API_KEY=your-key-here - In the Terminal, run:
uv sync uv run ReAct02.pyuv syncis needed only the first time; it readspyproject.tomland installsopenaiandpython-dotenvinto the project.
Try changing the task to a question with a well-known answer, and then to one about a small local company. The contrast between the two runs is the lesson.
Why this experiment matters
- Reasoning is not knowledge. Step-by-step thinking improves how the model uses what it knows; it cannot supply what it never knew.
- Honesty is luck, not design. “I don't know” was the model's choice here, not a guarantee. Only an observation step can make an answer dependable.
- It sets up the comparison. The next note in this series adds one tool — a web search — and asks the same kind of question again, so you can see exactly what acting changes.
Further reading
- ReAct: Synergizing Reasoning and Acting in Language Models — the paper that named the pattern this series builds.
- DeepSeek API documentation — models, keys and pricing.