The Agent class defines an agent that can be run on the Ardent platform.
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('claude-opus-4-0'),
  instructions: "You are a helpful assistant",
  tools: [addTwo]
});

Constructor

The Agent constructor accepts a configuration object with the following properties:
model
Model
required
The Model to use for the agent’s operations.
instructions
string
Instructions that guide the agent’s behavior, often called a system prompt or role prompt.
prompts
Prompt[]
An array of prompts that the agent can call.
tools
Tool[]
An array of tools that the agent can call.
workflows
Workflow[]
An array of workflows that the agent can execute.

Methods

In addition to passing Tools, Prompts, and Workflows into the Agent constructor, you can also add them after the fact:
import { Agent, Prompt, Tool, anthropic } from '@ardent-ai/sdk';
import { z } from 'zod';

const agent = new Agent({
  model: anthropic()
});

const addTwo = new Tool({...});
agent.addTool(addTwo);

const summarize = new Prompt({...})
agent.addPrompt(summarize);
There’s no difference between passing these objects to the Agent constructor, or by calling a method like addTool(). It’s up to you and your preferred style.

See also

Agents

Read more about agents