Agents
- 1 Tool Calling and the Agent Loop "Tool calling lets the model emit a structured request, a tool name and JSON arguments, that my code validates and executes, returning the result as a new message. The agent loop repeats that until the model answers in text or hits a step, time or cost limit. The message list is the state. I'd st...
- 2 Agent Patterns: ReAct, Plan-and-Execute, Reflection "ReAct interleaves a short thought, one action and the observation, which adapts well but can drift on long tasks. Plan-and-execute writes the steps first, keeps them as state, executes them, often with cheaper models, and replans on failure. Reflection adds a critic that checks the result agains...
- 3 Designing Tools an Agent Can Use Well "I treat tools as an API for the model: a small set of distinct, task-shaped tools with specific names, descriptions that say when to use them, and simple typed arguments with enums and defaults. Outputs are concise, paginated, and include readable identifiers; errors say what to do next. Write t...
- 4 Model Context Protocol (MCP) "MCP standardises how AI applications connect to tools and data. A host app runs clients that connect to servers; servers expose tools, resources and prompts with JSON Schema, over JSON-RPC via stdio locally or HTTP remotely. It turns N apps times M tools integrations into N plus M. The model and...
- 5 Agent Memory and State "I separate the working context in the prompt from durable state outside it: task state with the plan, progress, artifacts and actions taken; episodic memory of past runs; and long-term knowledge. The agent checkpoints after every step, side effects carry idempotency keys, and a crashed run resum...
- 6 Multi-Agent Systems: When One Agent Is Not Enough "I'd use multi-agent only for broad, parallelisable work. The common pattern is orchestrator–workers: a lead plans and delegates scoped sub-tasks with clear output formats, workers run in parallel with their own focused context and tools and return condensed structured results, and the lead combi...
- 7 Making Agents Reliable: Retries, Timeouts, Checkpoints "Per-step errors compound, so a 95%-reliable step gives about 36% success over 20 steps. I'd raise per-step reliability with timeouts, retries with backoff and jitter for transient errors, output validation and fallback models; and make runs recoverable with checkpoints, idempotent tools, verific...
- 8 Evaluating Agents "I evaluate outcome, trajectory and cost. Outcome is checked with code against the end state in a sandboxed environment; trajectory checks cover required steps, forbidden actions and wasted steps, with code first and a calibrated judge for softer criteria. Each task runs several times; I track pa...
- 9 Agent Safety: Permissions, Sandboxes, Human Approval "I'd make safety structural: least-privilege tools, scoped short-lived credentials per user and task, agents in a sandbox with an allowlisted network and resource limits, and an action gateway that enforces policy, asks for approval on high-impact or irreversible actions, and keeps an audit log. ...
- 10 Browser and Computer-Use Agents "A computer-use agent loops: observe the screen, let a multimodal model choose one action like a click or typing, execute it in an isolated browser or VM, and observe again. I'd prefer an API, then the page's accessibility tree, and use raw pixels only as a last resort, because each step is slow,...