Skip to main content
AI Guides 10 min read

How to Build Your First AI Agent

A login is not a working agent. The first build is one trigger, a few inputs, one write, and a success rule set before anyone opens a prompt.

Definition

Building an AI agent means connecting a brain layer (an LLM that reasons about the goal), a perception layer (inputs from CRM, enrichment, and form data), and an action layer (writes to external systems like the CRM, email platform, or calendar) into a goal-directed loop that executes without human approval at every step.

You can buy a login this week and still not have an agent that does a job. Building the first one is a set of decisions a marketing lead owns before anyone writes a prompt: which workflow, which systems it may touch, what "correct" means, and who stops it when it is wrong. The teams that skip those decisions spend the budget and then explain a demo in the next review.

IBM's Institute for Business Value CDO study asked 1,700 senior data leaders. Oxford Economics ran the fieldwork from July through September 2025, across 27 countries and 19 industries. Eighty percent have started building datasets for agents. Seventy-nine percent of those same leaders say they are still early on how to govern and scale them. Eighty-three percent say the benefits outweigh the risks, and 77% are comfortable relying on agent outcomes. The spend is ahead of the plan. This is the plan for one workflow.

What does building an agent mean for a marketing team?

You hand it an objective. It breaks the objective into steps, calls tools, reads what came back, and decides the next step without a person approving every call. A chatbot writes a reply and stops. The two are different builds, which is why the agent and chatbot distinction belongs at the start. The chatbot needs a prompt and a channel. The agent needs a trigger, a place to read, a place to write, and a rule for the step you will not let it take alone.

What are the three layers in a working agent?

Xi and colleagues (arXiv:2309.07864, September 2023) describe three layers in every working agent. The brain is the model that picks the next tool. The perception layer collects what the step needs: a CRM field, an enrichment result, a form, a reply. The action layer writes: a contact update, a message, a meeting, a routing note. All three have to work before the agent does anything you would trust. A strong model with a broken write is a demo. A clean write with a model that cannot see the fields is a confident error in the CRM.

Why is the model the first decision?

The model is the first decision, not a setting you pick at the end. It sets how hard a workflow the agent can reason through, what each run costs, and how you debug a wrong output. The wrong model either misses the decision or costs more per run than the workflow is worth, and both kill the project faster than a broken connector. Pick it when you know the number of steps and the cost you can defend per lead, not after the integration work is already scheduled.

Which problem should the first agent solve?

The expensive mistake is picking a problem that sounds impressive. Impressive means several teams, several systems, and several objectives, and it usually means nothing runs this quarter. A first agent has one trigger, a predictable set of inputs, a clear success condition, and one place it writes. Save the multi-team version for the third or fourth agent, after this one has shipped and you know what a bad run looks like.

Which four questions tell you the job is small enough?

Run four questions before you commit. Does it start from one event, such as a form, an inbound email, or a territory change? Does it read from three systems or fewer? Does it write to one place, such as a CRM field, a sequence, or a calendar slot? Can you see a result within a week, not a quarter? Four yeses is a buildable first agent. A no means the job needs to be smaller before anyone starts. Do not average the answers. One no is enough to cut the workflow down, because that no is the part that turns a ten-week build into a quarter of meetings.

When the no is "it writes to three places," pick the write that a person already checks on Monday and drop the other two from the first build. When the no is "we will not know if it worked until the quarter closes," choose a proxy you can count this week, such as tasks completed with the right fields, and keep the quarterly number as a later read. The first agent earns the next one by finishing, not by covering every system the team wishes it covered.

Which four marketing jobs usually pass that test?

Four marketing jobs pass that test often enough to be worth naming. Inbound qualification scores a new form without a person triaging it by hand. Enrichment fills company fields at the moment the contact is created. Follow-up selection picks the sequence from signals already in the CRM instead of dropping everyone into one path. A competitive-mention alert surfaces accounts that look like they are in a buying stage. Each of those has one trigger, a short list of inputs, and a CRM write. The inbound follow-up pattern covers the first of those in full. A nurture sequence that branches for a month is a later build, and it waits until the first write has a success rule you can check.

What does the first marketing agent cost to run?

There are two bills, and they behave differently. Infrastructure is every month. Engineering is mostly once. Both get underestimated, and the gap between the internal estimate and the invoice is where the first project loses the room before it has produced anything a buyer can see.

What does a month of infrastructure look like?

The monthly figures in this paragraph are illustrative, not a client result, and they are not a price for our work. A single inbound-qualification workflow, about 500 leads a month, at moderate inference cost, often lands between $400 and $900 a month in infrastructure. Model calls are about $150 to $350 of that, depending on the model and how many reasoning steps a run takes. Enrichment credits are another $150 to $350. An orchestration platform is about $80 to $150. Monitoring is about $20 to $50. A multi-step agent with a branch at each decision costs more per run than a three-step agent that reads, scores, and writes. If the loop adds a step, redo the monthly figure before you approve the design.

Which costs show up after the estimate is approved?

In June 2026, Bain's Automation and AI Pathfinder Survey covered 951 organizations. Data access and integration is the obstacle 41% of them name first. Dirty CRM data produces confident wrong decisions. Deduplication, one field format, and missing values commonly add two to four weeks, and they rarely appear in the first estimate. Put those weeks in the plan, or you will find them as a fire after launch, when the agent has already written bad scores into live contacts. The longer cost breakdown is in what agents cost to build.

How long does a working first agent take?

Wharton's 2025 AI Adoption Report is the third year of that study. Four in five enterprise leaders in it look for a payoff from generative AI spending inside two to three years. That is the patience for the program, not the calendar for one agent. A first agent with clean data and a defined success metric can reach production in 10 to 16 weeks. The window holds only if the workflow was defined before the build started.

What are the three phases inside those weeks?

The first phase is the map: the workflow, the input sources, the success metric against a baseline from before the build, and which APIs need an owner to approve access. That is two to four weeks, and it is where most overruns start, not in the engineering that follows. Write down who has to grant each login before you promise a date, because a connector that is "just an API" still waits on a system owner who has not been asked.

The second phase is the build: connect the perception layer to those inputs, write the instructions and the tool definitions for the brain, wire the action-layer writes, and test against real historical cases rather than a happy-path sample. Four to eight weeks for one workflow with clean data. The third phase is the gate before launch: a holdout set of historical cases with known outcomes, the approval rule, the escalation path, and the metric that triggers a rollback if production results fall off the baseline. Two to four weeks. Total, 8 to 16 weeks, unless the data audit finds a mess that has to be cleaned before the build can start. If the audit finds that mess, the build does not start until the fields are safe to read.

Should you build, buy, or compose?

Wharton puts roughly a third of enterprise generative AI budgets on internal research and custom work. The other two thirds buy platforms and tools you assemble. That split is a staffing question, not a belief about which path is nobler. The 2026 agent context is the wider picture. This section is only the decision for the first marketing workflow.

Which four conditions pick the path?

Build when the reasoning is proprietary and no platform can configure it without custom code your team can maintain after the launch week. Buy when a platform already covers the workflow for less than the engineering time, including the time to keep it running. Compose when a model API is the brain, an orchestration tool runs the loop, and your team only writes the glue to the CRM and the enrichment source. Most first marketing agents land in compose. You are connecting managed pieces, not building the pieces. That is why a team without a dedicated model group can finish in weeks rather than treating the first agent as a research program.

How do you govern the agent before it goes live?

The IBM study found that 77% of senior data leaders are comfortable relying on agent outcomes, and 83% say the benefits outweigh the risks, while 79% are still early on governance. That gap is where first deployments fail in public. Bain's 2026 survey puts the starting point in numbers. Fully autonomous agents are live at 7% of organizations. The most common first model is a person approving each action, which 38% do. Another 32% let the agent act inside guardrails and surface exceptions. Plan for approval first. Move to guardrails when the accuracy has earned it, not when the calendar says the pilot is over.

What are the three gates before launch?

Three gates, in this order. Accuracy: run the agent on 50 historical inputs with known outcomes and look for agreement at 90% or better before production. Safety: every action is either reversible or has a person in front of the irreversible one. Sending a message is one-way. Changing a lifecycle stage can be undone. Escalation: the conditions that require a person are written down, and the monitoring can actually see them on launch day. A gate you cannot observe is a sentence in a doc, not a control.

Which six checks belong on the list before the switch?

Six checks before the switch, and each one is a yes you can show someone. The agent cannot take an irreversible action without a checkpoint. Every tool call is logged with its input, its output, and the time. The baseline was written down before the agent touched production data, so a later chart has something to stand next to. Someone named on the team can roll it back in under 10 minutes, and you have watched them do it once on a staging run. The owner of the CRM and the owner of the email platform have approved the specific write, not a general promise that marketing automation is fine. The accuracy test used real historical inputs, not examples invented for the test. A miss on that list shows up later as a technology failure. It usually is not. The review names the model. The missing line is the check nobody ran.

How do you know the agent is working?

Wharton reports formal measurement of generative AI return among 72% of enterprise leaders. The rest are the ones most likely to cancel the first agent at six months because they cannot show a number when the budget comes back. Measurement starts when you define the job, not after launch. If you did not write the baseline in the first phase, you will not have a comparison later, and a flat chart will look like a failure even when the manual process was worse.

What do you measure on the run, and what do you measure on the result?

Process metrics say the agent ran. Track the share of runs that finished without an error or a forced handoff, the share that surfaced an exception, and the time from trigger to action against the manual baseline. Those numbers confirm the loop. They do not confirm you aimed it at the right job. Outcome metrics say the job was the right job. For inbound qualification, that is qualified pipeline per week against the baseline from before the agent. Green process numbers and a flat outcome mean the agent is executing a workflow that was aimed at the wrong constraint. Fix the aim. Do not add engineering first.

Write the scope as one trigger, the fields it may read, and the one write it may make. A nurture sequence is a second build, and it waits until this one has a success rule you can check on Friday. If you want that constraint named before the build starts, get your free Systems Plan. We reply with whether the first workflow is small enough to finish.

How we know this.

The 80% dataset figure, the 79% early-governance figure, the 77% outcome-trust figure, and the 83% benefits figure come from IBM's 2025 CDO study, published by the Institute for Business Value. That study heard from 1,700 senior data and analytics leaders, with Oxford Economics in the field from July through September 2025, in 27 countries and 19 industries. The June 2026 Bain survey of 951 companies supplies the 7% fully autonomous figure, the 38% human-approval figure, the 32% guardrails-plus-exception figure, and the 41% data-access obstacle. Wharton's 2025 report supplies the internal-budget share near one third, the two-to-three-year payoff expectation, and the 72% measurement figure. Xi and colleagues (arXiv:2309.07864, September 2023) supply the three-layer architecture. The infrastructure dollars from $400 to $900, and the pieces inside that range, are illustrative, not a client result. None of them is a fee we charge.

Share this article:

The next step

Tell us the job this note is about.

If your team still does this work by hand, name the job and the tools it lives in. The first system we would build is in the email a few minutes later.

Keep reading

Related Articles

Download the AI Workflow Checklist

Get AI Systems Notes Delivered Weekly

Get practical notes on AI agents, workflow design, business memory, team routines, and the systems worth building.

No spam. Unsubscribe with one click.

For qualified teams
AI systems notes
Audit-first thinking