> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ardent.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agents

> Create programmable agents that can help solve problems.

**Agents** are the foundation of the Ardent platform. Fundamentally, an agent is a combination of a
[model](/concepts/models) (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](/reference/sdk). Here's an example of a simple agent, which uses
Anthropic's Claude model and has a basic set of instructions:

```ts index.ts theme={null}
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](/reference/cli) to deploy it to the
Ardent platform. Then, you (and anyone else in your [workspace](/concepts/workspaces)) can interact
with the agent using the [Ardent app](https://app.ardent.ai).

<Tip>
  For a full walkthrough of creating an agent, follow the [quick start](/quickstart).
</Tip>

## 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](/concepts/tools), custom executable functions that your agent can call
2. [Prompts](/concepts/prompts), templates for prompting text generation models
3. [Workflows](/concepts/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:

```ts theme={null}
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](/reference/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](/concepts/tasks)
by using the [Database](/reference/platform/database) or
[KeyValueStore](/reference/platform/key-value-store) services.

## See also

* [Agent](/reference/agent) in the SDK reference
