Duck
Tutorials8 min read

How to Create an AI Agent That Actually Works

Samet Turan— Editor··8 min read

Learn the practical steps for how to create an ai agent for your business. This guide covers the right tools, prompts, and debugging for real-world automation.

The Core Stack: What You Actually Need

Forget the Python libraries and vector databases for a minute. For 90% of business process automation, your agent stack is simpler and cheaper than you think. You need three things: a brain, a body, and a memory.

1. The Brain (LLM API): This is the language model that does the thinking. Your main choices are OpenAI (GPT models) or Anthropic (Claude models). I’ve run production workloads on both. Right now, I think Anthropic’s Claude 3 Sonnet offers the best performance-to-cost ratio for agentic tasks. It’s smart enough to follow complex instructions and format JSON reliably, but costs significantly less than GPT-4o. You’re paying per API call, so this matters.

2. The Body (Orchestration): This is the tool that connects your agent to the outside world. It listens for triggers (like a new email) and executes actions (like sending a Slack message). Your best bets are Make (formerly Integromat) or Zapier. Zapier is easier for beginners, but its task-based pricing gets expensive fast. I build almost everything in Make.com. Its visual builder is better for complex, multi-step logic, and the pricing is more predictable. The Core plan at $9/month is plenty to start.

3. The Memory (A Database): Your agent needs to remember what it did, what it learned, and what conversations it’s had. Don’t overcomplicate this. A simple Airtable base or even a Google Sheet is a perfect starting point. My gripe is that using Google Sheets as a database feels unprofessional and can be slow, but it absolutely works for a V1 and costs nothing. Airtable is a much cleaner solution and the free plan is generous.

What Most ‘AI Agent’ Guides Get Wrong

Most tutorials on how to create an ai agent are written by academics or developers building theoretical tools. They aren’t written by operators trying to solve a real business problem, like clearing an inbox.

🤖
Recommended Reading

AI Side Hustles

12 Ways to Earn with AI

Practical setups for building real income streams with AI tools. No coding needed. 12 tested models with real numbers.


Get the Guide → $14

★★★★★ (89)

They’ll send you down rabbit holes with frameworks like LangChain or AutoGPT. These are powerful, but they’re massive overkill for structured business tasks. They introduce a ton of complexity and failure points. Building a reliable lead qualifier doesn’t require a Python framework that can browse the web and write its own code. That’s a science project, not a business system.

Most business automation isn’t about open-ended web research. It’s about receiving a piece of data—an email, a form submission, a support ticket—and processing it according to a specific set of rules. The goal is structure and repeatability, not unbounded exploration.

These guides also fail to emphasize the most important part: non-AI guardrails. Simple if/then logic and filters that run *before* the AI ever sees the data are what make an agent safe and reliable. The AI is just one step in the assembly line, not the entire factory.

You don’t need a complex AI agent framework to get started.

Step-by-Step: Building a Lead Qualification Agent in Make.com

Let’s make this concrete. Here’s a common scenario: you have a `leads@mycompany.com` inbox that gets a mix of serious inquiries, spam, and questions. You want an agent to read each email, identify the real leads, extract their info, and tee up a reply.

Here’s the operator playbook for building this in about an hour.

  1. The Trigger: Watch Emails. In Make.com, the first module is a trigger. Use the ‘Watch Emails’ module for Microsoft 365 or Gmail. Set it to run every 15 minutes on your leads inbox.
  2. The Guardrails: Simple Routers. Before you even think about AI, add some Routers. These are simple filters. Router 1: If subject line contains ‘unsubscribe’ or sender is on a blocklist, stop the process immediately. Router 2: If the email content mentions ‘invoice’ or ‘support ticket’, forward it to your support tool and stop. This prevents your sales agent from trying to reply to a billing question.
  3. The Brain: The First LLM Call. Now, for the emails that pass the guardrails, send the body text to an LLM. Use the OpenAI or Anthropic module in Make. This is where the prompt engineering happens. Don’t just ask it to ‘summarize the email’. Give it a specific job and a required output format.

Here’s a prompt that actually works:

<prompt>
You are a B2B sales development representative's assistant. Your task is to analyze inbound emails to identify and qualify potential leads. Read the following email content and extract the information into a structured JSON object.

The JSON object must have these exact keys:
- lead_name (string or null)
- company_name (string or null)
- summary (a one-sentence summary of their request)
- urgency ('high', 'medium', 'low')
- qualification_status ('hot', 'warm', 'cold', 'not_a_lead')

Here is the email content:
---
{{email_body_text}}
---

Return only the JSON object and nothing else.
</prompt>

4. The Memory: Log to Airtable. The LLM will return a JSON string. Use Make’s ‘Parse JSON’ module to turn it into usable data. Then, use the ‘Create a Record’ module for Airtable. Map the data from the LLM directly to fields in your ‘Leads’ table. This is my favorite part of the process. The moment that messy, unstructured email becomes a clean, structured row in a database is magical. You now have a permanent, searchable log of every lead processed.

5. The Action: Draft a Reply. Add another LLM module. This time, the prompt will use the structured data from Airtable to generate a personalized reply. For example: `”Draft a friendly, concise reply to {{lead_name}} from {{company_name}} about their request: ‘{{summary}}’. Acknowledge their request and tell them our team will follow up within 24 hours.”` The crucial step here is to connect the output not to an email sending module, but to a ‘Create a Draft’ module in Gmail or Outlook. Never let an agent send an email without human review, at least not until you’ve watched it run for weeks and trust its judgment completely.

Is a No-Code AI Agent Framework Better?

You might see ads for platforms like Voiceflow or Botpress that promise ‘no-code AI agents’. So, are they a better choice? It depends on the job. These tools are primarily designed for building conversational agents—chatbots for your website or automated customer service flows. They excel at managing conversational state and dialogue trees.

But for back-office process automation like our lead qualification example, they often add an unnecessary layer of complexity and cost. You’re working within their interface, their logic, and their pricing model. Honestly, paying $199/mo for a platform to do what Make.com and a direct API call can do is ridiculous for most solo operators. You have less control over the prompts, the data logging, and the integration points. Stick with a more fundamental orchestration tool like Make; you’ll have more power and a much lower bill.

How to Debug When Your Agent Goes Haywire

Your agent will break. It’s not a matter of if, but when. The difference between a toy and a production system is how you handle failures. Here are the three most common failure modes and how to fix them.

1. The LLM Returns Garbage: Sometimes the model ignores your instructions and doesn’t return valid JSON. This will cause your ‘Parse JSON’ module in Make to fail. The fix is to add an error handler route to that module. If the parsing fails, have the error handler send you a Slack message or an email containing the raw, broken output from the LLM. This way, you’re immediately notified of the problem and have the exact data you need to debug the prompt. Don’t let failures happen silently.

2. The Agent Does the Wrong Thing: It misclassifies a lead, pulls the wrong name, or drafts a bizarre response. This is why Step 4 (logging to Airtable) is non-negotiable. Your Airtable base is your flight recorder. When you see a mistake, you can go to that record and see the exact email input and the exact structured data the LLM produced. 99% of the time, the fix is to tweak your prompt with a new instruction to handle that specific edge case.

3. The API Bill is Terrifying: A busy inbox can lead to thousands of API calls. If you’re using an expensive model like GPT-4o for every single email, the costs can spiral. The solution is to use a tiered model approach. Use a cheap, fast model like Claude 3 Haiku for the initial triage and JSON extraction (the first LLM call). It’s good enough for classification. Then, only for the leads that are classified as ‘Hot’ or ‘Warm’, do you use the expensive, sophisticated model to draft the high-quality, client-facing reply (the second LLM call). This can cut your costs by 70-80% without sacrificing quality where it matters.

Building an AI agent isn’t about finding some magic-bullet software. It’s about combining a few simple, powerful tools in a logical sequence and obsessively logging the results. The steps above are the blueprint for a reliable system that can save you hours every single week.

For more on this exact angle, deeper coverage of AI agent platforms.

If you’d rather skip the build and deploy a working version in an afternoon, we’ve packaged this entire workflow as a pre-built AI automation blueprint. It includes the Make.com scenario, the Airtable base template, and the exact prompts we use in production. You can get it 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.