Duck
Tutorials6 min read

How to Build Your Own AI Agent (That Actually Works)

Samet Turan— Editor··6 min read

A practical, no-fluff guide for operators who want to build your own AI agent for tasks like lead research or content drafting. Learn the stack, the prompts, and what breaks.

The Core Anatomy of Any AI Agent

You’ve seen the demos. An AI agent is given a complex goal, and it just… figures it out. It looks like magic. It isn’t. Once you pull back the curtain, you’ll find that almost every functional AI agent is just a simple loop running on a few core components. Forget the hype; this is what you actually need to build your own AI agent.

First, you have the Orchestrator. This is the brain. It’s a Large Language Model (LLM) call—think GPT-4 or Claude 3—that decides what to do next. Its entire job is to look at a goal, look at the tools it has, and pick the next logical action. That’s it.

Second, you need State Management. This is the agent’s memory. It’s a way to keep track of what it has already done, what it has learned, and what failed. In the beginning, this doesn’t need to be a fancy vector database. A simple text variable that you append results to is enough. I often just use a single cell in a Google Sheet. The orchestrator reads this state before making its next decision, preventing it from running in circles.

Third, you have the Tools. These are the actions the agent can perform. A tool can be anything you can call via an API: a function to search the web, another to read the content of a URL, one to send an email, or one to look up data in your CRM. The agent doesn’t *do* these things itself; it just decides *which* tool to use and with *what* inputs.

The magic is just a loop: The orchestrator assesses the goal and state, picks a tool, the tool runs, the result is added to the state, and the loop repeats. It keeps going until the goal is met or it hits a failure condition.

What Most “Build Your Own AI Agent” Guides Get Wrong

Most tutorials on this topic are, frankly, misleading. They set operators up for failure by pointing them toward complex, developer-centric frameworks that are total overkill for 99% of business automation tasks. They’re written by developers, for developers, and they miss the point of what an operator actually needs.

The first mistake is pushing frameworks like LangChain or AutoGPT. I’ve tried them. They are brittle, a nightmare to debug, and force you into a rigid structure that’s hard to adapt. You spend more time fighting the framework than building your agent. For most business tasks—like research, drafting, or data entry—a visual automation platform is faster and more reliable. This is my biggest gripe: the assumption that you need to write Python to build an agent. You don’t.

The second error is the obsession with full autonomy. The demos always show an agent completing a massive task with zero human input. In production, this is a liability. The most valuable automations I’ve ever built are semi-autonomous. They handle the repetitive 80% of a task and then create a draft or flag a human for the final 20% decision. This human-in-the-loop approach is far more practical and trustworthy than a black box you hope doesn’t go off the rails.

Finally, they imply you need a complex stack from day one. You don’t need a vector database to start. You don’t need a custom front-end. You can build an incredibly powerful agent with an automation platform, an LLM API, and a Google Sheet.

The No-Code Stack I Actually Use

I’ve built dozens of these systems for my own businesses. My stack is chosen for reliability and ease of debugging, not for being trendy. It’s a simple, powerful combination that gets the job done.

  • Orchestrator: Make.com. I use this over Zapier automations for any agentic workflow. Why? Its looping and error-handling capabilities are vastly superior. Trying to build a stateful loop in Zapier is a painful experience involving expensive, confusing paths. Make’s visual interface lets you see the entire flow, and its Repeater module is built for this kind of work. The Core plan at $29/mo is a fair price for the power you get; the free tier is too limited for real agent builds.
  • LLM: Claude 3 Sonnet via Anthropic’s API. For most structured tasks that require following instructions, I’ve found Sonnet to be more reliable and consistent than GPT-4-Turbo, and it’s significantly cheaper. Its massive context window is also a huge plus for maintaining state over many steps.
  • Tools (APIs): This depends on the task, but a common setup includes:
    • Browserless.io for web scraping. It gives you a headless Chrome browser via an API, which means it can handle JavaScript-heavy sites that would break a simple HTTP scraper. It starts at $50/mo, which feels a bit high, but it saves so much time it pays for itself.
    • Google Sheets for state management and as a data source/destination. It’s free, everyone understands it, and you can visually inspect what the agent is doing. Don’t over-engineer this part.
    • A SERP API like Serper for Google searches. It’s cheap and provides clean JSON results without the risk of getting your IP blocked.

This stack is the foundation for a reliable AI agent framework without writing a single line of server-side code.

A Concrete Example: Building a Lead Research Agent

Let’s make this real. Imagine you want an agent that takes a company domain, finds the CEO’s name, finds a recent news article about the company, and drafts a personalized intro line for a cold email. Here’s how you’d build it in Make.com.

The heart of the agent is the orchestrator prompt. This is what you send to Claude 3 Sonnet in each loop. It’s not a simple question; it’s a detailed set of instructions, including the tools available and the current state.

Here’s a simplified version of the system prompt:

You are an expert research agent. Your goal is to gather specific information about a company and draft a personalized email intro line. You will think step-by-step and use the tools provided.

Your Goal: For the domain {{company_domain}}, find the CEO's name, a URL to a recent news article about the company, and then draft a single, compelling intro sentence for a cold email.

Available Tools:
1. `search_web(query)`: Searches Google for a query and returns the top 3 results (URL and snippet). Use this to find names and articles.
2. `read_url(url)`: Reads the full text content of a given URL. Use this after you've found a promising URL from a search.
3. `finish(ceo_name, news_url, intro_line)`: Call this function ONLY when you have successfully gathered all three pieces of information.

State (what you have done so far):
{{current_state}}

Your task is to decide the very next action to take. Respond with a single JSON object indicating the tool to use and the parameters. Do not add any other text. Example: {"tool": "search_web", "query": "CEO of example.com"}

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

In Make.com, the scenario would look like this:

  1. Trigger: A new row is added to a Google Sheet with a company domain.
  2. Initialize State: Create a text variable called `currentState` and leave it empty.
  3. Repeater Module: Set this to loop a maximum of, say, 8 times. This is your circuit breaker.
  4. Anthropic Module: Send the prompt above, inserting the `currentState` variable.
  5. Parse JSON: Take the LLM’s text response and parse it to extract the tool name and parameters.
  6. Router: A module with multiple paths, one for each tool (`search_web`, `read_url`, `finish`). It directs the flow based on the tool name from the JSON.
  7. Tool Execution: Each path has an HTTP module that calls the relevant API (e.g., Serper for search, Browserless for reading a URL).
  8. Update State: Take the result from the tool (
— 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.