# Agents

An **agent** is a versioned definition that executes when a [routine](/concepts/routines) fires. Agents compose [skills](/concepts/skills) within a [project](/concepts/projects). Versioning ensures in-flight sessions keep their agent version.

## Create an agent

```ts
const { data: agent } = await client.agent.create({
  body: { name: "Support triage", slug: "support-triage" },
})
```

## Link an agent into a project

```ts
await client.pod.project.agent.add({
  path: { podId, id: projectId },
  body: { agentId: agent.id, type: "primary" },
})
```

## Versioning

Use `client.agent.version.*` to list, create, get, or archive versions
of an agent. When you link an agent into a project you can pin it to a
specific `agentVersionId`.

## Related

- **[Skills](/concepts/skills)** — the capabilities an agent composes.
- **[Routines](/concepts/routines)** — how agents get triggered.
- **API reference:** [Agents](/api-reference#tag/agent)