ai / agents

An agent is a software program that runs tools in a loop to achieve a goal. I state the goal.

The loop

One pass through the loop is a turn. In a turn, the model reads the context and then replies or calls a tool. A tool call runs outside the model: a web search, a shell command, a file edit, or a screenshot. The result goes into the context, and the next turn starts. The loop stops when the model replies without a tool call, or when the harness stops it.

user: check test status
model calls tool: go test ./...
tool result: ok github.com/croaky/blog 0.5s
model replies: All tests pass.

The parts

Each layer is a separate decision. I change them at different rates.

The same layers exist when my application calls a model. See ai / api. The MCP server I run is on that side: it gives a chat client tools, not my terminal.

Parallel agents

I run several agents at once in separate harness tabs, each in its own git worktree. Each worktree gets its own port and database, so the agents do not collide.

# tab 1
cd ~/.worktrees/app/APP-1A && PORT=3001 go run .

# tab 2
cd ~/.worktrees/app/APP-2B && PORT=3002 go run .

← All articles