0
0
Prompt Engineering / GenAIml~6 mins

Agent architecture (observe, think, act) in Prompt Engineering / GenAI - Full Explanation

Choose your learning style9 modes available
Introduction
Imagine a robot trying to complete a task in a room. It needs a way to notice what is around it, decide what to do, and then take action. This process helps the robot work step-by-step to achieve its goal.
Explanation
Observe
The agent first gathers information from its surroundings using sensors or inputs. This step is about noticing what is happening around it, like seeing objects or hearing sounds. The quality of observation affects how well the agent understands the situation.
Observation is how the agent collects data from the environment to understand what is going on.
Think
After observing, the agent processes the information to make decisions. This involves analyzing the data, considering possible actions, and choosing the best one based on its goals. Thinking can be simple rules or complex reasoning depending on the agent's design.
Thinking is the decision-making step where the agent plans what to do next.
Act
Finally, the agent performs an action to affect the environment. This could be moving, speaking, or changing something in the surroundings. Acting is how the agent interacts with the world to achieve its objectives.
Acting is the step where the agent carries out its chosen action to influence the environment.
Real World Analogy

Imagine a person crossing a busy street. They first look both ways to see if cars are coming (observe). Then, they decide when it is safe to cross (think). Finally, they walk across the street (act).

Observe → Looking both ways before crossing the street
Think → Deciding when it is safe to cross
Act → Walking across the street
Diagram
Diagram
┌─────────┐    ┌────────┐    ┌───────┐
│ Observe │ → │ Think  │ → │ Act   │
└─────────┘    └────────┘    └───────┘
This diagram shows the flow from observing the environment, thinking about the information, and then acting based on the decision.
Key Facts
AgentAn entity that perceives its environment and takes actions to achieve goals.
ObserveThe process of collecting data from the environment.
ThinkThe process of analyzing information and deciding on an action.
ActThe process of performing an action to affect the environment.
Feedback loopThe cycle of observing, thinking, and acting repeatedly.
Common Confusions
Thinking happens before observing.
Thinking happens before observing. The agent must first observe to gather information before it can think and decide.
Acting means random movement.
Acting means random movement. Acting is a purposeful step based on the agent's decision to reach its goal.
Summary
An agent works by observing its environment, thinking about what it sees, and then acting to achieve its goals.
Observation collects data, thinking decides the best action, and acting carries out that action.
This cycle repeats to allow the agent to respond to changes and continue working effectively.