How to create an AI agent
You can build an AI agent from scratch with code, or stand one up on a no-code platform in an afternoon. Here is what an agent actually needs, both routes compared honestly, and the mistakes that sink most first attempts.
First, what counts as an AI agent
An AI agent is software built around a language model that pursues a goal: it understands input, decides what to do, and acts, whether that action is answering, asking a follow-up question, calling a tool, or handing off a result. That goal-seeking is what separates an agent from a plain chatbot; the full distinction is worth understanding before you build one.
This guide focuses on the most common business case: a customer-facing conversational agent that represents your company, answers questions from your content, and produces an outcome such as a qualified lead. Internal automation agents follow the same logic with different plumbing.
The four things every agent needs
Whatever route you take, the anatomy is the same:
- A model to understand and generate language. Today you rent this via API; almost nobody trains their own.
- Knowledge to ground its answers: your website, docs, catalogs, policies, retrieved at answer time so the agent cites reality instead of improvising.
- Instructions and limits that define its goal, its voice, and, crucially, what it must refuse to do.
- A way to act: answering is the baseline; asking qualifying questions, booking, escalating to a human, and handing over a structured summary are what make it useful.
The two routes
There are two ways to assemble those four pieces: wire them together yourself with code, or configure them on a platform that has already done the wiring. Both produce a real agent; they differ in where the work, the control, and the maintenance live.
Route one: build it with code
The developer route wires these parts together yourself: a language-model API for understanding and generation, a retrieval pipeline (commonly called RAG, retrieval-augmented generation) that indexes your content and fetches the relevant passages per question, and orchestration code that manages the conversation, the tools, and the guardrails. Open-source frameworks exist for every layer, and the model vendors publish agent-building guides of their own.
This route gives you full control: your choice of model, your retrieval quality, your data handling, your integrations. It fits teams with engineering time and unusual requirements. The honest cost is that you own the plumbing forever: hosting, evaluation, regressions when models change, and the long tail of guardrail work that only shows up once real strangers start typing.
Route two: use a no-code platform
A platform handles the model, retrieval, and orchestration for you. You supply the knowledge and the rules, usually by pointing it at your existing content, and configure the agent’s goal and voice from a dashboard. Deployment is typically one script tag on your site.
The better platforms go further than hosting: they draft the agent’s knowledge from your website automatically, so your job becomes reviewing and correcting rather than writing from scratch. This route trades some control for speed and reliability. For most teams whose goal is a working agent on their site, not a research project, it is the faster and safer path.
Code or no-code: how to choose
The choice is less about ambition than about where you want to spend attention. A rough comparison:
| Build with code | No-code platform | |
|---|---|---|
| Time to first working agent | Weeks, plus iteration | Hours to days |
| Control | Total: model, retrieval, data, UX | Configuration within the platform’s rails |
| Maintenance | Yours: hosting, evals, model changes | The vendor’s |
| Cost shape | Engineering time + infrastructure + model usage | Subscription |
| Best for | Products where the agent is the product | Businesses that need an agent working on their site |
The seven steps, whichever route you take
The shape of the work is the same on both routes:
- Define the job. One agent, one clear outcome: answer pre-sales questions and qualify, or deflect support load. Vague scope is the number-one killer.
- Assemble the knowledge. Gather the content the agent may answer from, and decide what is out of bounds.
- Write the rules. Goal, tone, hard limits, and what to do when it does not know.
- Give it a voice. The agent speaks for your brand; make it sound like you, not like a model.
- Test on real questions. Not your questions: the awkward, vague, misspelled ones actual visitors ask.
- Deploy where the users are. On the pages where the questions happen, not buried behind a help link.
- Watch and refine. Read the conversations. They tell you what the agent gets wrong and what your market actually wants to know.
The mistakes that sink first agents
A few failure modes account for most abandoned agent projects:
- Scope too broad. An agent asked to do everything does nothing well. Start narrow, expand from evidence.
- No grounding. An agent answering from the model’s general knowledge will confidently invent details about your business.
- No refusal rules. Deciding what the agent must not answer is as important as what it should.
- Testing only on friendly questions. Your team knows the product too well to ask like a stranger.
- Launch and forget. The conversations are the feedback loop; unread, the agent stays exactly as good as day one.
If the agent’s job is your inbound leads
The highest-leverage home for a first agent is usually the place where prospects already show up with questions: your website. There the agent’s job is concrete: answer what the visitor actually asked, then qualify the lead in the same conversation and hand your team a brief instead of a bare email address. The full method the agent is automating, criteria, questions, handoff, is laid out in the complete guide to qualifying inbound leads.
That is the specific problem pepline is built for: it reads your site and drafts the agent from your content, an approach called AI intake; you review the rules and the voice, and the result replaces the contact form with a conversation that gives answers before it asks for anything.
Skip to a working agent
pepline is the no-code route: point it at your site, it drafts itself from your content, you review the rules and voice, and it goes live behind one script tag. Try the one on our homepage.
Keep reading
Qualifying inbound leads: the complete guide
Every inbound lead arrives with the same two unknowns: is this worth your time, and what do they actually need? Here is the whole method, criteria, place, questions, handoff, measurement, and automation, in the order you should decide them.
What is a conversational agent?
A conversational agent is software that holds a real dialogue with a person: it understands what they mean, keeps track of the exchange, and works toward an outcome. Here is how one works, the forms it takes, and where it earns its place.
AI agent vs chatbot: what is the difference?
The words get used interchangeably, but they describe different things. A chatbot follows a script; an AI agent understands and acts. Here is where each came from, the differences that matter, and how to tell which one a vendor is actually selling you.
What is lead qualification?
Lead qualification is deciding which inbound leads are worth your time, and scoping what they need, before you invest in them. Here are the criteria and frameworks teams use, the vocabulary around them, and how qualification is moving into the conversation itself.
What is MEDDIC?
MEDDIC is a qualification framework for complex B2B sales: six things to establish about a deal before you trust it. Here is what each letter means, where the framework comes from, how the MEDDICC and MEDDPICC variants differ, and where it does and does not fit.
What is BANT?
BANT is the oldest lead qualification framework still in daily use: four checks, Budget, Authority, Need, Timeline, to decide whether a lead is worth pursuing. Here is what each letter really asks, where BANT still works, the honest case against it, and how to run it without interrogating anyone.
Sales qualifying questions: the ones that work
The difference between a lead you understand and a lead you chase is usually four good questions, asked at the right moment. Here is the question bank, grouped by job, with the phrasings that get answers and the order that keeps it from feeling like an interrogation.
Client intake form template: fields, variants, trade-offs
A good intake form collects what your team needs to act on a new inquiry, without losing the inquirer on the way. Here is a copy-ready template, the per-industry variants, and the trade-off every added field carries.
Quote follow-up emails: the three that get replies
You sent the quote, and the client went quiet. Silence is rarely a no; it is a comparison still running, a decider on holiday, or a number that needs digesting. Here are the three follow-up emails that get replies, the timing that works, and the upstream fix that makes ghosting rarer.