C.W.K.
Stream
Lesson 01 of 05 · published

Chatbot vs Agent: Text Engine or Action System

~22 min · agent-loop, autonomy, tools

Level 0Observer
0 XP0/40 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

The boundary is action

A chatbot answers. An agent changes state. That state might be a file, a ticket, a database row, a browser page, a queued job, or a plan that survives multiple turns. The model is still generating tokens, but the surrounding system converts some of those tokens into actions.

This is why an agent is not defined by which model it uses. Claude, GPT, Gemini, or a local model can all sit behind the same agent loop. The architecture is the important thing: observe the world, decide what to do, act through a tool, observe the result, and repeat until a stop condition fires.

The minimum contract

  • Goal: what outcome the agent is trying to produce.
  • Model: the reasoning engine that chooses the next move.
  • Tools: functions or hosted capabilities that can affect the outside world.
  • State: conversation, scratchpad, memory, and run metadata.
  • Policy: limits, permissions, approval rules, and stop conditions.

Miss one of those pieces and the system becomes a fancy prompt, not an agent. The embarrassing part is that a lot of products call everything an agent now. Don’t inherit marketing vocabulary. Inspect the loop.

Agency is bounded autonomy

Good agents are autonomous inside a boundary, not magically independent. You decide what they can see, which tools they can call, how much they can spend, how long they can run, and when they must stop for human approval.

That boundary is the product. A risky email-sending agent and a safe email-drafting agent may use the same model and prompt; the difference is the permission layer around the send tool.

Code

A provider-neutral agent loop·python
def run_agent(task, model, tools, max_steps=12):
    state = [{"role": "user", "content": task}]

    for step in range(max_steps):
        response = model.call(messages=state, tools=tools.definitions())

        if response.final_answer:
            return response.final_answer

        for call in response.tool_calls:
            result = tools.execute(call.name, call.arguments)
            state.append({"role": "assistant", "content": call})
            state.append({"role": "tool", "content": result})

    raise RuntimeError("Agent stopped: max_steps reached")

External links

Exercise

Write a one-paragraph specification for a useful agent you actually want. Name its goal, tools, state, policy, and stop condition.
Hint
If the policy section is empty, you probably described a demo, not a shippable agent.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.