# What Actually Makes an AI Agent

> An agent is an LLM in a loop that chooses tools and acts on results. Here is the loop, the components and when you should not build one.

- Source: https://akshaythakare.com/notes/agentic-ai/what-makes-an-agent
- Topic: Agentic AI
- Level: beginner
- Reading time: 2 min
- Tags: agentic-ai, llm, agents
- Updated: 2026-10-11

## The core loop

A chatbot answers once. An **agent** runs a loop: decide → act with a tool → observe the result → decide again, until the goal is met or a limit is hit.

*(Interactive illustration “Agent Loop”: see the web page.)*

## Components

| Component | Purpose | Example |
| --- | --- | --- |
| Model | Reasoning and choosing actions | Any capable tool-calling LLM |
| Tools | Do things the model cannot | SQL query, search, API call, file write |
| Instructions | Role, constraints, definition of done | "Only read from the warehouse; never run DDL" |
| Memory | State across steps or sessions | Conversation history, scratchpad, vector store |
| Guardrails | Limits and approvals | Max steps, allow-listed tools, human approval for writes |

## Workflow or agent?

| Use a fixed **workflow** when | Use an **agent** when |
| --- | --- |
| Steps are known in advance | The path depends on what is discovered |
| You need predictability and low cost | Flexibility is worth extra latency and cost |
| E.g. "summarise every new ticket" | E.g. "investigate why yesterday's revenue dropped" |

Many production systems are mostly workflows with an agentic step where judgment is needed.

## Data engineering examples

- Diagnose a failed pipeline: read logs, query the ledger, check source freshness, propose a fix
- NL-to-SQL analyst: inspect schema, write a query, run it read-only, explain the result
- Data quality triage: compare counts across layers and point to the first divergent stage

> **Warning: Least privilege**
>
> Give agents the narrowest tools possible — read-only credentials, scoped queries, approval steps for anything destructive. An agent's mistakes run at machine speed.
