AI

A Visual Guide to Agent Harnesses: Frameworks Compared

Maarten Grootendorst published a visual guide exploring agent harnesses like Pi, OpenCode, Hermes, and OpenClaw through custom visualizations.

·2 min read
A Visual Guide to Agent Harnesses: Frameworks Compared

Maarten Grootendorst has released a comprehensive visual guide examining agent harnesses such as Pi, OpenCode, Hermes, and OpenClaw. By diving into the source code and creating over 30 custom visualizations, the guide explores how these frameworks operate from the ground up.

What is an Agent Harness and Why It Matters

By itself, a large language model is merely a text-in to text-out machine that reads and generates tokens. To transform it into an agent capable of interacting with the environment, developers augment the LLM with memory, tools, and execution logic, which together form the agent harness.

The model itself remains stateless and does not remember past interactions. The surrounding harness handles prompt generation, tool execution, session storage, and guardrails. This boundary explains why the harness heavily influences the final output alongside the model choice.

Read alsoHow to build an AI agent for enterprise platforms and why LLMs fail

From Educational TinyAgent to Production Frameworks

Starting from the educational baseline, TinyAgent was created by the author for their book to demonstrate the core loop in about 600 lines of Python code. It highlights the ReAct reasoning and acting loop that remains foundational across all modern agent frameworks.

Production-grade frameworks are significantly larger to handle multi-session states, advanced memory systems, and guardrails. While Pi and OpenCode maintain moderately sized codebases, frameworks like OpenClaw grow much larger due to extensive chat connectors and integrations.

Framework Breakdown: Pi and Core Capabilities

Pi is described as a minimal, extensible agent harness running directly in the terminal without a server. When token limits approach during coding sessions, Pi utilizes context compaction, summarizing older conversation turns via an LLM while keeping recent tokens intact.

Unlike basic scripts, production harnesses persist conversation turns using JSONL with pointer links, enabling developers to easily revert to earlier turns and explore alternative branches during execution.

Implications for AI Developers

This visual guide provides critical clarity on the internal mechanics of autonomous agent frameworks. Understanding how different harnesses manage memory, tools, and context helps developers select the right architecture for robust AI applications.

Source: Hacker News: Front Page

Related articles