--- title: "What is an AI agent?" excerpt: "An LLM in a loop that can call tools and decide its own next step. Powerful when the task is genuinely open-ended — overkill, and less reliable, when it isn't." definition: "An AI agent is an LLM operating in a loop with access to tools, where the model decides which action to take next based on prior results, continuing until it reaches a goal or a stopping condition." date: "2026-07-09" lastModified: "2026-07-09" author: "Teo Deleanu" authorAvatar: "/team/teo.jpg" tags: ["Agents", "AI Engineering", "Production AI"] keywords: - "what is an ai agent" - "ai agent explained" - "llm agent vs workflow" --- An AI agent is a language model running in a loop: it observes the current state, decides on an action (often a [tool call](/glossary/tool-calling)), sees the result, and repeats until the task is done. The defining feature is that the model — not your code — chooses the next step. ## Why it matters in production That autonomy is exactly the value and exactly the risk. When a task is genuinely open-ended — "investigate this failing job and fix it" — an agent can navigate paths you could never enumerate in advance. When a task has a known shape, a fixed [agentic workflow](/glossary/agentic-workflow) is more reliable, cheaper, and easier to debug. Reaching for an agent is a decision about how much control you are willing to hand the model. ## The common mistake Building an agent for a problem a workflow would solve. Every extra decision the model makes is another place it can wander, loop, or burn tokens. Agents that [fail in production](/blog/why-ai-agents-fail-in-production) usually fail because they were given too much latitude for too little reason, or because they had no way to remember what they already tried. ## How we actually use it We keep the loop as tight as the task allows, give the agent a well-designed [tool catalog](/blog/context-engineering-tool-catalog) rather than raw API access, and design [memory](/blog/how-ai-agents-remember) deliberately so it does not repeat itself. For deciding between an agent, plain [RAG, or MCP tooling](/blog/mcp-vs-rag-vs-agents), we start from the task's determinism, not from what sounds impressive.