dev-tools
Glossary ↗Agent
An AI agent, in the software-tooling sense, is a system built around a large language model that doesn't just answer a single question but pursues a goal through a loop of reasoning, tool use, and observation — plan, act, observe, replan — until the task is done or it needs human input. The defining trait that separates an "agent" from a plain chatbot is agency over actions: an agent can call functions/tools (search the web, run code, query a database, edit files, call an API) and use the results to decide its next step, rather than just producing a single text response. Why it matters for builders: agents are the architecture behind coding assistants that can actually run your test suite and fix failures, customer-support bots that can look up an order and issue a refund, and internal tools that can triage a bug report by reproducing it. The design challenge is scoping the agent's tool access and adding guardrails, since more autonomy means more ways for a mistake to compound. How it works: an agent loop typically consists of a system prompt defining its role and available tools, a reasoning step (the model decides what to do next, sometimes exposed as visible "thinking"), a tool call (structured function invocation with arguments), execution of that tool by the surrounding application, and feeding the tool's output back into the model's context for the next reasoning step. This repeats until the model emits a final answer or hits a stop condition (step limit, budget, explicit human approval gate). Worked example: a support agent built for a SaaS billing product receives the message "I was charged twice for my subscription last month." The agent's loop: (1) it calls a `lookup_customer` tool with the user's email, getting back their account ID; (2) it calls `list_charges(account_id, month="last")` and sees two identical $49 charges 40 seconds apart — a clear duplicate; (3) it calls `check_refund_policy` to confirm duplicates are auto-eligible; (4) it calls `issue_refund(charge_id, reason="duplicate_charge")`; (5) it replies to the user: "I found the duplicate charge from March 3rd and refunded $49 back to your card — it'll show in 5–7 business days." Each numbered step was a distinct tool call, with the agent deciding the next action based on the previous tool's output, and the whole exchange — from the customer's message to the issued refund — completed in under ten seconds, versus the several minutes a human support rep would need to look up the account, cross-reference charges, and process the same refund manually.
Related terms