The nature of work is evolving. Repetitive digital tasks that once consumed countless human hours are now prime candidates for intelligent automation. We're moving beyond simple scripts and into the era of autonomous AI agents—your own scalable, on-demand digital workforce.
At bots.do, we provide the platform to build, deploy, and manage these agents. These aren't just chatbots; they are digital workers capable of reasoning, planning, and executing complex business workflows.
This guide will walk you through building your very first digital worker—a Customer Support Agent—using the bots.do SDK. You'll see just how simple it is to turn a business process into a fully autonomous service.
Before we dive into the code, let's clarify what we're building. A bots.do agent is an autonomous digital worker designed to achieve a specific goal. Unlike traditional chatbots that follow a rigid, predefined script, our agents operate on a flexible agentic workflow.
This means they can:
Think of it as hiring a new team member, defining their role, giving them access to the right software, and letting them get to work.
To get started, you'll need the bots.do SDK. It's available via npm for your TypeScript or JavaScript projects.
First, install the SDK into your project:
npm install @do/sdk
Next, you'll need an API key. You can get yours by signing into your account on the bots.do platform. Once you have your key, you can initialize the SDK client.
We're going to create a CustomerSupportAgent. The mission is simple: resolve customer issues efficiently and accurately. To do this, we need to define its goal and equip it with the right tools.
The goal is the most critical piece. It's the core directive that guides all of the agent's actions. It needs to be clear and comprehensive. For our support agent, a powerful goal would be:
"Resolve customer support tickets by analyzing ticket content, searching the knowledge base for relevant information, and providing a helpful, complete response to the customer."
This goal tells the agent what to do, not how to do it. The agent will figure out the "how" on its own.
Tools are the agent's capabilities. In the bots.do ecosystem, a tool is simply an API endpoint that the agent can call. For our Support Agent to be effective, it will need access to a few key systems:
By providing these tools, you are giving your agent the "permissions" it needs to do its job from end to end.
With the goal defined and the tools identified, it's time to bring your digital worker to life with just a few lines of code.
Here is the complete TypeScript code to create and deploy your new CustomerSupportAgent:
import { bots } from '@do/sdk';
// Ensure your API key is configured in your environment
async function deploySupportBot() {
console.log('Deploying a new Customer Support Agent...');
// Create a bot by defining its name, goal, and tools
const supportBot = await bots.create({
name: 'CustomerSupportAgent',
goal: 'Resolve customer support tickets by analyzing ticket content, searching the knowledge base, and providing a helpful response.',
tools: ['knowledgeBase.search', 'tickets.update', 'email.send']
});
console.log('✅ New Support Bot Deployed! ID:', supportBot.id);
console.log('This bot is now available as an API endpoint to handle tasks.');
}
deploySupportBot();
When you run this code, the SDK communicates with the bots.do platform. It registers your new agent, making it a live, callable endpoint. The console will output the unique id for your bot—this is how you will interact with it from now on.
Your bot is deployed, but how do you use it?
Your newly created agent is now a service. You can trigger it by making an API call to bots.do, referencing your bot's ID, and giving it an input—like the details of a new support ticket.
For example, when a new ticket arrives in your system, you could trigger your bot like this (conceptual example):
// A new ticket comes into your system...
const newTicket = {
id: 'TICKET-78910',
customerEmail: 'sara@example.com',
query: 'How do I add a team member to my account?'
};
// ...you send the task to your bot
const taskResult = await bots.run({
botId: 'bot_xxxxxxxxxxxx', // The ID from the previous step
input: {
ticketId: newTicket.id,
ticketQuery: newTicket.query
}
});
console.log(`Task for ticket ${newTicket.id} status: ${taskResult.status}`);
The bots.do platform will now activate your agent. It will:
All of this happens autonomously, turning a manual process into a scalable, on-demand service.
You've just seen how to build and deploy a sophisticated AI agent in minutes. Imagine the possibilities:
If a task can be defined by a goal and executed with digital tools, you can build a bot for it.
Ready to build your digital workforce?