Agents & Tool Use
Q: How do LLM agents work, and what makes them reliable?
An agent runs a loop: the model receives the goal + available tools (function schemas), decides on a call, the runtime executes it, results go back into the context, repeat until done.
user goal -> LLM (plan / choose tool) -> tool call {name, args} -> runtime executes (search, code, DB, API)
^ |
+-------------------- observation / result ---------------+
stop when the model returns a final answer (or a step/cost budget is hit)
Reliability levers: clear tool descriptions and typed schemas; small, composable tools; structured outputs; guardrails on side-effecting actions (confirmation, sandboxing, least privilege); step limits and timeouts; memory (summaries, retrieval) for long tasks; evaluating end-to-end task success, not single responses. Beware prompt injection from tool outputs (treat retrieved content as data, not instructions).