Agents and Tool Use
An agent is a model that can take actions: search, query a database, run code, call an internal API.
The useful version is boring: a loop with a small tool list and a stop condition.
A simple agent loop
- Read the user request
- Decide: answer now, or call a tool
- Run the tool
- Inspect the result
- Repeat until done or a max-step limit hits
max_steps = 5 tools = [search_docs, get_order, create_ticket]
What to constrain
- Which tools exist — fewer is safer
- What arguments are allowed — schemas, not free text
- How many steps — agents love to wander
- What success looks like — validate tool output before sending it back to the model
When you should not use an agent
If one retrieval + one generation answers the question, skip the agent.
Extra tool calls add latency, cost, and new failure modes.
Next
Once the system can act, you need to know if it is any good: