Module 2 · Lesson 1 — The ReAct Pattern: How Agents Think
📌 Read time: ~6 min | Module 2 of 8
An LLM is not an agent. The loop is.
You send an LLM a question, it sends back an answer. One shot, done. That is not an agent.
An agent loops. It thinks, acts, observes what happened, then thinks again. That loop — not the LLM, not the tools — is what makes it an agent.
The pattern is called ReAct: Reason + Act.
Thought → Action → Observation → Thought → Action → ... → Final Answer
When the agent decides it has enough information, it breaks the loop. That is the whole architecture.
---
What this looks like in a real MSP ticket
Ticket: OSPF neighbor stuck in INIT state on R1.
Thought: INIT means R1 is sending Hellos but not receiving them back.
Could be area mismatch, MTU mismatch, auth, or one-way connectivity.
Check the neighbor table first.
Action: show_ospf_neighbors(device="R1")
Observation: Gi0/1 — neighbor 10.0.0.2 — State: INIT — Dead: 34
Thought: INIT confirmed on Gi0/1. Check OSPF interface config.
Action: show_ospf_interface(device="R1", interface="Gi0/1")
Observation: Area 0, Hello 10, Dead 40, MTU 1500, auth: none
Thought: R1 looks standard. Check the neighbor side.
Action: show_ospf_interface(device="R2", interface="Gi0/0")
Observation: Area 1, Hello 10, Dead 40, MTU 1500, auth: none
Thought: Area mismatch. R1 is Area 0, R2 is Area 1 on the same segment.That is the root cause.
Final Answer: OSPF INIT caused by area mismatch. R1 Gi0/1 = Area 0,
R2 Gi0/0 = Area 1. Fix: align both to the same area.
The LLM is doing the thinking. Python is doing the acting. You write the loop that connects them.
---
The system prompt — the contract with the LLM
The LLM does not magically output Thought/Action/Observation. You tell it to.
SYSTEM_PROMPT = """You are a network troubleshooting agent for an MSP.
For every problem, follow this exact format:
Thought: [your reasoning about what to check next]
Action: [tool_name]
Params: {"param": "value"}
OR if you have enough information:
Final Answer: [your diagnosis and recommended fix]
Available tools:
{tools_description}
Rules:
- Always start with a Thought.
- Never give a Final Answer before using at least one tool.
- Be specific. MSP engineers need actionable output.
"""
What this does: This is a contract between you and the LLM. It forces a structured output your Python code can parse. Without it, you get prose — useful for humans, useless for a loop.
---
👇 What's next: Lesson 2 — Tools and the Observation Loop
0
0 comments
Eduard Dulharu
1
Module 2 · Lesson 1 — The ReAct Pattern: How Agents Think
powered by
Autonomous MSP
skool.com/autonomous-msp-2162
AI-powered NOC, SOC and compliance for MSPs and IT consultancies. Built by a 25-year enterprise network practitioner.