AI agents
Building, testing and debugging AI agents that call tools and work in real systems.

An order-entry agent should draft the order, not confirm it
Customer orders arrive as emails, PDFs and photos. An agent can turn them into draft orders against your product list. Here is where it should stop.

Your chatbot's answers are your promises
A tribunal held Air Canada to a refund policy its chatbot made up. Here is how to stop your own bot from inventing promises you then have to keep.

A supplier invoice agent should draft the bill, not pay it
How a document-reading agent turns supplier invoice PDFs into draft bills: six fields, one match against your orders, and a clear pile for a person.

Test your AI agent before your customers do
Most AI agent failures are found by customers. A one-afternoon dry run with real past messages finds them first. Here is how to run one.

A lead-qualification agent should sort leads, not reject them
What an AI lead-qualification agent should ask, where it should send each lead, and the one decision it should never make alone.

Your agent worked yesterday. Regression evals from real traces
A prompt tweak in one place breaks behaviour somewhere else. Turn bad traces into eval cases, run them against fake tools, grade with code first, and compare every change with a baseline.

Agent, automation or chatbot: which one you actually need
Three tools, three different jobs. A plain way to pick the right one for your small team, with an example you can test this week.

The agent that never stops (and costs you)
Agents that repeat tool calls, outgrow the context window or run up the bill all lack the same thing: a way to stop. Add limits, detect loops, trim context and give every run a clean finish.

The hand-off rule: when an AI agent should stop and call a person
Write down the moments an AI agent must stop and pass the chat to a person. A practical rule set for small teams, with examples.

Why your agent picks the wrong tool (or no tool at all)
Most "the model got it wrong" bugs are tool design bugs. Rewrite names, descriptions, schemas and error messages so your agent calls the right tool with the right input, and test it.

Your agent is a loop. Log every turn.
When an agent gives a wrong answer, a "question in, answer out" log tells you nothing. Learn how the agent loop works, log every turn of it, and read a trace to find the real bug.