Skip to content

From Autocomplete to Agents

The evolution from single-turn code completion to autonomous multi-step agents: what defines an agent, how the agentic loop works, and when to use agents versus simpler approaches.

  • 2 min read
  • Theory
  • Day 2 of 7

Theory

Not all AI coding tools are the same. There's a meaningful spectrum from a one-shot autocomplete to an autonomous agent that plans, executes, and iterates. Understanding where on that spectrum a tool sits helps you choose the right tool and set the right expectations.

The spectrum

Autocomplete Predicts the next line or block as you type. Fast, low-risk, no planning. Useful for boilerplate and patterns, not complex tasks.

Chat / copilot Single-turn or short-session assistant. You describe what you want; it responds with code or explanation. You integrate and iterate. Better for tasks you can describe in a paragraph.

Agent Multi-step autonomous execution. The agent receives a goal, decomposes it into actions, executes them (calling tools, reading files, running tests), observes results, and adjusts until the goal is met or it gives up. Useful for tasks that require reasoning across multiple steps and tools.

What defines an agent

An agent is an LLM augmented with four components:

  • Tools: Functions the model can call: file reads, terminal commands, API calls, browser control
  • Context: The accumulated state the model uses to reason: rules, code, results of previous tool calls
  • Memory: Persistence of information across turns and tasks (more on this in the next topic)
  • An agentic loop: The repeated cycle of reason → act → observe → adjust

The agentic loop

  1. Receive goal The user or an orchestrator gives the agent a task
  2. Reason The agent plans what to do first and selects a tool or action
  3. Act The agent calls the tool and waits for a result
  4. Observe The agent reads the result and updates its understanding
  5. Adjust It decides whether the goal is met; if not, it plans the next step
  6. Repeat until done, stuck, or the context budget is exhausted

Tool use and function calling

Tools are the mechanism through which agents affect the world. A tool is a function with a description and a schema; the LLM decides when to call it and with what arguments. Common tools in coding agents include:

  • Read/write files
  • Run terminal commands
  • Search the codebase
  • Browse the web
  • Call APIs (via MCP (more on that in Day 4))

The quality of the tool's description matters as much as the tool itself. A well-described tool gets called correctly; a vague description produces errors and wasted cycles.

When NOT to use an agent

Agents add complexity and cost. Use them for tasks that are genuinely multi-step and require real execution. For simple lookups, single-file edits, or well-bounded generation, a chat interaction is faster, cheaper, and easier to verify.

The rest of day 2

  1. 01How Large Language Models Work
  2. 02Prompt Engineering for Engineers
  3. 03From Autocomplete to AgentsYou are here
  4. 04Building an Agent in 50 Lines of Code
  5. 05Memory and State in Agent Workflows
  6. 06AI Failure Modes Every Engineer Must Know
  7. 07Human in the Loop
Where this comes from

This path is the shortest route to the ideas. AI-Native Software Engineering (O'Reilly Media) is where each one is worked out in full, with the patterns, the trade-offs and the failure modes. The pillars cover the foundations one long essay at a time.