Definition
An AI agent is an application in which a language model repeatedly decides what to do next — calling tools, reading results, and continuing — rather than producing one answer to one prompt. The minimal loop is: give the model a goal and a set of tool definitions, let it request a tool call, execute that call in your own code, feed the result back, and repeat until it produces a final answer or a limit is reached.
Everything difficult about agents is a systems problem rather than a modeling one. Loops need step and cost ceilings or they run away. Tool calls must be validated and sandboxed, because the model's output is untrusted input. Failures need to be recoverable, so tool calls should be idempotent where possible. And because each step appends to the context, long runs hit the context window and need summarization or external memory. Standardizing tool exposure — the problem the Model Context Protocol addresses — is a large part of making this maintainable.
How it comes up in interviews
Agent questions are increasingly used as the modern equivalent of a distributed-systems design question, and the graded skill is restraint plus operational thinking. Draw the boundary between what the model decides and what your code enforces, then cover step limits, budgets, retries, observability, and the prompt-injection risk of letting model output reach a tool that can act.