Sitemap

Beyond OpenClaw: Building Autonomous Agents with iCoT and Go-Based Workflows

7 min readFeb 28, 2026

--

Learn how to architect high-performance AI Agents using Interactive Chain-of-Thought (iCoT) and Arazzo

Press enter or click to view image in full size

Introduction: The Agentic Revolution

The AI industry is rapidly moving past the era of simple chatbots and into the era of agents. In the early days of Generative AI, models were primarily used for passive text completion. Today, an agent doesn’t just tell you about products; it finds them, verifies specifications, and prepares the transaction.

To transform a Large Language Model (LLM) into a functional digital worker capable of interacting with external systems, we require more than a chat interface — we require structured reasoning and Agentic Tool-Use. This transition happens in three distinct phases.

Phase 1: Interactive Reasoning (The Thinking Layer)

Standard AI responses often suffer from jumping to conclusions, which can lead to logic errors and failed API calls. The solution is iCot.

From CoT to iCoT

  • Chain-of-Thought (CoT): This reasoning solves logic jumps by forcing the model to generate a reasoning trace — a sequence of intermediate logical steps that break a complex problem into smaller parts. It provides a scratchpad for the model to process information before committing to a final answer.
  • Interactive Chain-of-Thought (iCoT): Standard AI logic often fails on common sense traps. While standard CoT happens in a single thought, iCoT involves the user in the reasoning loop. In scenarios like online shopping, the AI uses a Challenge-Response loop to fill slots.

The Approach: Challenge and Refinement

  • The Challenge Mechanism: Instead of guessing your needs, the AI identifies missing information (e.g., I need a store name) and pauses the reasoning trace to challenge the user.
  • The Slot-Filling Process: This refinement loop turns a vague natural language request (I want shoes) into a precise set of parameters Amazon, Size 10, Running, Black.

By the time the iCoT process is complete, the AI has successfully generated a structured intent, usually formatted in JSON or YAML.

Example: The Interactive Reasoning Trace & Data Workflow

User: I want to buy shoes online.
AI: Missing Information: Store preference. Action: Challenge user.
Response: Which online store would you like to use? (e.g., Amazon, Walmart)
User: Amazon. Running shoes, size 10, black, under $100.
AI: Mapping this directly to a JSON payload ready for the API.

At the end of the trace, the agent produces a record ready for a system like the Amazon Product Advertising API:

{
"intent": "PRODUCT_SEARCH",
"provider": "amazon",
"parameters": {
"keywords": "black running shoes",
"size": "10",
"max_price": 100
},
"status": "VERIFIED_BY_USER"
}

Phase 2: The Orchestration Layer (The Switchboard)

When we combine iCoT with the ability to call external APIs, we create an Agentic Workflow. This requires an orchestration layer to manage the hand-off from AI-reasoning to hard-coded API execution. This layer acts as a switchboard that receives the JSON Intent and decides the execution path.

The Approach: Why Go (Golang)?

While Python is great for experiments, Go is the engine for production agents. For developers prioritizing performance, Go is the industry gold standard due to two key features:

  1. Concurrency: Go’s goroutines can handle thousands of simultaneous shopping sessions with minimal overhead.
  2. Strict Typing: Go’s structs ensure that the data returned from an LLM matches the exact requirements of a merchant API before the call is even made.

The open-source ecosystem features several key frameworks for Go:

  • LangGraph Go: Best for stateful loops where the agent might need to Time Travel back to a previous step if a product is out of stock.
  • AgenticGoKit: Best for high-performance tool-calling where the agent needs to verify prices across multiple providers simultaneously using Go Routines.
  • Arazzo: I am working on this new solution. See Why Arazzo is Ideal for Your Layers? below.

Demo:

Build a tool-aware agent that knows when to ask and when to execute.

package main
import (
"context"
"fmt"
"://github.com"
)
func main() {
ctx := context.Background()
// Define a Tool for Price Lookup
priceTool := v1beta.NewTool("GetProductPrice", "Fetches shoe prices",
func(args map[string]interface{}) (interface{}, error) {
model := args["model"].(string)
return fmt.Sprintf("The price for %s is $89.99", model), nil
},
)
// Build the Agent
agent, _ := v1beta.NewBuilder("SalesAgent").
WithConfig(&v1beta.Config{
SystemPrompt: "If a user asks for a price but doesn't specify a model, ask them for one.",
LLM: v1beta.LLMConfig{Provider: "ollama", Model: "gemma2"},
}).
WithTool(priceTool).
Build()
// Run Workflow: The agent will see "black shoes" is too vague and ask for a model.
result, _ := agent.Run(ctx, "How much are those black running shoes?")
fmt.Println("AI Response:", result.Content)
}

Phase 3: APIs vs. Browser Agents (The Acting Layer)

Once the orchestration layer processes the intent, the Agent must interface with the real world. There are two primary technical paths — the Engine and the Operator — to turn that intent into a finished purchase.

Approach A, Deterministic: The API-First Engine

This approach treats the AI as a translator. The AI converts the user’s intent into a specific HTTP REST call to an OpenAPI endpoint (like Walmart or Shopify).

  • How it works: You feed the OpenAPI spec to a framework like Arazzo.
  • Execution: As soon as the intent is clear, the AI hands off the task to a compiled Go client.
  • Traits: Because it is deterministic, code-based execution doesn’t hallucinate orders. It is ultra-fast (milliseconds) and boasts zero token cost after the initial intent extraction.

Approach B, Probabilistic: The Universal Browser Operator

Get Peter Bi’s stories in your inbox

Join Medium for free to get updates from this writer.

Applications like Manus AI, OpenClaw, MultiOn, and Skyvern represent a more advanced category called Large Action Models (LAMs) or Universal Web Agents. They treat the AI as a human operator sitting at a computer.

  • The Vision/DOM Parser: Instead of reading an API spec, they use browser automation tools like Playwright or Puppeteer to literally look at the website’s HTML or pixels. OpenClaw converts a complex website into a simplified text map using an Accessibility Tree or DOM-to-Text conversion.
  • Recursive Loops: They use an aggressive version of CoT: Observe (I am on the Amazon homepage) ➔ Reason (I need to find the search bar) ➔ Act (Click on nav-search-bar) ➔ Repeat until the final intent is reached.
  • Tool-Use: Instead of calling a POST /order endpoint, their tools are click(selector), type(text, selector), scroll(direction), and wait_for_navigation().

Why Arazzo is Ideal for Your Layers?

I am working on a solution of the Phase 2 and 3 layers based on Arazzo Specification. It directly addresses the missing link in agentic workflows: deterministic multi-step logic.

While OpenAPI describes individual LEGO bricks (endpoints), Arazzo describes how to build the castle, as sequence of calls needed to complete a task.

  • Orchestration Layer: Instead of the AI guessing which API to call next, the Arazzo Workflow Engine provides a proven roadmap. It defines dependencies, data mappings, and success criteria.
  • Action Layer: It transforms atomic API tools into capability-based tools. Rather than exposing 50 individual endpoints to an LLM, you expose one Arazzo workflow like PurchaseItem. This drastically reduces token usage and hallucination rates because the LLM no longer has to think through the intermediate API plumbing.

The shift from simple prompting to Agentic Workflows represents the transition of AI from a passive knowledge base to an active digital worker. By utilizing Interactive Chain-of-Thought and performant languages like Go, developers can build systems that are not only smarter but also more transparent and reliable.

Performance Comparison: Engine vs. Operator

The API-first approach is like a surgeon using specialized tools, while the Browser approach is like a human sitting at a computer. The choice depends on your requirement for scale versus flexibility.

1. The API-First Approach (Go + Arazzo)

  • Interface: Structured Data (JSON/REST)
  • Reliability: 100% Deterministic. If the JSON is right, the order is placed.
  • Speed: Milliseconds. Direct server-to-server communication.
  • Token Cost: Ultra-Low. You only pay for the initial intent extraction.
  • Scope & Setup: High Setup / Limited Scope. Requires API keys and documentation.
  • Maintenance: Update code when the API documentation changes.

2. The Browser-First Approach (Manus / OpenClaw)

  • Interface: Visual Elements (HTML/DOM/Pixels)
  • Reliability: Probabilistic. A UI change or a pop-up can break the flow.
  • Speed: Seconds/Minutes. The AI must wait for pages to load and think.
  • Token Cost: High. You pay for tokens/images for every click and scroll.
  • Scope & Setup: Low Setup / Infinite Scope. Works on any website without an API.
  • Maintenance: Update prompts when the website UI changes.

Conclusion & Future Outlook

The execution layer is rapidly standardizing. We are currently seeing major standards emerge, such as Anthropic’s Model Context Protocol (MCP) connecting agents to any resource, and the Operator Pattern racing to define the universal schema for how an AI clicks a button. Ultimately, the future of Agentic AI is a hybrid one.

The Golden Rule: Use the API when you can; use the Browser when you must.

  • For B2B and High-Volume Commerce: The API-First Engine is superior. It is very efficient, 100% reliable and trackable, and zero cost.
  • For Personal Assistants and One-Off Tasks: The Browser Approach wins. If you need a universal assistant to navigate a site without an API, its visual flexibility makes it the ultimate tool.

If you are building a tool for the masses to use flexibly on any website, look at OpenClaw. If you are building a reliable commerce engine, the path is clear: Natural Language Intent ➔ Go Orchestrator ➔ OpenAPI Endpoint.

TL;DR: The Agentic Revolution

  • The Problem: Standard LLMs jump to conclusions, leading to logic errors and failed API calls.
  • The Solution (Thinking): Interactive Chain-of-Thought (iCoT) creates a Reasoning Trace that pauses to challenge the user for missing data (size, store, budget) before acting.
  • The Engine (Doing): We move from Chatting to Executing using Agentic Workflows built in Go for maximum performance and type safety.
  • The Choice:
    - API-First (The Engine):
    Fast, no token cost, and 100% reliable. Use Arazzo to connect directly to OpenAPI endpoints.
    - Browser-First (The Operator): Flexible but expensive. Use tools like Manus AI or OpenClaw to navigate websites visually when no API exists.
    - The Verdict: Build your Thinking with iCoT and your Doing with Go + APIs for the most scalable, production-ready AI Agents.

--

--