Agents didn’t appear out of nowhere. They’re more like the natural result of Prompt Engineering steadily “stacking capabilities.” Before Agents, we mainly relied on prompts to get LLMs to complete complex tasks more reliably. The evolution roughly went through the following stages:
0) Role: The earliest form of “role setting”
The most classic and earliest prompting approach was Role Prompt:
“You are a senior product manager / You are a senior SRE / You are a code review expert...”
Its purpose is to give the model a behavioral boundary and output style, so its answers fit the domain context better, for example:
- A more professional tone
- Output structure that matches industry conventions
- A stronger tendency to focus on that role’s concerns (risks, boundaries, metrics, etc.)
Limitation: Role only changes “how it speaks and what it prefers.” It doesn’t actually improve factual reliability or execution capability.
1) Step by Step: Make the model think in explicit steps
A commonly used follow-up was:
“Please think step by step / Step by step”
It can significantly improve completion rates on complex tasks: the model breaks the problem down before answering, reducing skipped-step errors.
2) Few-shot: Teach the model the “playbook” with examples
Few-shot prompting provides a few examples (input → output) so the model can learn:
- Output format (such as JSON / tables)
- Solution patterns (such as comparison, classification, summarization)
- Task boundaries (what should be output and what shouldn’t)
3) Thinking: From “answers” to “reasoning process”
Going a step further, we wanted the model to provide not just a conclusion but also its reasoning / thinking:
- Make complex tasks more stable
- Make debugging easier (know why it did what it did)
4) ReAct: Combine “reasoning” and “acting”
ReAct (Reason + Act) was the key leap from prompts to Agents:
- Reason: decide what to do next
- Act: call tools (search, databases, APIs) and get results
This turned LLMs from “able to reason” into “able to execute.”
5) Agent: Multi-step loops + tools + state
When ReAct is combined with:
- Multiple rounds of looping (Plan-Act-Observe)
- State/memory (Memory)
- Failure retries and validation
it forms what we now call an Agent.
Figure: The evolution path from Prompt Engineering to Agents

Summary (can serve as an optional closing)
From Role to Step-by-step, Few-shot, and Thinking, the essence is strengthening the LLM’s “quality of expression and stability of reasoning.” Starting with ReAct, the model is given “the ability to act.” Add loops and state management on top, and it naturally evolves into an Agent system.