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

# Build an agent

> Create an agent and get it answering — from scratch, from a skill pack, or from skills you pick yourself. About five minutes.

An agent in DecimalAI is three things stored in your workspace: a **name**, a **system prompt**, and the **skills** it can use. Your own code runs it — DecimalAI never hosts it — and `decimalai init` writes that code for you, so you don't need any to start.

There are three ways to set one up. They differ only in where the prompt and skills come from; all three end with the same handful of commands.

## Before you start

* A DecimalAI account. The Free plan includes one agent; [sign up](https://app.decimal.ai/sign-up).
* A DecimalAI API key from [Settings → API keys](https://app.decimal.ai/settings/api-keys).
* Python 3.10 or later.
* An OpenAI API key. The generated agent calls `gpt-4o-mini` by default, billed to your OpenAI account.

## 1. Create the agent

<Tabs>
  <Tab title="From scratch">
    1. Open [app.decimal.ai/agents/new](https://app.decimal.ai/agents/new), or **All agents → + New agent**.
    2. Give it a **name**: lowercase letters, numbers and hyphens, like `refund-bot`. Your code finds the agent by this name, exactly as typed.
    3. Optionally say **what it does** and write a **system prompt**. You can leave the prompt empty and fill it in later.
    4. Click **Create agent**.

    To give it skills, add them on the skill's registry page (see the **From skills you pick** tab) — before or after creating the agent.
  </Tab>

  <Tab title="From a skill pack">
    A pack is a starting point for one role — Support, Coding, Data Analyst and 29 more — with a starter system prompt and a handful of skills picked for that role.

    1. Open the [pack gallery](https://app.decimal.ai/skills/packs) and choose a role.
    2. Click **Start with N skills** (N is the pack's starter count, usually 8). The create form opens with the pack's prompt filled in and its starter skills ticked.
    3. Replace every `<placeholder>` in the prompt — for example `<product>` — with your own details. The form counts how many are left; the model sees anything you leave as literal text.
    4. Untick any skill you don't want.
    5. Name the agent and click **Create agent**.

    <Note>
      Choose skills now. On the Free and Core plans, attaching a registry skill to one existing agent is a Pro feature, so a pack skill you untick can't be put back on just this agent later without upgrading.
    </Note>

    The Support pack also has a longer [tutorial](/tutorials/support-agent-from-skills) that generates a project with built-in answer checks.
  </Tab>

  <Tab title="From skills you pick">
    Pick individual skills from the [registry](https://app.decimal.ai/skills), then create the agent.

    1. Open a skill and read its scorecard: what it measurably changes, on which model, and its safety result.
    2. Click **Install**. Leave **Apply to** set to **all agents**: every agent in your workspace is offered the skill, including agents you create later.
    3. Repeat for each skill you want.
    4. Create the agent as in **From scratch**. You don't need to tick installed skills in the form — they reach the agent automatically.

    On the Pro plan you can set **Apply to** to **specific agents…** and type agent names, so a skill reaches only those agents.

    **Install** keeps a live link: you get the author's updates as they publish them. If you want your own copy to edit, choose **Fork a copy** instead. [Vocabulary](/guides/vocabulary) explains the difference.
  </Tab>
</Tabs>

## 2. Run it

Use the name you gave the agent in place of `refund-bot`:

```bash theme={null}
python -m venv .venv && source .venv/bin/activate
pip install "decimalai[langchain]" langchain langchain-openai
export DECIMAL_API_KEY="dai_sk_..."
export OPENAI_API_KEY="sk-..."
decimalai init refund-bot
python agent.py
```

* `decimalai init refund-bot` looks the agent up by name and writes `agent.py`: a LangChain agent that reads its system prompt from your workspace when it starts and receives its skills on every turn. The top of `agent.py` lists the skills it will be offered.
* `python agent.py` asks the agent *"What can you help me with?"* and prints the answer.

To ask it something else, change the question at the bottom of `agent.py`, or call it from your own code:

```python theme={null}
from agent import run

print(run("A customer was charged twice for one order. Draft a reply."))
```

Prefer another framework? Add `--framework openai-agents`, `--framework pydantic-ai` or `--framework adk` to `decimalai init`, and install what it prints.

<Note>
  `decimalai init` with an agent name writes your agent file. Without a name, it only checks your API key and sends one test trace — that is the first step of the [Quickstart](/quickstart).
</Note>

## 3. See what it did

Each run appears on the agent's page in the dashboard, `app.decimal.ai/agents/refund-bot`, within a few seconds. Open a run on the **Traces** tab to see the question, the answer, and under **Active Skills** which skills it used.

## Change it later

| To change | Where | When it takes effect |
| - | - | - |
| The system prompt | The agent's **System prompt** page | Next time your process starts |
| Its skills | A skill's **Install** panel, or **+ Assign skill** on the agent page for skills your workspace owns | Within about 30 seconds, no restart |
| The framework or model | Rerun `decimalai init` with `--framework` or `--model`, and `--force` to overwrite | Next run |

## If something goes wrong

* **`No agent named …`** — the name in the command doesn't match the agent in your workspace. Names are exact; the error suggests the closest match.
* **`ModuleNotFoundError`** — rerun the `pip install` line inside the same virtual environment you run `agent.py` from.
* **`OPENAI_API_KEY is not set`** — `agent.py` checks for your model key before it starts. Export it in the shell you run it from.
* **No run on the Traces tab** — check that `DECIMAL_API_KEY` is set in the shell that ran `agent.py`.

## Next

<CardGroup cols={2}>
  <Card title="Assemble an agent from skills" icon="puzzle-piece" href="/guides/agents-from-skills">
    How skills reach the model each turn, and how to choose them from the registry.
  </Card>

  <Card title="Catch regressions" icon="shield-check" href="/quickstart#5-add-the-regression-check-to-your-prs-recommended">
    Add the GitHub Action so every change to the agent gets an impact report.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.