ReAct Architecture

Reasoning + Acting in AI Agents — Ori Case Study

flowchart TB subgraph User["👤 User (WhatsApp)"] MSG[Message: 'what coffee options do you have?'] end subgraph OC["⚙️ OpenClaw Framework"] RECV[Receive Message] CTX[Inject Context
system prompt, skills, memory] EXEC[Execute Tool Call] FEED[Feed Result Back] SEND[Send Response] end subgraph LLM["🧠 Claude (LLM)"] PARSE[Parse Intent] REASON1[Think: need product info] DECIDE[Select Tool: read buy-coffee skill] REASON2[Think: interpret results] GEN[Generate Response] end subgraph TOOLS["🔧 Tools"] SKILL[read SKILL.md] WEB[web_fetch] SHELL[exec commands] end MSG --> RECV RECV --> CTX CTX --> PARSE PARSE --> REASON1 REASON1 --> DECIDE DECIDE --> EXEC EXEC --> SKILL SKILL --> FEED FEED --> REASON2 REASON2 --> GEN GEN --> SEND SEND --> |Response| User style User fill:#1a1a2e,stroke:#00ff88 style OC fill:#16213e,stroke:#4ecdc4 style LLM fill:#1a1a2e,stroke:#ff6b6b style TOOLS fill:#0d1117,stroke:#00d9ff

The ReAct Loop — Step by Step

1

Observe

OpenClaw receives your WhatsApp message, injects context (system prompt, available tools, memory), and passes it to Claude.

2

Think

Claude reasons: "User wants coffee options. I have a buy-coffee skill. I should read it to get product info."

3

Act

Claude outputs a tool call. OpenClaw executes it: read ~/.openclaw/workspace/skills/buy-coffee/SKILL.md

4

Observe (again)

OpenClaw feeds the file contents back to Claude. Now Claude sees the product list.

5

Think + Respond

Claude reasons: "I have the info. No more tools needed." Generates human response with the three coffee blends.

Component Responsibilities

🧠 Claude (Model)

  • Semantic understanding of requests
  • Deciding which tool fits intent
  • Reasoning about access control
  • Interpreting tool results
  • Generating natural responses

⚙️ OpenClaw (Framework)

  • Message routing (WhatsApp, Telegram, etc.)
  • Tool execution (files, shell, APIs)
  • Context injection (skills, memory)
  • Managing the ReAct loop
  • Security & access control config

Live Example: "Buy me coffee"

USER: buy me coffee

THINK: JG is asking for coffee. I have buy-coffee skill.

THINK: But wait — who's asking? JG, not Austin (owner).

THINK: This spends Austin's wallet. Access control: owner-only.

ACT: None — reasoning terminated before tool call

RESPOND: "nice try lol. that's austin's wallet..."

↑ The reasoning layer intercepted the request before any irreversible action. That's the power of ReAct.

Key Insight

ReAct's value is interleaved thinking and doing. The model doesn't just execute blindly — it reasons at each step, can course-correct, and knows when not to act. This makes it safer and more reliable than pure action-based agents.