how to build AI agents for client tasks
Last month I needed to automate a client’s lead follow‑up sequence without hiring a developer.
By the end of this article you’ll have a working agent that can draft emails, update a CRM, and flag hot leads—all driven by a single prompt.
You’ll see the exact prompts, tool choices, and where things usually break, plus a quick path to a ready‑made blueprint.
What most guides get wrong about AI agent building
Most tutorials treat the agent as a magic black box that just “works” once you plug in an API key.
They skip the part where you have to define clear boundaries for what the agent can and cannot do.
That leads to hallucinations, endless loops, or the agent sending the same email three times.
I learned this the hard way when my first prototype kept offering a discount that didn’t exist.
The fix isn’t more prompting—it’s giving the agent a strict schema and a fallback rule.
Think of the agent as a junior employee: you give it a checklist, a script, and a manager who steps in when it’s unsure.
How I picked the tools (real named example)
I started with LangChain because it lets you chain prompts, tools, and memory in a readable way.
For the CRM I used Airtable—its free tier offers enough records for a solo operator and the API is straightforward.
To handle the email sending I hooked into Make.com (formerly Integromat) which provides a visual workflow builder and webhook endpoints.
The language model is the OpenAI API with the gpt-4o model; temperature set to 0.2 for consistency.
Here’s the core prompt I use, stored as a LangChain template:
You are a lead‑follow‑up assistant for {{client_name}}.
Your goal: draft a personalized reply, log the interaction in Airtable, and flag any lead that shows buying intent.
1. Read the latest inbound email from {{lead_email}}.
2. Extract the lead’s name, company, and any mention of budget or timeline.
3. If the email contains a question about pricing, reply with our standard price sheet and ask for a meeting.
4. If the email shows clear buying intent (e.g., "Let’s move forward"), set the Airtable field "Hot Lead" to true.
5. Otherwise, draft a friendly, short reply that references a specific detail from their message.
6. Output JSON with keys: "reply", "update_fields" (Airtable fields to change), "flag_hot" (true/false).
Do not add any extra text outside the JSON.
Notice how the prompt forces a JSON output—this makes it easy to parse in the next step.
In Make.com I set up a webhook that receives the JSON, then runs two actions:
- Update the Airtable record with the fields from “update_fields”.
- Send an email via Gmail using the “reply” string.
The whole chain runs in under five seconds.
Cost breakdown:
- LangChain is open‑source—free.
- Airtable free tier: $0 (up to 1,200 records).
- Make.com free plan: $0 but limited to 1,000 operations/month; I upgraded to the $9/mo plan for 10,000 operations.
- OpenAI API: roughly $0.006 per 1k tokens; with ~800 tokens per run that’s about $0.005 per execution.
At 100 runs a day the API cost is about $15/mo.
I think the $9/mo Make.com plan is a fair price for the reliability it gives—especially when the free tier blocks webhook access, which forced me to upgrade after just two test runs.
