0Pricing
AI Agents · Lesson

From Assistant to Autonomous Agent

The spectrum from chatbot to fully autonomous: what changes at each step.

From Assistant to Autonomous Agent is a free AI Agents lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AI Agents learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

The Autonomy Spectrum

AI systems exist on a spectrum from fully reactive to fully autonomous. Understanding where your agent sits on this spectrum determines what architectural components it needs, how much human oversight is required, and what failure modes to anticipate.

Level 1: Pure Chatbot

A pure chatbot responds to messages with text. It has no memory beyond the current context window, no tools, no goals, and no ability to take action in the world. Every interaction is stateless. Human oversight need: minimal — it can only produce text, not act.

import anthropic

# Level 1: Pure chatbot — single turn, no memory, no tools
def pure_chatbot(user_message: str) -> str:
    client = anthropic.Anthropic(api_key='YOUR_API_KEY')
    response = client.messages.create(
        model='claude-opus-4-5',
        max_tokens=512,
        messages=[{'role': 'user', 'content': user_message}]
    )
    return response.content[0].text

# What it has:
#   - Language understanding
#   - Knowledge from training
# What it lacks:
#   - Memory (no history between sessions)
#   - Tools (cannot access external data)
#   - Goals (no objective to pursue)
#   - Proactivity (only responds, never initiates)

response = pure_chatbot('What is the capital of Australia?')
print(response)

Level 2: Tool-Augmented Agent

A tool-augmented agent adds external capabilities: web search, database queries, code execution, API calls. It can answer questions that require fresh data. Memory may persist within a session. Human oversight need: moderate — it can read data but actions are typically read-only or low-risk.

import anthropic

# Level 2: Tool-augmented agent
def tool_augmented_agent(user_message: str, conversation_history: list) -> str:
    client = anthropic.Anthropic(api_key='YOUR_API_KEY')

    tools = [
        {
            'name': 'search_web',
            'description': 'Search the web for current information',
            'input_schema': {'type': 'object',
                             'properties': {'query': {'type': 'string'}},
                             'required': ['query']}
        }
    ]

    conversation_history.append({'role': 'user', 'content': user_message})

    response = client.messages.create(
        model='claude-opus-4-5',
        max_tokens=1024,
        tools=tools,
        messages=conversation_history
    )

    # Handle tool use...
    return response.content[-1].text if response.stop_reason == 'end_turn' else '[tool called]'

# What changed vs Level 1:
#   + Tools (external data access)
#   + Session memory (conversation history)
# Still lacking:
#   - Persistent cross-session memory
#   - Goals (still reactive)
#   - Proactivity

Level 3: Goal-Directed Agent

A goal-directed agent pursues a defined objective across multiple steps, maintaining state between tool calls. It has a planner that decomposes the goal into sub-tasks. Human oversight need: significant — it takes multi-step actions that may have cumulative real-world effects.

# Level 3: Goal-directed agent
class GoalDirectedAgent:
    def __init__(self, goal: str, tools: list, client):
        self.goal = goal
        self.tools = tools
        self.client = client
        self.memory = []  # persistent across steps
        self.plan = self._make_plan()

    def _make_plan(self) -> list:
        response = self.client.messages.create(
            model='claude-opus-4-5', max_tokens=512,
            messages=[{'role': 'user', 'content':
                f'Goal: {self.goal}\n'
                'Create a numbered list of steps to achieve this goal. '
                'Each step should be a single tool call or reasoning step.'
            }]
        )
        return response.content[0].text

    def step(self) -> str:
        # Execute next planned step
        return 'step executed'

# What changed vs Level 2:
#   + Goal: has an objective to pursue
#   + Planning: decomposes goal into sub-tasks
#   + Persistent memory across steps
# Still lacking:
#   - Self-directed (still initiated by human)
#   - Self-improvement

if __name__ == '__main__':
    class FakeContent:
        def __init__(self, text):
            self.text = text

    class FakeResponse:
        def __init__(self, text):
            self.content = [FakeContent(text)]

    class FakeMessages:
        def create(self, **kwargs):
            return FakeResponse('1. Search web for topic\n2. Summarize findings\n3. Draft report')

    class FakeClient:
        def __init__(self):
            self.messages = FakeMessages()

    agent = GoalDirectedAgent(goal='Write a market report', tools=[], client=FakeClient())
    print('Goal:', agent.goal)
    print('Plan:')
    print(agent.plan)

Level 4: Self-Directed Agent

A self-directed agent sets its own sub-goals, monitors its environment for relevant events, and initiates actions without human prompting. It has long-term memory, a world model, and can re-plan when circumstances change. Human oversight need: high — it initiates actions autonomously.

import time

# Level 4: Self-directed agent (simplified sketch)
class SelfDirectedAgent:
    def __init__(self, mission: str, client):
        self.mission = mission
        self.client = client
        self.goals_queue = []
        self.long_term_memory = []
        self.running = False

    def start(self):
        self.running = True
        self._generate_initial_goals()
        while self.running:
            self._observe_environment()
            self._prioritise_goals()
            if self.goals_queue:
                goal = self.goals_queue.pop(0)
                self._pursue_goal(goal)
            time.sleep(60)  # autonomous monitoring loop

    def _observe_environment(self):
        # Agent monitors for events without being asked
        print('Observing environment...')

    def _generate_initial_goals(self):
        # Agent decomposes its mission into actionable goals
        self.goals_queue = ['Monitor inbox', 'Check project status']

    def _prioritise_goals(self):
        # Agent re-orders goals based on new observations
        pass

    def _pursue_goal(self, goal: str):
        print(f'Pursuing: {goal}')

if __name__ == '__main__':
    agent = SelfDirectedAgent(mission='Manage my inbox proactively', client=None)
    agent._generate_initial_goals()
    print('Initial goals:', agent.goals_queue)
    agent._observe_environment()
    goal = agent.goals_queue.pop(0)
    agent._pursue_goal(goal)

What Changes at Each Level: Memory

Memory requirements grow with autonomy level. Level 1 uses only context window (session memory). Level 2 adds persistent session history. Level 3 adds structured task state. Level 4 requires episodic memory (what happened), semantic memory (what the agent knows), and procedural memory (how to do things).

MEMORY_BY_LEVEL = {
    'L1_chatbot': {
        'scope': 'context_window_only',
        'persistence': 'none',
        'implementation': 'messages list in current API call'
    },
    'L2_tool_augmented': {
        'scope': 'session',
        'persistence': 'in-memory (lost on restart)',
        'implementation': 'conversation_history list'
    },
    'L3_goal_directed': {
        'scope': 'task',
        'persistence': 'persists for task duration',
        'implementation': 'SQLite or Redis with task state'
    },
    'L4_self_directed': {
        'scope': 'long_term',
        'persistence': 'indefinite',
        'implementation': 'vector DB (episodic) + structured DB (semantic) + prompt cache (procedural)'
    }
}

for level, info in MEMORY_BY_LEVEL.items():
    print(f'{level}: {info["implementation"]}')

What Changes at Each Level: Planning

Planning requirements also scale with autonomy. Level 1 has no planning. Level 2 may do single-step reasoning. Level 3 uses multi-step planning (Chain of Thought, ReAct). Level 4 requires hierarchical planning with replanning on failure.

PLANNING_BY_LEVEL = {
    'L1': 'None — single response',
    'L2': 'Single-step tool selection (which tool to call now)',
    'L3': 'Multi-step plan (goal -> ordered sub-tasks -> tool calls)',
    'L4': 'Hierarchical plan (mission -> goals -> tasks -> actions) + replan on failure'
}

# L3 multi-step planning example:
def plan_goal(goal: str, client) -> list:
    import anthropic
    response = client.messages.create(
        model='claude-opus-4-5', max_tokens=512,
        messages=[{'role': 'user', 'content':
            f'Break this goal into 3-5 concrete steps:\nGoal: {goal}\n'
            'Return JSON: {"steps": [{"step": int, "action": str, "tool": str}]}'
        }]
    )
    import json
    return json.loads(response.content[0].text)

for lvl, desc in PLANNING_BY_LEVEL.items():
    print(f'{lvl}: {desc}')

Human Oversight Requirements by Level

As autonomy increases, so does the need for human oversight mechanisms. Level 1 needs almost none. Level 4 requires explicit oversight architecture: approval gates, action logs, interrupt mechanisms, and anomaly detection.

OVERSIGHT_BY_LEVEL = {
    'L1_chatbot': [
        'None required (output only)'
    ],
    'L2_tool_augmented': [
        'Review tool permissions (read-only vs write)',
        'Audit logs of tool calls'
    ],
    'L3_goal_directed': [
        'Human approval before irreversible actions',
        'Plan review before execution starts',
        'Progress checkpoints',
        'Full audit trail'
    ],
    'L4_self_directed': [
        'Human approval before high-impact actions',
        'Real-time action streaming to oversight dashboard',
        'Emergency stop mechanism',
        'Anomaly detection on goal drift',
        'Regular review of long-term memory state',
        'Corrigibility: agent must accept shutdown'
    ]
}

for level, requirements in OVERSIGHT_BY_LEVEL.items():
    print(f'{level}:')
    for req in requirements:
        print(f'  - {req}')

Proactivity: The Key Shift

The most fundamental shift from assistant to autonomous agent is proactivity. An assistant waits. An agent initiates. This means the agent must monitor its environment, recognise relevant events, and decide when to act — all without being prompted.

# Proactive monitoring pattern
import asyncio
from datetime import datetime

class ProactiveMonitor:
    def __init__(self, agent_fn, check_fn, interval_seconds: int = 60):
        self.agent_fn = agent_fn
        self.check_fn = check_fn
        self.interval = interval_seconds

    async def run(self):
        print(f'Proactive monitor started, checking every {self.interval}s')
        while True:
            try:
                events = await self.check_fn()
                for event in events:
                    print(f'[{datetime.utcnow().isoformat()}] Event: {event}')
                    await self.agent_fn(event)
            except Exception as e:
                print(f'Monitor error: {e}')
            await asyncio.sleep(self.interval)

# Example: agent monitors for new emails every 5 minutes
# and proactively drafts replies or flags urgent ones
async def example_setup():
    monitor = ProactiveMonitor(
        agent_fn=lambda e: print(f'Agent handling: {e}'),
        check_fn=lambda: [],  # replace with real inbox check
        interval_seconds=300
    )
    # await monitor.run()

if __name__ == '__main__':
    import asyncio

    async def demo():
        async def check_fn():
            return ['New email from boss@example.com']

        async def agent_fn(event):
            print(f'Agent drafting reply for: {event}')

        monitor = ProactiveMonitor(agent_fn=agent_fn, check_fn=check_fn, interval_seconds=1)
        try:
            await asyncio.wait_for(monitor.run(), timeout=0.3)
        except asyncio.TimeoutError:
            pass

    asyncio.run(demo())

Error Recovery by Level

Error recovery requirements also scale. A chatbot just apologises. A tool agent retries the tool call. A goal agent replans around the failed step. A self-directed agent detects, categorises, and escalates errors autonomously, updating its world model to avoid the same failure in the future.

# Error recovery strategies by autonomy level

def chatbot_error_recovery(error: Exception) -> str:
    return 'I\'m sorry, I encountered an error. Please try again.'

def tool_agent_error_recovery(tool_name: str, error: Exception, retries: int) -> str:
    if retries < 3:
        return f'Retrying {tool_name} ({retries+1}/3)'
    return f'Tool {tool_name} unavailable after 3 retries, skipping'

def goal_agent_error_recovery(failed_step: dict, plan: list, client) -> list:
    import anthropic, json
    client_obj = anthropic.Anthropic(api_key='YOUR_API_KEY')
    response = client_obj.messages.create(
        model='claude-opus-4-5', max_tokens=256,
        messages=[{'role': 'user', 'content':
            f'Step failed: {failed_step}\nRemaining plan: {plan}\n'
            'Revise the remaining plan to work around the failure. Return JSON plan.'
        }]
    )
    return json.loads(response.content[0].text)

print('Error recovery patterns defined for each autonomy level')

Choosing the Right Level

Not every use case needs Level 4. Start at the lowest level that meets your requirements and only add complexity when needed. More autonomy means more complexity, more oversight burden, and more potential for unexpected behaviour.

def recommend_autonomy_level(requirements: dict) -> str:
    needs_realtime = requirements.get('realtime_data', False)
    needs_multistep = requirements.get('multi_step_tasks', False)
    needs_unsupervised = requirements.get('runs_unsupervised', False)
    needs_initiative = requirements.get('initiates_actions', False)

    if needs_initiative and needs_unsupervised:
        return 'L4_self_directed (high oversight required)'
    if needs_multistep:
        return 'L3_goal_directed (plan review recommended)'
    if needs_realtime:
        return 'L2_tool_augmented (audit logs required)'
    return 'L1_chatbot (minimal oversight)'

# Examples:
print(recommend_autonomy_level({
    'realtime_data': True, 'multi_step_tasks': False,
    'runs_unsupervised': False, 'initiates_actions': False
}))
print(recommend_autonomy_level({
    'realtime_data': True, 'multi_step_tasks': True,
    'runs_unsupervised': True, 'initiates_actions': True
}))

Knowledge Check

What is the most fundamental capability difference between a goal-directed agent (Level 3) and a self-directed agent (Level 4)?

Recap: From Assistant to Autonomous Agent

Excellent! Here is what you learned:

  • L1 chatbot: reactive, text-only, no memory, no oversight needed
  • L2 tool-augmented: session memory, tool calls, moderate oversight
  • L3 goal-directed: multi-step planning, task-scoped memory, approval gates
  • L4 self-directed: proactive, long-term memory, hierarchical planning, high oversight
  • Rule of thumb: start at the lowest level that meets requirements

Next: world models and predictive planning — how agents simulate before acting.

Frequently asked questions

Is the “From Assistant to Autonomous Agent” lesson free?

Yes — the full text of “From Assistant to Autonomous Agent” is free to read here on the web, and the AI Agents course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AI Agents course, upgrade to CoddyKit PRO.

What will I learn in “From Assistant to Autonomous Agent”?

The spectrum from chatbot to fully autonomous: what changes at each step. You practise AI Agents with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start AI Agents?

No prior experience is required. AI Agents on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “From Assistant to Autonomous Agent” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this AI Agents lesson?

Yes. Every AI Agents lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. From Assistant to Autonomous Agent
  2. World Models and Predictive Planning
  3. Alignment Challenges in Autonomous Agents
  4. Research Frontiers: AGI and Beyond
← Back to AI Agents