What are AI Agents?

A friendly introduction to AI agents for builders of all levels.

An AI agent is a language model running in a loop with tools: it reads a goal, takes an action (run a command, edit a file, search the web), observes the result, and repeats until the goal is done. That loop — not the model alone — is what makes it an agent.

The agent loop

Goal → Think → Act (use a tool) → Observe result → Think → Act → … → Done

A chatbot answers once. An agent keeps going: it runs your tests, reads the failure, fixes the code, and runs them again. Everything else in agent-land is about making this loop reliable.

The five building blocks

BlockWhat it isYou control it via
ModelThe reasoning engine (Claude, GPT, Gemini, Grok…)Picking a model / runner
ContextWhat it knows right now: instructions + files + historyAGENTS.md, what you put in prompts
ToolsWhat it can do: shell, file edits, browser, APIsMCP servers, runner built-ins
MemoryWhat persists between sessionsMemory MCP, notes files, project docs
OrchestrationOne agent vs. several with rolesMulti-agent patterns

The one constraint that explains everything: context

Models have a context window — a finite working memory (hundreds of thousands of tokens, but finite). Everything the agent knows during a task must fit: its instructions, the files it has read, tool outputs, and the conversation so far.

This is why:

  • AGENTS.md matters — it's the dense, always-loaded summary of your project
  • Agents read files selectively instead of ingesting the whole repo
  • Long sessions degrade — old details get compacted or dropped
  • Plans and scratch files work — externalized state survives when context doesn't

When an agent "gets dumber" mid-task, it's almost always a context problem, not a model problem. See the context engineering example for practical fixes.

Skills: process you don't re-explain

A skill is a reusable instruction package — a proven prompt with a defined process and output format. Instead of re-explaining how you want code reviews done in every session, you load the advanced-code-reviewer skill once.

Good skills give the agent a clear contract (inputs, steps, output format) and encode hard-won judgment. That's the difference between "review this" and a review that consistently checks security, performance, and tests. Browse the Skills directory or learn to write your own.

Quick glossary

TermMeaning
Agent runnerThe harness that runs the loop: Claude Code, Codex CLI, Gemini CLI, Cursor…
MCPModel Context Protocol — the open standard for plugging tools into agents
Tool callA single action: run a command, read a file, hit an API
System promptThe standing instructions the model always sees
Context windowThe model's finite working memory for one session
AGENTS.mdA markdown file of project facts and rules that agents load automatically
SkillA reusable, structured instruction package for one capability
SubagentA child agent spawned for a subtask, with its own fresh context

Single agent vs. multi-agent

Start with one agent. It's easier to debug, cheaper, and sufficient for most work. Move to multiple agents when tasks have genuinely separable roles (research vs. implement vs. review) or you need parallel exploration — see Multi-Agent Patterns for when and how.

Ready to build? Head to Getting Started.