---
title: 'How to Build an AI Agent in UiPath (Step-by-Step Tutorial)'
source: 'https://youtube.com/watch?v=6jCyXyuugV0'
video_id: '6jCyXyuugV0'
date: 2026-08-12
duration_sec: 675
---

# How to Build an AI Agent in UiPath (Step-by-Step Tutorial)

> Source: [How to Build an AI Agent in UiPath (Step-by-Step Tutorial)](https://youtube.com/watch?v=6jCyXyuugV0)

## Summary

This video is a step-by-step tutorial on building an AI agent in UiPath. It demonstrates creating an agent that takes a request, evaluates options, and recommends the best fit, using a cookie-selection example. The process starts with the UiPath CLI and culminates in testing in UiPath's visual environment.

### Key Points

- **Why AI Agents?** [00:00] — Traditional automation is for repetitive tasks; AI agents are needed for judgment-based tasks like evaluating info or making recommendations.
- **Cookie Selector Agent** [00:59] — Example use case: recommending a cookie based on a request like 'chocolatey, but not too sweet' from a list of options.
- **Node.js Requirement** [01:45] — Ensure Node.js v18+ is installed; verify with 'node -v'.
- **Install UiPath CLI** [02:13] — Install UiPath CLI with 'npm install -g uipath-cli' (command not explicitly given in transcript, but implied). Verify with 'uipath --version'.
- **Install Agent Tool** [02:43] — Install the agent tool and optionally install UiPath skills for coding agents like Claude or Copilot.
- **Authenticate** [03:30] — Authenticate CLI with 'uipath login' to connect to your UiPath account.
- **Create Solution** [03:44] — Create a working folder and then a new solution with 'uipath solution create [name]'. The solution is the container for the agent.
- **Create Agent Project** [04:15] — Create the agent project inside the solution with 'uipath project create' (commands not exactly provided).
- **Configure agent.json** [05:06] — Edit agent.json to define input schema, output schema, and system prompt. The input includes user request and options; output is the recommended cookie.
- **Configure entrypoints.json** [06:52] — Edit entrypoints.json to expose the same inputs and outputs to the solution runtime; schemas must match.
- **Validate Agent** [07:22] — Validate the agent with 'uipath validate' (command might be different) to ensure definitions are correct.
- **Upload and Test** [07:50] — Upload the solution to UiPath Studio Web with an 'upload' command, then open the designer URL to test visually.
- **Testing the Agent** [08:49] — In Studio Web, test the agent by providing sample JSON input; the agent returns the best match. Example: 'chocolatey but not too sweet' returns 'chocolate chip'.
- **Improving the Agent** [09:34] — Improve the agent by refining the system prompt and using evaluation tools to run multiple test cases.
- **Visual Alternative and Integration** [10:06] — You can also build agents visually in UiPath's agent builder, and integrate them into workflows with UiPath Maestro.

## Transcript

In this video, I'll show you step by step how&nbsp; to build an AI agent in UiPath from scratch.&nbsp;&nbsp; Some tasks follow the same steps every time, which&nbsp; makes them a great fit for traditional automation,&nbsp;&nbsp;
but other tasks require judgment. You might need&nbsp; to evaluate information, make a recommendation,&nbsp;&nbsp; or decide between multiple different options.&nbsp; That's where AI agents come in. We'll build an&nbsp;&nbsp; AI agent that takes a request, evaluates a&nbsp; list of options, and selects the best fit.&nbsp;&nbsp;
We'll do everything from the command line and then&nbsp; bring the agent into UiPath's visual environment&nbsp;&nbsp; so you could test it and see how it works. There&nbsp; are multiple ways to build AI agents in UiPath,&nbsp;&nbsp; and later I'll show you the visual approach. By&nbsp; the end of this video, you'll have a fully working&nbsp;&nbsp;
agent that you can adapt for your own use cases.&nbsp; I'm Kevin, and this video is sponsored by UiPath,&nbsp;&nbsp; who helped support this tutorial. Let's dive&nbsp; in. For this example, we're going to build a&nbsp;&nbsp; simple agent that takes a request and recommends&nbsp; the best option. To keep things easy to follow,&nbsp;&nbsp;
we'll use cookies. For example, if someone says,&nbsp; "I want something chocolatey, but not too sweet,"&nbsp;&nbsp; and the options are chocolate chip, double&nbsp; chocolate, oatmeal raisin, and sugar cookie,&nbsp;&nbsp; the agent should pick chocolate chip. That's a&nbsp; simple example, but the same pattern could apply&nbsp;&nbsp;
to many real-world scenarios, like, let's say,&nbsp; routing support tickets, recommending products,&nbsp;&nbsp; or selecting the best option in a workflow. All&nbsp; right, let's go ahead and build this step-by-step,&nbsp;&nbsp;
starting with the command line. First, we need to&nbsp; install the UiPath CLI, or command line interface,&nbsp;&nbsp; which is what we'll use to build and manage our&nbsp; agent from the command line. I'm using VS Code,&nbsp;&nbsp; which is free to download and use. I've included&nbsp; a link below, but really, any terminal will work.&nbsp;&nbsp;
In VS Code, start out by opening a new terminal,&nbsp; and then set the type to git bash. Next, we need&nbsp;&nbsp; to make sure that you have Node JS version 18 or&nbsp; later installed for this. If you don't have it,&nbsp;&nbsp;
you can install it at the link that I've included&nbsp; in the description, and then once you install it,&nbsp;&nbsp; reopen VS Code. Once you have it installed, run&nbsp; this command right here to check the version that&nbsp;&nbsp; you have. I'll run this, and there you can see&nbsp; that I have at least version 18 or later. Now,&nbsp;&nbsp;
as a note, you'll find all the commands that I&nbsp; run in the description of this video. So that way,&nbsp;&nbsp; you could just copy and paste it from there. Now,&nbsp; let's install the UiPath CLI and agent tool. I'll&nbsp;&nbsp; type in this command and then hit Enter. Once&nbsp; that's installed, we can verify everything worked&nbsp;&nbsp;
by checking the version. I'll type in this command&nbsp; and then hit Enter. And right there, I can see&nbsp;&nbsp; version 1.1.1. If you see a version number, you're&nbsp; good to go. Next, we'll install the agent tool,&nbsp;&nbsp; which adds the commands we need to create and&nbsp; manage our agent. I'll type this in and then run&nbsp;&nbsp;
it. Now, run the following command to ensure that&nbsp; it was successfully installed. And right here,&nbsp;&nbsp; it looks like it was successful. As an optional&nbsp; step, if you're using a coding tool like Claude,&nbsp;&nbsp; Copilot, Cursor, alongside the CLI, you can&nbsp; install UiPath skills for coding agents to&nbsp;&nbsp;
give it context on agent projects and commands.&nbsp; This can make it easier to build and troubleshoot&nbsp;&nbsp; your agent, but of course, it's not required.&nbsp; Everything we're doing here will work without it.&nbsp;&nbsp; If you want to use it, you can run the following&nbsp; command right down here and simply replace the&nbsp;&nbsp;
agent name with whatever tool you're using. Now,&nbsp; in my case, I happen to be using Codex, but you&nbsp;&nbsp; can replace that with Claude, Cursor, Copilot, or&nbsp; Gemini. Here, I'll run it. Right up above, I could&nbsp;&nbsp; see that it's successfully installed all of these&nbsp; different skills. Before we create our agents, we&nbsp;&nbsp;
need to authenticate the CLI so it could connect&nbsp; to your UiPath account. Right down here, enter in&nbsp;&nbsp; the following command to log in. This will open up&nbsp; a browser where you could sign in and select your&nbsp;&nbsp; tenant if needed. If you don't have one, you could&nbsp; also sign up for the free community edition. Now&nbsp;&nbsp;
that we're signed in, let's create the solution&nbsp; and the agent. In UiPath, the agent lives inside&nbsp;&nbsp; a solution. The solution is the container that&nbsp; we'll eventually upload into Studio Web. Now,&nbsp;&nbsp; as a first step, let's create a working folder.&nbsp; I'll call mine Cookie Agent. Now, feel free to&nbsp;&nbsp;
use the same name if you'd like to follow along,&nbsp; or you could use your own name. Here, I'll create&nbsp;&nbsp; that directory and then let's move into it. Next,&nbsp; create a new solution. In my case, I'll call it&nbsp;&nbsp; Cookie Selector. Now again, if you want to follow&nbsp; along, feel free to copy, or you could use your&nbsp;&nbsp;
own name. Then run it. This creates the solution&nbsp; structure, including the solution manifest that&nbsp;&nbsp; UiPath needs when we upload everything later.&nbsp; Now, let's create the solution project inside the&nbsp;&nbsp; solution. Here, I'll type in this command. Now,&nbsp; the first Cookie Selector is a solution folder,&nbsp;&nbsp;
and the second Cookie Selector is the agent&nbsp; project inside the solution. Now, run it.&nbsp; Let's now move into the solution folder. I'll&nbsp; type in this command, and then from here,&nbsp;&nbsp; we'll configure the agent by editing the JSON&nbsp; files directly. Now, let's configure how our&nbsp;&nbsp;
agent works. Over on the left-hand side, let's&nbsp; open the Explorer, and then navigate to where&nbsp;&nbsp; you have your project files. Here, you'll see&nbsp; the cookie agent working folder, the solution,&nbsp;&nbsp; and then the project, and all of the associated&nbsp; files. The agent is defined in two files. We have&nbsp;&nbsp;
the agent.json and entrypoints.json.&nbsp; Agent.json controls the agent itself,&nbsp;&nbsp; including the model settings, system prompt, input&nbsp; schema, output schema, and the message structure.&nbsp;&nbsp;
Entrypoints.json exposes the same inputs and&nbsp; outputs to the solution runtime. The important&nbsp;&nbsp; thing is that the input and output schemas need&nbsp; to match in both of these files. For this example,&nbsp;&nbsp; we're building a cookie recommendation agent.&nbsp; It'll take a user request, look at a list of&nbsp;&nbsp;
cookie options, and return the best match.&nbsp; Let's start by opening the agent file right&nbsp;&nbsp; here. I'll double-click on this, and let's adjust&nbsp; the size so we can see the JSON file better. We're&nbsp;&nbsp; going to replace the contents of this JSON file&nbsp; with the version linked in the description below.&nbsp;&nbsp;
So over here, I'll highlight all this content, go&nbsp; all the way to the bottom. However, I'm going to&nbsp;&nbsp; leave the project ID here. This was generated by&nbsp; the scaffold, since this value will be unique to&nbsp;&nbsp; your project. I'll remove this and then paste in&nbsp; the JSON file from the description. Let's take a&nbsp;&nbsp;
moment to look at this JSON file. Now, this file&nbsp; controls how the agent works, and there are really&nbsp;&nbsp; three main areas to pay attention to. Right here&nbsp; at the top, we have the input schema, and this&nbsp;&nbsp; defines what data the agent expects. In this case,&nbsp; the user is going to describe the type of cookie&nbsp;&nbsp;
that they would like, and we also give a list of&nbsp; cookie options to choose from. Now, if we scroll&nbsp;&nbsp; down a little bit more, here we have the output&nbsp; schema, and this defines what the agent returns.&nbsp;&nbsp; So based on their request for a cookie, the agent&nbsp; will provide a cookie that it recommends. Now,&nbsp;&nbsp;
if we scroll down just a little bit more, here we&nbsp; have this system prompt that tells the agent what&nbsp;&nbsp; to do. Next, let's open up the entrypoints.json&nbsp; file right over here. Here too, we'll replace the&nbsp;&nbsp; contents of this JSON, but we're going to keep the&nbsp; unique ID that was generated by the scaffold. So&nbsp;&nbsp;
right over here, I'll highlight all this content,&nbsp; and here I'll paste in the new content. Again,&nbsp;&nbsp; you'll find this in the description. This makes&nbsp; the same input and output schema available to the&nbsp;&nbsp; solution. If you adapt this for your own use case,&nbsp; the main things to update are the system prompt,&nbsp;&nbsp;
the input fields, and the output fields. Just&nbsp; make sure that the schema matches in both the&nbsp;&nbsp; agent.json and entrypoints.json files. Before&nbsp; we're continuing, make sure to save both the&nbsp;&nbsp; agent.json and entrypoint.json files to capture&nbsp; all the changes that we made. Before we upload&nbsp;&nbsp;
this, let's validate the agent and make sure that&nbsp; everything is set up correctly. In my terminal,&nbsp;&nbsp; I'm currently in the working folder, so&nbsp; let's change into the solution folder.&nbsp; Now, let's run the following command to validate&nbsp; the agent. Right up above, let's expand the&nbsp;&nbsp;
terminal so we can see the output better. This checks that the agent definition, inputs&nbsp;&nbsp; and outputs and entry points are all valid. Now,&nbsp; right up here, I can see the result says success,&nbsp;&nbsp; so that looks good. Now that the validation has&nbsp; passed, we're ready to upload the solution to&nbsp;&nbsp;
UiPath Studio Web. To upload the solution, run&nbsp; the following command in the solution folder.&nbsp;&nbsp; This uploads the solution into UiPath&nbsp; Studio Web as an editable project. Now,&nbsp;&nbsp;
once the upload finishes, if you scroll up towards&nbsp; the top, here you should see a message saying,&nbsp;&nbsp; result success, that's great. Now, right below&nbsp; that, we also have what's called the designer URL.&nbsp;&nbsp; You can open that link directly in your browser.&nbsp; Let's click here. This is where UiPath bridges&nbsp;&nbsp;
the gap between code and low code. We built the&nbsp; agent from the command line and now we can open&nbsp;&nbsp; it visually in Studio Web to test it, inspect it&nbsp; and continue iterating. Once Studio Web opens,&nbsp;&nbsp; you should see the agent in the agent builder.&nbsp; Over on the right-hand side, you'll see the system&nbsp;&nbsp;
prompt, along with the request and options inputs&nbsp; that we defined earlier. To test it, in the top&nbsp;&nbsp; left-hand corner, let's click on debug. Here, we&nbsp; can pass in sample input as JSON. So right here,&nbsp;&nbsp; I'll paste in something like this. Here we have&nbsp; the request, I want something chocolatey, but not&nbsp;&nbsp;
too sweet. And then I pass in all the different&nbsp; options. Once you finish entering this in, in the&nbsp;&nbsp; bottom right-hand corner, let's click on save and&nbsp; debug and that'll run the agent. Once it finishes,&nbsp;&nbsp; we provided, and down below, we can see the&nbsp; output with the cookie it thinks is the best&nbsp;&nbsp;
match. And in this case, it looks like it's&nbsp; chocolate chip. You can try different inputs&nbsp;&nbsp; here to see how your agent behaves and refine&nbsp; the prompt over time. Let's try again. Let's go&nbsp;&nbsp; back up to debug and click on that again. Right&nbsp; down below, let's now change the request. So,&nbsp;&nbsp;
this time, let's say I want something classic&nbsp; with raisins and oats. Now I would expect it to&nbsp;&nbsp; let's now save and debug. And right over here,&nbsp; it returns oatmeal raisin, just like we expected.&nbsp;&nbsp;
Now, of course, this is a really simple example,&nbsp; but the same pattern can apply to many business&nbsp;&nbsp; scenarios where you need to choose the best option&nbsp; based on a request. Now that we tested our agent,&nbsp;&nbsp; let's look at how to improve it over time. As you&nbsp; try different inputs, watch the outputs and adjust&nbsp;&nbsp;
your system prompt if needed. You can make the&nbsp; prompt more specific or add constraints to guide&nbsp;&nbsp; the result. UiPath also includes evaluation tools&nbsp; to run multiple test cases and track performance.&nbsp;&nbsp; Over time, you can iterate on your prompts to make&nbsp; the agent more reliable in real workflows. Now,&nbsp;&nbsp;
I want to show you something. Everything we just&nbsp; built from the command line can also be built&nbsp;&nbsp; directly in UiPath's agent builder. You can define&nbsp; your prompt, configure inputs and outputs and test&nbsp;&nbsp;
your agents all from visual interface. Now, this&nbsp; could be a great option if you want to prototype&nbsp;&nbsp; quickly or maybe you just prefer a low-code&nbsp; experience. Whether you like working in code,&nbsp;&nbsp; a visual builder, maybe just a mix of both,&nbsp; UiPath gives you the flexibility to build&nbsp;&nbsp;
the way that works the best for you. Once&nbsp; you've built your agent, the next step is&nbsp;&nbsp; integrating it into larger workflows across&nbsp; UiPath using something called UiPath Maestro.&nbsp;&nbsp; Maestro lets you orchestrate agents as part&nbsp; of the end-to-end workflows, passing data in,&nbsp;&nbsp;
receiving decisions back and coordinating work&nbsp; across people, systems, and AI. I have a full&nbsp;&nbsp; video on UiPath Maestro if you'd like to learn&nbsp; more. You'll find a link right down below in the&nbsp;&nbsp; comments and also in the description. Let me know&nbsp; in the comments if you have any questions or what&nbsp;&nbsp;
you'd like to see next. If you want to go deeper,&nbsp; check out the UiPath playlist right there on the&nbsp;&nbsp; screen for more step-by-step tutorials. Thanks&nbsp; for watching and I'll see you in the next video.
