Agents are the foundation of the Ardent platform. Fundamentally, an agent is a combination of a model (Claude, GPT, Gemini, etc.) and a set of capabilities that the agent can decide to use to help solve problems for an operator.

Your first agent

You can write an Ardent agent using TypeScript (or JavaScript, if you prefer). To build an agent, you’ll need to use the Ardent SDK. Here’s an example of a simple agent, which uses Anthropic’s Claude model and has a basic set of instructions:
index.ts
import { Agent, anthropic } from '@ardent-ai/sdk';

const agent = new Agent({
  model: anthropic(),
  instructions: 'You are a helpful assistant.'
});

export default agent;
After you build your agent, you’ll need to use the Ardent CLI to deploy it to the Ardent platform. Then, you (and anyone else in your workspace) can interact with the agent using the Ardent app.
For a full walkthrough of creating an agent, follow the quick start.

Adding capabilities

By itself, an agent doesn’t add much to the base model that it’s using. The real value of agents is unlocked by adding capabilities. Agents can have several kinds of capabilities:
  1. Tools, custom executable functions that your agent can call
  2. Prompts, templates for prompting text generation models
  3. Workflows, a series of steps that the agent will follow, like a flowchart
Here’s an example agent that has a (pretty silly!) tool attached:
import { Agent, Tool, anthropic } from '@ardent-ai/sdk';
import { z } from 'zod';

const addTwo = new Tool({
  name: 'addTwo',
  description: 'Add two numbers and generate a result',
  parameters: {
    one: z.number(),
    two: z.number(),
  },
  async execute({one, two}) {
    return one + two;
  }
});

const agent = new Agent({
  model: anthropic(),
  instructions: 'You are an expert at math.'
  tools: [addTwo]
});

export default agent;

How agents work

When you deploy an agent using the Ardent CLI, it bundles your code along with any libraries that you’re using, and uploads it to the Ardent platform. Your agent is combined with a wrapper library that provides access to platform service, and the resulting package is deployed as an HTTP server. Once deployed, the Ardent platform communicates with your agent via RPC. Although they are webservers, HTTP requests can’t be sent directly to agents — they can only be called by the Ardent platform. Agents are stateless. They make no guarantees about retaining state throughout their lifecycle, and the platform will automatically start and stop agents as needed. You can provide your agents with access to state scoped to the current Task by using the Database or KeyValueStore services.

See also

  • Agent in the SDK reference