The same language model can behave like four different agents depending on the agent framework around it. A source-code review of four open-source frameworks, Pi, OpenCode, Hermes and OpenClaw, shows how far their designs diverge on memory, tools and background behavior.
The review used a snapshot of each project and a small educational baseline called TinyAgent, written in Python for the book An Illustrated Guide to AI Agents. Since these frameworks change quickly, the comparison reflects a specific point in time.
What a framework does
An LLM on its own turns tokens into tokens and keeps no state. The framework is everything else: it builds prompts, runs tools, stores sessions and enforces guardrails. The model plus the framework is the agent.
All four frameworks share a coding core that reads, edits and executes code. Hermes and OpenClaw add a personal assistant layer with chat connectors such as Slack, personal memory and scheduled wake-ups. Every one of them also runs the same ReAct loop from 2022: the model reasons, calls a tool and observes the result, then repeats until it can answer. TinyAgent fits that loop in under twenty lines and the whole framework in about 600.

Pi: the minimal one
Pi’s agent framework has a little over 100,000 lines of code, runs in the terminal with no server and ships four tools: read, write, edit and bash. Its edit tool changes a single line instead of rewriting a file.
When the context window reaches 184,000 tokens, Pi compacts it. Older turns are summarized by an LLM while the latest 20,000 tokens stay untouched. Sessions are saved as JSONL linked by id and parent pointers, so a user can revert to an earlier turn and branch, much as with git. Long output such as a pytest log is stored locally, and only the last 2,000 lines plus the file path go back to the model. Users can also steer a running agent, which injects a message before the next model call.

OpenCode: a shared server
OpenCode is about Pi’s size but puts an HTTP server in front of the agent. Terminal and desktop clients share one SQLite session database, so closing the terminal does not stop the work. Each step reads history from the database, runs one model pass and saves the result.
Its Code Mode lets the model write one short script that chains several tool calls, a pattern called CodeAct. Plan Mode is simple: the loop stays the same, but the edit tool is blocked for everything except plan.md. For read-style tasks like grep and glob, OpenCode hands the work to a subagent that returns only a summary and discards the rest of its context.

Hermes: learning from sessions
Hermes adds a chat gateway for apps such as Slack and WhatsApp, more than 50 tools and more than 50 built-in skills. Only each skill’s short YAML header is loaded until the agent asks for the full text.
Memory is split into two markdown files. MEMORY.md holds environment facts and technical lessons, and USER.md holds the user’s role, habits and preferences. After a session that used more than 10 tool calls, a review agent decides whether the pattern should become a new skill or update an old one. Hermes can also run subagents in parallel and merge their summaries.
OpenClaw: always on
OpenClaw is the largest of the four, with over 30 chat channels. It keeps personal direct messages in a Main Session and group chats in separate Group Sessions so private content does not leak into groups.
Its best-known feature is the heartbeat, a 30-minute trigger that wakes the agent to check for new messages or tasks, guided by a HEARTBEAT.md file. If nothing needs doing, it stays quiet. Before compaction it writes a memory flush to disk, and it searches memory with a hybrid of BM25 and embeddings, a 30-day recency decay and Maximal Marginal Relevance to rerank. Each night, a process called Scheduled Dreaming scores daily logs (light), extracts facts (deep) and saves them to MEMORY.md (REM).
How they compare
Before a user types anything, each framework has already filled part of the context window. Hermes and OpenClaw spend similar token counts for different reasons: Hermes loads 21 default tool schemas, while OpenClaw exposes 7 core tools and spends its budget on workspace files such as SOUL.md and MEMORY.md. Hermes compacts earliest. For session storage, OpenCode uses a database and OpenClaw uses daily files.
The right agent framework depends on the job. A terminal-only coding workflow suits Pi. Work that moves between clients suits OpenCode. An assistant that learns preferences points to Hermes, and one that stays on across many chat apps points to OpenClaw.
Where framework design is heading
Several of the simplest tricks, such as blocking the edit tool in plan mode, work because models are capable enough that elaborate machinery is less necessary. The framework does not change the model. It decides what the model can touch and remember. The author plans to refresh the guide as the projects change.