Building an AI agent for a demo takes an afternoon. Building one that talks to real customers, checks your CRM and never invents a price takes method. This guide doesn’t rehash what an agent is: it explains how to build one for a business, in the order we do it, with the decisions that weigh most on the outcome and on the bill.
Which business process should you automate first with an agent?
Your first agent should handle a boring, frequent, measurable process, not the flashiest one.
The best first process for an AI agent is one that happens many times a day, that a person currently handles by looking up information that already exists, and whose outcome can be measured. Qualifying inbound leads, answering order-status questions, booking appointments and triaging support requests are good candidates. Negotiating contracts or deciding discounts are not.
A useful test before you start: write down ten real conversations or cases exactly as they happened. If a new hire could resolve them with a manual and access to two systems, an agent can too. If every case calls for judgment nobody has written down, document that judgment first; no model will guess it.
And one distinction that saves money: not everything that looks like an agent needs to be one. Anthropic’s guide separates workflows, where the model follows steps predefined in code, from agents, where the model decides which tool to use and in what order. If the process always follows the same steps, a workflow with AI at one specific point is cheaper, more predictable and easier to maintain. An agent is justified when requests vary too much to fit a fixed diagram.

What are the parts of an agent: model, tools, memory and rules?
The model is the easiest part to swap; tools and rules are what decide whether the agent is useful.
An AI agent has six parts: a language model that reasons, instructions that define its role, tools to look things up and act, a knowledge source, memory, and escalation rules. n8n’s documentation puts it the same way: each agent has a language model, instructions and capabilities you configure. Here is what we design in each:
- Model: the engine that interprets the request. Choose it for task quality, latency and cost per token, and make sure you can swap it without rebuilding everything else.
- Instructions: the role, the tone, what it does and, above all, what it never does. If the agent misbehaves, fix the instructions before adding more tools.
- Tools: concrete actions such as looking up an order, creating a contact or booking a slot. Each with a clear description and parameters that make mistakes hard.
- Knowledge: real prices, policies, catalog and FAQs, in a source someone on the business side keeps up to date.
- Memory: the current conversation and, if the use case calls for it, past interactions. More memory also means more personal data to protect.
- Escalation rules: when the agent stops and hands the case to a person, with the context already gathered.
What should you build an AI agent with: n8n, no-code or custom code?
n8n is the middle ground for most small businesses; custom code pays off when the agent is central to the product.
AI agents are built with three kinds of tools: no-code chatbot platforms, orchestrators like n8n that combine a model with your integrations, or custom code using a model provider’s SDK. The choice depends less on technology and more on how many systems the agent has to touch and who will maintain it.
In most small-business projects we use n8n as the backbone: it connects the model to the CRM, WhatsApp, invoicing or a database, can use MCP servers as tools, and can require human approval before running sensitive tools. When the agent is the product, or needs logic a visual workflow can’t express maintainably, we move to custom code.
Here is the comparison, without prices, since they change with every vendor and plan:
| Approach | Upfront cost | Control | Time to pilot | When to choose it |
|---|---|---|---|---|
| No-code chatbot platform | Low, with a monthly subscription | Limited to what the platform offers | Shortest | FAQs with few integrations |
| n8n plus a language model | Medium: design and integrations | High over data, flows and hosting | Moderate | Agents that look up and act across several systems |
| Custom code | High: development and testing | Full | Longest | When the agent is central to the product or service |
How do you stop an agent from making things up or overstepping?
You don’t ask the model to behave: you take away its ability to misbehave.
You keep an agent from inventing answers by limiting what it can say to verifiable data and what it can do to minimal permissions. The rule we apply on every project: if the information isn’t in the knowledge source or a system it queried, the agent doesn’t improvise, it escalates. In the Hudson Oils project, for example, the voice and chat agent collects what sales needs to prepare a quote without making up prices: its instructions are as explicit about what it won’t do as about what it will.
The second risk is prompt injection. OWASP defines it as input that alters the model’s behavior in unintended ways, and distinguishes direct injection, when a user types something like “ignore your rules,” from indirect injection, when the instruction hides inside an email, document or web page the agent reads. Its recommended mitigations are concrete: least privilege, human approval for high-risk actions, separating external content from instructions, and validating outputs with code.
In practice that means a dedicated user for the agent in each system, read-only tools by default, human confirmation for anything that moves money or deletes data, a step limit per task so it can’t loop, and testing with hostile conversations before going public. Anthropic’s guide says the same: extensive testing in sandboxed environments and clear stopping conditions.
How much does it cost to build and run an AI agent?
You pay for the build once; model usage, the channel and maintenance are paid every month.
An AI agent has two kinds of cost: the build, paid once, and operation, paid monthly. The build depends on how many systems it integrates, how many tools it exposes and how much of the process has to be documented. That is why fixed prices quoted without seeing the process deserve suspicion: an agent that answers FAQs and one that books, quotes and updates the CRM are different projects.
Operating cost has four line items. The language model, billed per million input and output tokens, with prices that vary widely between models. One public figure helps with sizing: Meta estimates that each message from its own WhatsApp agent uses 20,000 to 25,000 tokens. The channel, such as WhatsApp API messages, which Meta bills per message. Hosting for n8n or whatever server runs the agent. And maintenance: updating knowledge, reviewing conversations and tuning instructions.
The monthly math goes like this: conversations per month, times messages per conversation, times tokens per message, times the price per token, plus channel, hosting and review hours. Running that calculation with your real volumes before building avoids the most common surprise: an agent that works well but costs more than the person it was meant to support.
How do you measure whether the AI agent is working?
Measure an agent by the cases it resolves correctly on its own, not by the messages it answers.
An AI agent is working if it correctly resolves a growing share of cases without human help and escalates the rest well. We track only a handful of metrics: unassisted resolution rate, escalation rate and the reason behind it, errors found in review, response time, and the business action it was built for, such as booked appointments, qualified leads or order lookups.
Before launch, build a test set of real conversations, hard ones included, and run it every time you change the instructions, the model or a tool. n8n includes evaluations for testing AI workflows, and any serious stack should have an equivalent. Without that test set, every tweak is a gamble.
After launch, the most valuable task is the least glamorous: reading conversations every week. That is where unforeseen questions, stale data and cases where the agent should have escalated sooner show up. If after a reasonable period the agent doesn’t move the business metric that justified the project, the honest move is to narrow its scope or switch it off, not keep expanding it.
Frequently asked questions
Can you build an AI agent for free?
You can build a prototype with free or open-source tools, such as self-hosted n8n. Running it in production is never free: the language model charges per use, the channel may charge per message, and someone has to maintain it.
Do I need to know how to code to build an AI agent?
Not for a simple prototype: no-code tools and n8n let you assemble one visually. To connect it safely to your CRM or ERP, with permissions and testing, you do need technical judgment.
How long does it take to get an agent into production?
It depends on scope. A pilot limited to one process and running read-only is measured in weeks; an agent with several integrations and write permissions needs more testing time. Documenting the process usually takes longer than the coding.
What data does the agent need?
The same a person would need to resolve the case: prices, policies, catalog, FAQs and read access to the systems involved. If that information is messy or out of date, fix that first.
Will the agent replace my team?
In most cases, no. It absorbs repetitive questions and prepares context, and your team keeps the cases that need judgment, negotiation or empathy. An agent with no handoff to people is a liability, not a saving.
Summary: what to remember
- Start with a frequent, measurable, documented process; if it always follows the same steps, an AI-assisted workflow beats an agent.
- Tools, permissions and escalation rules shape the outcome more than the model you pick.
- Work out the monthly cost with your real volumes and measure cases resolved unassisted, not messages answered.
Got a process that repeats a hundred times a day?
We design and build AI agents with n8n, connected to your CRM and channels, with minimal permissions and handoff to your team.
See our AI & Automation service


