vishal patel
LearningAdvancedUpdated 2026-09-23

AI Agents & Tool Use

LLMs that plan and act through tools in a loop — workflows vs agents, the agent loop, guardrails, and when not to build an agent.

agentstool-useorchestrationclaude

Workflows vs agents

  • Workflow: the LLM is called along a predefined code path (chain, router, parallel, evaluator-optimizer). Predictable, cheap, testable.
  • Agent: the LLM decides the next step and which tools to call, in a loop, until done. Flexible, but less predictable.

Start with the simplest thing that works. Most "agents" in production are well-designed workflows.

The agent loop

diagram

Architecture for production agents

  • Tools are APIs: clear names, strict JSON schemas, idempotent, with good error messages the model can act on.
  • Least privilege: read tools freely; write tools behind confirmation or policy checks.
  • State and memory: conversation state, task scratchpad, and long-term memory as separate concerns.
  • Budgets: max steps, max tokens and timeouts per run.
  • Observability: trace every step (prompt, tool call, result, cost).
  • Evals: task-success rate on a fixed scenario set, re-run on every prompt or model change.
  • Prompt-injection defence: treat tool outputs (web pages, emails) as data, never as instructions.
Where I've used it

Our team built a Claude-driven developer setup agent: typing "cms setup" in the repo provisions and validates a local environment of 60+ microservices plus MongoDB and Redis, and walks the developer through failures with log interpretation. Now I'm building a CRM/ERP agent platform in Python with a tool registry, guardrails and evals designed first.

Sources & further learning

Videos, courses, docs and books I recommend for this topic.

My post on this

Traditional API vs API with AI: an architectural shift

An AI-enabled API adds an intelligence layer between the contract and execution, bringing new responsibilities: context management, model orchestration, tool execution, guardrails, semantic caching and cost observability.

#apis#ai-architecture#rag#guardrails
Read on LinkedIn

Related topics