AI and LLMs · Concept

AI agents and tool calling

Tool calling lets a model ask your code to run a function, such as looking up an order or sending an email. An agent is a loop in which the model keeps choosing tools until a task is done.

Building with models · updated

How it works

You describe each tool with a name, a plain-language description and a JSON Schema for its inputs. Instead of answering, the model can reply with a request such as get_order_status with order_id 1042. Your code runs the function, sends the result back and the model continues, possibly calling more tools, until it can give a final answer. The model never runs anything itself: your code decides what actually executes.

An agent wraps this in a loop with a goal, a budget and a stopping rule, and may plan, browse, write code or hand work to other agents. Agents fail in new ways: they can loop, run up token bills, act on a misunderstanding, or follow instructions hidden in a web page or email (prompt injection). Keep tools narrow, require confirmation for anything destructive or costly, log every step and cap the number of turns.

More in AI and LLMs

Building with models

All 22 AI and LLMs terms

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.