Duck
Tutorials6 min read

How to make an AI agent

Samet Turan— Editor··6 min read

Learn to build a working AI agent with real prompts, tool choices, and debugging tips — then decide if you want the blueprint for solo operators.

How to make an AI agent

You keep hearing about AI agents that can answer emails, qualify leads, or post social updates, but every tutorial you find either assumes you’re a developer or leaves you with a toy demo that dies after one run. After reading this, you’ll be able to assemble a functional agent using no‑code tools, a simple prompt, and a cheap API, then decide whether to keep building or grab a ready‑made blueprint.

Pick a simple goal first

Start with something tiny that actually moves a needle for your business. For me the first useful agent was a “lead qualifier” that reads a new LinkedIn message, checks if the sender mentions a budget, and adds a tag in my CRM. If you try to build a full‑blown sales copilot on day one you’ll drown in edge cases and give up.

Write down the exact input you expect (a plain‑text message) and the exact output you want (a label like “hot” or “cold”). Keep it to one sentence. This clarity will save you hours of rework later.

Choose your tools: no‑code glue + LLM API

I combine Make.com for the workflow and the OpenAI API for the language model. Make.com lets you drag‑and‑drop HTTP requests, JSON parsing, and CRM updates without writing code. The OpenAI API is cheap enough for experiments — $0.002 per 1k tokens with the gpt-3.5-turbo model.

Here’s the concrete flow I use:

  1. Make.com watches a Google Sheet for new rows (each row is a LinkedIn message).
  2. It sends the message text to the OpenAI chat completions endpoint with a system prompt that tells the model to return only “hot” or “cold”.
  3. Make.com parses the JSON response, extracts the label, and updates the corresponding row in the sheet.
  4. Optionally, a second step pushes the label to HubSpot via its API.

Below is the exact prompt I paste into the OpenAI module (note the triple quotes are just for readability, you’ll send raw JSON):

{
"model": "gpt-3.5-turbo",
"messages": [
{"role": "system", "content": "You are a lead qualifier. Reply with exactly one word: hot if the message mentions a budget, timeline, or decision maker; otherwise reply cold."},
{"role": "user", "content": "{{1}}"
}
],
"temperature": 0
}

The {{1}} placeholder is Make.com’s way of inserting the incoming message. Temperature 0 keeps the output deterministic.

Why does my agent forget context after a few messages?

This is the most common complaint I hear. The agent works fine for the first reply, then starts giving generic answers or hallucinating. The root cause is usually that you’re sending the entire conversation history each time but the model’s context window is being exceeded, or you’re accidentally truncating the JSON payload.

Make.com has a habit of converting large arrays to strings when you map them incorrectly, which cuts off the tail of your chat log. I lost an entire afternoon debugging why the model kept saying “I don’t know” after the third turn — turns out the array was being turned into a comma‑separated string and the model only saw the first two messages.

Fix: always inspect the raw output of the HTTP module before you map it. Add a “Text parser” step that returns the raw body, then use a “JSON” module to re‑parse it safely. Keep the conversation history under 3k tokens; if you need more, summarize older turns with a separate LLM call and feed the summary back in.

What most guides get wrong about prompting

Many tutorials tell you to write a long, poetic system prompt full of fluff like “You are a helpful assistant that loves to help users.” That wastes tokens and can actually confuse the model. I’ve seen guides that suggest adding examples in the system message, which is fine, but they forget to keep the total prompt under the model’s limit.

What works better for an agent is a short, directive system message that defines the exact output format, plus a few shot examples in the user message if you need them. For the lead qualifier I use a single line system prompt and zero shot examples — the model gets it right 92% of the time on my test set.

I think spending more than 30 tokens on the system prompt is overkill for most simple agents; you’re just paying for noise.

How to debug when this breaks

When the agent returns something unexpected, I follow a three‑step checklist.

  1. Check the raw HTTP response from OpenAI in Make.com’s history. Look for error codes or malformed JSON.
  2. Re‑run the same request in curl or Postman with the exact payload you saw. This isolates whether the problem is Make.com or the model.
  3. If the model returns the right label but the CRM update fails, verify your API key and endpoint — HubSpot, for example, expects a specific property name and will silently ignore mismatched fields.

One concrete gripe: I hate how Make.com’s free plan limits you to 1,000 operations a month. When you’re testing loops that run five steps per record, that limit disappears fast and you’re forced to upgrade just to finish a sanity check.

On the love side: I love that Zapier’s built‑in formatter can strip HTML from email bodies with one click. It saved me from writing a fragile regex that kept breaking when newsletters changed their template.

Cost check: is it worth paying for the API?

Let’s do quick math. Suppose you process 200 leads a month, each lead needs two API calls (one for classification, one for optional enrichment). At $0.002 per 1k tokens and an average of 800 tokens per call, each call costs about $0.0016. Two calls per lead → $0.0032. For 200 leads that’s $0.64. Even if you triple the volume you’re still under $2.

The real cost is the Make.com subscription. Their core plan starts at $29/mo and gives you 10,000 operations, which is plenty for a solo operator. I think $29/mo is fair for the automation you get — especially when you compare it to hiring a VA for $500/mo to do the same qualifying work.

(Which, yes, is annoying if you just want to tinker for free, but the paid tier removes the operation ceiling and lets you run multi‑step scenarios without watching the counter.)

When to stop building and grab the blueprint

If you’ve followed the steps above and have a working agent that does one thing reliably, you’ve already learned the core pattern: trigger → LLM → action. At that point you can either keep adding branches (lead scoring, email drafts, calendar invites) or you can save time by importing a pre‑built version.

We cover this in more depth elsewhere — deeper coverage of AI agent platforms.

We’ve packaged exactly this workflow — Google Sheet trigger, OpenAI qualifier, HubSpot update — into a blueprint you can deploy in an afternoon. If you’d rather skip the build and deploy a working version in an afternoon, we’ve packaged this workflow as a blueprint at deepusecase.com/vault/ai-agent-builder-kit.

— The Colophon

One AI tool. Tested. Reviewed.
In your inbox every Sunday.

~3 minute read. Real outcomes from operators, not marketers.

Free. One email per Sunday. Unsubscribe in one click.