Skip to main content

Loading the visual lab…

#react-loopAgentic AI

An agent's ReAct loop: Thought → Action → Observation, live.

What you'll play with

  1. Welcome to #react-loop. An agent is not an LLM that answers — it is an LLM you run in a loop: ThoughtAction (tool call) → Observation (tool result) → new Thought, until it can answer. That is the ReAct loop. In the middle, the LLM (large bubble); around it, six tools it can call (file, calc, web, shell, db, search). You will run the loop in slow motion, one step at a time.
  2. Set a goal for the agent. Default scenario: read config.json and return its contents. Type /goal Read config.json and return its contents — or keep the default and move on to the next step.
  3. One step. Type /step: the LLM will think (the banner turns pink), no action yet. This explicit reasoning phase is what makes the agent robust — without it, it chains actions blindly.
  4. /step again. This time the agent acts: a ray leaves the LLM towards the file tool, the tool lights up, and the tutor prints the exact call (tool name + arguments).
  5. /step once more. The tool returns its result: this is the Observation. A ray comes back from the tool to the LLM, the central bubble ingests the info, and the tutor prints the received JSON.
  6. Instead of stepping, run the loop to completion: /run. You will see the agent alternate Thoughts and Actions until it produces a Final answer (green banner).
  7. A richer scenario: /scenario multi. The agent must read a file, count the words, search a keyword online. Watch it chain three different tools.
  8. Kick it off: /run. Count the iterations, watch which tools light up, which observations come back.
  9. Your turn. Try /scenario calc then /run (two-step arithmetic), or /max 3 then /scenario multi and /run to see a failure from the iteration cap. Next, #tool-calling (function calling, MCP — free) breaks down the mechanics of a call; the Premium channels #slash-commands (Claude Code / Cursor), #planning-reflection and #multi-agents each climb one notch.

Channel commands

  • /goal <text>Sets the goal the agent must reach.
  • /scenario <search|calc|multi>Loads a ready-made scenario (deterministic trace).
  • /stepAdvances one event (Thought, Action or Observation).
  • /runLoops the agent until the answer (or failure).
  • /max <n=3..15>Sets the iteration cap (anti-loop safeguard).
  • /resetResets the loop (the current scenario stays).

Glossary

ReAct loop
Orchestration pattern where the LLM alternates Thoughts (natural-language reasoning) and Actions (tool calls); each action returns an Observation that feeds the next Thought. Shared foundation of Claude Code, Cursor, LangChain, AutoGen — the seminal paper is ReAct: Synergizing Reasoning and Acting in Language Models (Yao et al., 2023).
tool call
The LLM emits a structured JSON that names a tool (function) and its arguments. The runtime actually executes the function and returns the result to the LLM as an observation. Standardised by OpenAI (tools), Anthropic (tool use) and by the open MCP protocol.
observation
Return value from a tool (string, JSON, error) that the LLM re-reads on the next iteration. Often truncated to fit the context window — that is where a channel like #context-memory (Premium) becomes precious.
iteration
One pass Thought → Action → Observation. A useful agent runs 3 to 20 iterations depending on the task. A max cap is essential to avoid infinite loops (an agent that repeats the same action or gets lost in Thoughts).
MCP
Open protocol (Anthropic, 2024) that standardises how an LLM calls tools exposed by a server — files, git, database, web… Cursor, Claude Code and Claude Desktop all consume MCP servers. Detailed in #tool-calling (free) and #slash-commands (Premium).
slash command
Shortcut like /plan, /review, /test that triggers a pre-written prompt or a mini agent workflow. Claude Code and Cursor ship native ones and let users define their own. The #slash-commands channel (Premium) shows how to design and chain them.
iteration cap
Maximum number of turns allowed before stopping the agent. It is the minimum production safeguard: a looping agent is expensive (each turn = 1 LLM call) and holds up a waiting user. Type /max 3 then /scenario multi to see it fire.
trace
Full history of Thoughts + Actions + Observations for a run. Essential for debugging (understanding why the agent took a given path) and for production observability (LangSmith, Braintrust, Arize…).

Other channels in Agentic AI

  • #react-loopAn agent's ReAct loop: Thought → Action → Observation, live.
  • #tool-callingTool calling (function calling / MCP): the JSON that makes the LLM act.
  • #slash-commandsSlash commands, Claude Code / Cursor style: templates, arguments, chaining.
  • #context-memoryContext window and agent memory: count, truncate, summarize, index.
  • #planning-reflectionPlanning, reflection and self-correction: from 60% to 90% success.
  • #multi-agentsMulti-agents: planner, workers, verifier. A DAG that beats the monolithic agent.