Create your first AI agent and have fun with vibe coding
If you are an entrepreneur or business leader, you likely already recognize the need to automate your processes with AI agents; however, you may not know where to begin.
There are dozens of new AI-powered no-code platforms and thousands of YouTube tutorials that promise AI bliss. However, the industry is still immature, which means that if you have 10 workflows to automate, you may need to subscribe to 5 different SaaS platforms, each with their own supported functionalities, and learn how to use each of them.
Additionally, in a recent blog post, I suggested that the rapid development of AI coding tools means that it may not make sense to limit yourself to no-code tools, even if you are a novice coder. Given that AI can help to write code for you, you should consider low-code or even full-code, too.
This blog post assumes that:
You are a novice coder.
You have many disparate business workflows to automate that require customizations not currently supported by no-code platforms.
After reading this post:
You will be equipped with a general-purpose approach to automate your business workflows with generative AI.
You will have activated a small number of tools that are sufficiently flexible to support a wide range of workflows.
You will have created a custom AI agent using a framework that can be easily extended to many other use cases.
You will have experienced "vibe coding", perhaps for the first time!
General-purpose approach to automate business workflows
Business automation starts with a founder's mindset. In his book about Elon Musk, Walter Isaacson describes Musk's 5-step algorithm for optimizing business productivity. The bottom line: hands-on entrepreneurs must experience and optimize processes manually before they start automating them. Automation comes last.
This rule applies to AI automation. A business process is only worth automating after you've experienced it enough to be able to teach its optimized version to an intern.
The approach to automate business workflows starts from the bottom up and is a simple 4-step process:
Identify a repetitive workflow that you'd like to automate.
Perform the workflow manually enough times to ensure you are clear about the inputs, outputs, and exceptions. You must be clear enough about the process that you should be able to teach it to an intern.
Automate the workflow using the toolkit described below in this post.
Move on to the following workflow.
The actual workflows depend on your specific business needs. You can refer to this previous post for more guidance on identifying them: AI as the Intern.
Here are some common examples:
Go-to-market:
Generation of content ideas and production of social media content.
Newsletter generation.
Marketing lead generation.
Monitoring of competitor and influencer presence on social media.
Data clean-up and population for new marketing leads.
CRM logging and summarization of interactions between customers and the sales team.
Operations:
Data extraction from documents in non-standardized formats.
Standard operating process enforcement: verify that all criteria are met before advancing a dossier, application, or document to the next step.
Conversion of meeting recordings into summaries and assignment of next steps/tasks to team members.
Administrative:
Employee request approvals and tracking.
Preparation of employee performance reviews.
Business expense claims.
Supplier invoice processing.
Recommended toolkit
If your workflows are not supported out of the box by no-code platforms, you must become comfortable with the idea that some coding will be required.
You don't need to train to work as a software developer, but you need to learn enough to guide and utilize AI code generation tools, such as Cursor, Replit, Deepnote, Windsurf, and GitHub Copilot, to implement your projects. If code intimidates you, you need to overcome that situation. This tutorial will help you.
Here is the recommended toolkit to get started with workflow automation:
We will use the following paid tools:
Airtable. AI agents must be able to access a database to read inputs and save outputs. Airtable is a great starting point because it offers an excellent user interface and an easy-to-use API. Visit Airtable to create an account and subscribe to the most affordable plan ("Team"). Create a new base ("My First AI Agent") and visit the Builder Hub to create an API token ("aiforbiznews") with read and write access to that base. Copy the API token; you will need it later. Also, copy the Base ID, that's the string that starts with "app" in the base's URL (for example, appnoVp4rupoSPJFE).
Zapier. Zapier is a no-code service that many entrepreneurs use for automation due to its extensive number of third-party integrations. We will utilize Zapier to seamlessly integrate our AI agents with external services; however, the AI agents themselves will not run within Zapier. Visit Zapier to create an account.
Replit. Replit is where we will generate and run all our custom code. It is a web-based coding app that offers excellent code generation and completion functionalities. Visit Replit to create an account and subscribe to the cheapest plan ("Core"). To use Replit well, you need to learn the basics of Python. If you have never coded before, start with the 5-hour Coursera course "Programming for Everybody (Getting Started with Python)".
OpenAI. This API service offered by ChatGPT's creator provides access to the latest AI models. Visit OpenAI to create an account, purchase a few U.S. dollars of credits, and obtain an API token at https://platform.openai.com/api-keys (copy it, as you will need it later).
Let's create a custom AI agent
To familiarize ourselves with the recommended toolkit, let's create a simple address book management agent.
It works like this: whenever you receive an email from a contact that includes a signature, you can forward the email to the AI agent, which will read its content to create or update your contact database. The AI agent should also be able to process business card scans, which are also sent to it via email.
This type of AI agent is a good illustration of business automation, as many company processes require receiving information from external sources and reformatting it to update company databases. In a world where AI is available, you'd rather just send the information to your AI agent and let it deal with it.
Manual workflow
Before automating the workflow, we must implement it manually in Airtable and document the process.
Create two tables in your base:
The inputs table is where you store incoming data, either in the form of an email body or an email attachment. The inputs table stores the status of each input as well: an input will be retrieved and processed by the AI agent if its status is “Todo”, after which the AI agent will change its status to “Done”.
The contacts table is where you store your address book, with fields such as Full Name, Job Title, Company, Email, Phone, etc.
Play around with Airtable to create tables that look like this:
Then, document your manual workflow. The workflow looks like this:
Store the email body and attachment (business card) in Airtable.
Read the email body and attachment to identify any contact information, and organize it into the relevant fields such as Full Name, Job Title, etc.
Verify existing contacts against the Full Name of each identified contact.
If a contact already exists, update it.
If a contact does not exist, create a new one.
Store email contents into Airtable's “inputs” table
This automation step can be implemented in Zapier using a 2-step workflow that retrieves emails from an email address assigned to you by Zapier and saves their content into Airtable. Don't forget to publish the "Zap".
Refer to the screenshots belo
“Vibe code” the AI agent in Replit
Vibe coding means generating code by giving instructions to an AI coding agent in natural language. It is generally recommended to give instructions bit by bit, so that you can check the code at every step in case the AI hallucinates.
Follow the instructions below.
Start by typing the following instruction in your Replit home page: "Create a Python script that runs continuously with pauses of 15 seconds between runs."
Replit creates an app that looks like this:
Then, you can proceed with the following step-by-step instructions and answer the questions asked by the Replit agent. Along the way, the Replit agent will ask you to provide the API keys. Here are the step-by-step prompts.
First, execute_task should read an Airtable base and collect all records with Status = "Todo". The base_id and table_name will be stored by the ContinuousScript constructor as instance variables. Save the records in the records variable.
For each record in records, parse the content of the "Email Body" field, which is a text field. Leverage OpenAI's API with the model o4-mini and ask the AI assistant to extract all contact information contained in the email body. The result should be saved as a JSON string that contains a list of objects, where each object contains the following keys: Full Name, Job Title, Company, Email, Phone, and Address. If any value is not provided, the value should be an empty string. Save the resulting JSON string into a variable called contact_details.
For each contact in contact_details, check if the Full Name already exists in the "contacts" table of the same Airtable base. If it exists, update the record with the non-empty values of the contact detail. If it does not exist, create a new Airtable record.
In execute_task, the Airtable record may also contain attachments in the "Email Attachment" field. If that is the case, use OpenAI to analyze any attachment that looks like a business card, and extract all contact information from the business card. Return the result as a JSON array containing objects with these exact keys: "Full Name", "Job Title", "Company", "Email", "Phone", "Address". Like the information from the email_body, it should then be synced to the "contacts" Airtable table.
For each record of the "inputs" Airtable table that has been processed, finally update their status to "Done" in the Status field.
This is working, now deploy the app.
In Replit, you should end up with something like the screenshot below. For your reference, the full code is published at this link.
If Replit returns deployment errors, use the Assistant to debug them. For example, in this case, the Assistant suggests changing the deployment type to "background worker".
At this point, your AI Agent is live! If there are bugs, you may need to fix them manually or request that the Replit Agent address them.
Here is the address book generated by the AI agent:
Takeaway messages
You are now equipped with a general-purpose approach and tech stack to automate your business workflows, using Zapier, Replit, Airtable, and OpenAI.
Using vibe coding, you can take it a step further and automate a wide variety of custom workflows, even if they are not supported out of the box by no-code platforms.