
Agents are structured configurations that give the AI a specific persona, task focus, and optional tool access. This guide shows how to create and use them.

## Prerequisites

- Daneel AI installed
- (Optional) One or more [MCP servers connected](/how-to/mcp-server/) if you want the agent to use tools

## Create an agent

1. Open **Settings > Agents**.
2. Click **Create Agent**.
3. Fill in the agent definition:
   - **Name** — a short label (e.g., "Billing Helper", "Code Reviewer")
   - **Purpose** — one-line description of what this agent does
   - **System prompt** — the full instructions the AI receives. This is where you define the persona, constraints, output format, and behavior. Write it as if you're briefing the AI directly.
   - **MCP servers** — select which connected MCP servers this agent can use. The agent only has access to the servers you bind here.
4. Click **Save**.

## Attach an agent to a vault

Agents can be attached to document vaults for specialized document Q&A:

1. Open the vault overlay.
2. Click the **Agent** tab in your vault.
3. Select an agent from the dropdown.

When attached, the agent's system prompt and MCP servers are used for all conversations within that vault.

:::note
A vault uses either an agent or standalone MCP servers — not both. Attaching an agent replaces any directly-bound MCP servers.
:::

## Use an agent in chat

Agents are also available in regular chat conversations:

1. Open the chat panel.
2. Select an agent from the agent picker at the top.
3. The AI now responds according to the agent's system prompt and has access to the agent's bound tools.

## Example: Stripe billing agent

Here's a practical example:

- **Name:** Billing Support
- **Purpose:** Answer billing questions using Stripe data
- **System prompt:**
  ```
  You are a billing support specialist. When asked about invoices,
  subscriptions, or payments, use the Stripe tools to look up real data.
  Always include invoice IDs and amounts in your responses.
  Format currency as USD with two decimal places.
  If you can't find a customer, ask for their email address.
  ```
- **MCP servers:** Stripe

Now you can ask: *"What's the current subscription status for acme@example.com?"* and the agent will query Stripe and respond in the defined format.

## Configure context injection

Agents can receive environment context (your location and current date/time) in their system prompt. This is useful for location-aware or time-sensitive workflows.

In the agent editor, scroll to the **Context** section:

- **Uses location** — when checked, the agent receives your city (e.g., "Lyon, France") in its prompt. Requires "Share location with agents" to be enabled in Settings > Privacy.
- **Uses date & time** — when checked, the agent receives the current date, time, and timezone.

Both fields support three states: checked (always inject), unchecked (never inject), and indeterminate (inherit from bound MCP servers). Click through to cycle states.

When set to indeterminate, the agent inherits from its bound MCP servers — if any server has the `location` or `datetime` badge active in Settings > MCP, the agent gets that context automatically.

See [Environment Context](/concepts/context-injection/) for the full architecture and privacy details.

## Edit or delete agents

- In **Settings > Agents**, click an agent to edit its configuration.
- Click **Delete** to remove an agent. If it's attached to a vault, the vault reverts to no agent.

## Next steps

- [Connect MCP servers](/how-to/mcp-server/) to expand what your agents can do
- Read about [MCP and tool calling](/concepts/mcp/) to understand how agents invoke tools
- See the [AI Providers reference](/reference/providers/) for tool calling support per provider
