Prerequisites
1
Create an Ardent account
If you haven’t already done so, create an Ardent account.
2
Choose a model
Agents are built on top of AI models, like Anthropic’s Claude or OpenAI’s GPT.
In order to build an Ardent agent, you’ll need to sign up for an account with Anthropic, OpenAI,
or Google Gemini, and get an API key.For this walkthrough, we’ll use Anthropic models. If you’d rather use OpenAI or Gemini, you can
replace any reference to anthropic with openai
or gemini.
3
Add your API key as a secret
This page is not yet complete.
4
Install the Ardent CLI
First, you need to install the Ardent CLI (command-line interface). You can use
the Ardent CLI to set up new projects, develop your agents, and deploy them to the Ardent platform.To download and install the Ardent CLI, run the following command:After the Ardent CLI is installed, you’ll be able to run the
ardent
command from anywhere on your machine.Build your first agent
1
Create a new project
Now that the Ardent CLI is installed, run the following command to create a new agent project:The CLI will ask you to log in to Ardent, and will ask you to provide a name and a folder on your machine
where you want to create your project. Once complete, your project will contain a few files:
- The
src/index.ts
file contains the code that will power your agent. - The
node_modules
folder contains libraries that are used by your agent, including the Ardent SDK. - The
ardent.jsonc
file contains configuration for your agent. - The
package.json
file is used to track libraries and version information for your agent.
We recommend using TypeScript, but it isn’t required. If you’d prefer to use vanilla JavaScript instead,
you can rename
src/index.ts
to src/index.js
.2
Edit your agent
Open your project in your favorite editor, like Cursor or Visual Studio Code.
Open the Right now, your project only has a single source file,
src/index.ts
file and you should see something like this:index.ts
index.ts
. You can structure your code however
you prefer, but every project has to export an instance of the Agent class from
its main entrypoint.By default, the Ardent CLI will expect the entrypoint to be src/index.ts
or src/index.js
,
but you can change this by setting the main field
in your project’s package.json
file.3
Start a dev session
To begin developing your agent, you’ll want to start a dev session. During a dev session,
the Ardent CLI will watch your local files for changes. Every time you save a file, the CLI
will rebuild and deploy your changes to the Ardent platform.To start a dev session, run the following command in your project’s root (the same folder that
contains your Once the dev session starts, open the Ardent app and navigate to the
Agents screen. You should see your new agent listed!
ardent.jsonc
file.)4
Add a tool
Right now, your agent doesn’t do much beyond the base model that you’ve chosen to use. Let’s teach
the agent a new skill!We’re going to create a tool that your agent can call. The tool will request
an article from Wikipedia, and then ask the model to generate a summary of the article’s key points.Update When you save the file, you should see the Ardent CLI say that it’s bundling and uploading your
new agent code to the Ardent platform.
index.ts
with the changes highlighted below:index.ts
5
Create a task
Agents operate on tasks. In the Ardent app, click the Create task button
at the top right of the screen to create a new task for your agent to perform.Then, ask the model something like this:If everything’s working, your agent will request an article from Wikipedia and show you a summary!
6
Deploy your agent
Since you have an active dev session, your agent will be visible to you, but only to you. In order
to allow others in your workspace to use your agent, you need to deploy it.
This creates a new version of your agent which users can select.To deploy your agent, run the following command:Unlike dev sessions, where your agent is constantly redeployed every time you make a change, deployments
are immutable. That means that once a deployment is created, it can’t be changed. You can, however,
create any number of deployments for your agent.