Cover: How to build an AI agent

How to build an AI agent: a 3-level roadmap from beginner to production

Most agent projects stall between the demo and production. This is the path we use with clients, from a first prompt to an agent your team can trust with real work.

An AI agent is software that reads a situation, decides what to do and takes an action, often across several steps and tools. Building one that works in a demo takes an afternoon. Building one your operations team will trust takes a plan.

Why agents stall

Most teams start with an impressive demo, then get stuck. The agent handles the examples it was shown, but real cases are messier: missing fields, unusual requests, systems that time out. Without a way to measure quality, nobody can say whether the agent is ready, so it never ships.

We break the work into three levels. Each one is useful on its own, and each one builds what the next one needs.

Level 1: a single task

Start with one narrow, repetitive task where a person can quickly check the answer. Classifying incoming support tickets or pulling five fields from an invoice are good first tasks.

  • One input, one output, no tools yet
  • A set of 100 to 300 past cases with the correct answer
  • A score you can rerun every time you change the prompt
Tip

Build the test set before you tune the prompt. It is the only way to know whether a change made things better or worse.

Level 2: tools and steps

Once the single task is reliable, let the agent use tools: look up an order, read a document, write a draft. Now it can finish a whole piece of work, not just one step.

Define each tool with a clear name, inputs and a short description, and keep the list small. Agents make fewer mistakes with five well-described tools than with twenty vague ones.

# tools the support agent is allowed to use
tools:
  - lookup_order: find an order by number or email
  - check_refund_policy: return the rules for a product
  - draft_reply: write a reply for a person to approve
never: issue refunds or send emails on its own

Level 3: production

The last level is what turns a capable agent into one a business can rely on. It is less about the model and more about the guardrails around it.

  1. Approval steps for anything risky, such as payments, refunds or a first message to a customer.
  2. Monitoring of accuracy, cost per task and how often cases go to a person.
  3. An audit log of every step, so any action can be reviewed and reversed.
  4. A pause switch that stops the agent instantly if something looks wrong.
Flow: new ticket, then the agent reads it and looks up the order, then a check for confidence above 90%, then a draft reply for approval
Cases below the confidence level you set always go to a person.

The three levels side by side

LevelWhat it doesWhat you needTypical time
1. Single taskOne step, checked by a personPast cases and a test score1 to 2 weeks
2. Tools and stepsFinishes a whole piece of workAccess to your systems2 to 4 weeks
3. ProductionRuns every day with oversightApprovals, monitoring, logs4 to 6 weeks

Where to start

Pick the process that happens most often and is easiest to check. Gather a few hundred past examples, agree on what a good answer looks like, and build Level 1 first. If the score is not good enough at that level, adding tools will not fix it.

If you would like a second opinion on which process to start with, see how we build AI agents or book a call with one of our engineers.

Turing Tech engineering team

Engineers who design, build and run AI agents and software products for US companies.

AI agentsLLMsProduction AI

Get new articles by email

One email when we publish something new. No sales messages, and you can unsubscribe any time.

Planning an AI agent?

Bring one process and a few examples. An AI engineer will tell you which level to start at.