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

# Deploy the project

> Deploy a Tilde project: the ontology and spaces with tilde ontology deploy, each agent with tilde deploy, then give the agent the ontology's tools.

A project has two deploy commands, one for each kind of thing it holds.

| Command | Deploys | Where it runs | Credential |
| - | - | - | - |
| `tilde ontology deploy` | `ontology/` and `spaces/`, together, to one environment | Tilde Cloud builds and runs them | A deploy token for that environment |
| `tilde deploy` | One agent's release, with its prompts, skills, and tools | You run the agent's container or function | A key that can deploy that agent |

Deploy the ontology first. The agent's ontology tools exist only once the ontology runs.

## 1. Deploy the ontology and spaces

**1. Create the project and an environment**

In **Ontology**, select **Create project**, and name it `helpdesk`, as in `tilde.toml`. Open it, select **Environments**, then **Create environment**. Name it `production`, and switch on **Serve its spaces in Live**.

**2. Issue a deploy token**

On the environment, select **Issue deploy token**, and copy it. It deploys only this environment.

**3. Commit and deploy**

Run from the directory that holds `tilde.toml`. Tilde builds the committed `HEAD`, not your working tree.

```bash theme={"system"}
git add -A && git commit -m "Helpdesk project"

export TILDE_URL="https://<your-tilde-cloud-url>"
export TILDE_DEPLOY_TOKEN="<deploy token>"
tilde ontology deploy --environment production
```

Tilde installs the dependencies, validates the ontology, its SQL, and its policies, builds the spaces, and rolls them out. Errors name the file and line.

**4. Check it**

`tilde ontology status --environment production` shows that the customers arrived. People with `view` on the project can now open **Live**, then **Customers**.

When the ontology needs a connection or a secret, the deploy is refused and names each one. See [Deploy and environments](https://trytilde.ai/docs/ontology/deploying.md).

## 2. Deploy the agent

**1. Create the agent**

In the Agent Registry, select **Create agent**, and name it `support`. On its **Inference** tab, assign an OpenAI connection named `production`. See [Inference providers](https://trytilde.ai/docs/inference-providers.md).

**2. Register a release**

Build the agent, then register a deployment from its folder. `tilde deploy` loads the entry module without starting it, and registers the prompt and skills it finds.

```bash theme={"system"}
cd agents/support && npm ci && npm run build
npx tilde deploy dist/index.js --dry-run   # see what it will register
npx tilde deploy dist/index.js             # prints the deployment token once
```

Set `TILDE_URL`, `TILDE_API_KEY`, and `TILDE_AGENT_ID` first. See [Release agents from CI](https://trytilde.ai/docs/deployment/ci-cd.md#registration-credentials) for the key.

**3. Run it**

Start the agent with `TILDE_GATEWAY_URL` and the deployment token as `TILDE_DEPLOYMENT_TOKEN`. It dials out to the gateway, and needs no inbound port. See [Deploy direct agents](https://trytilde.ai/docs/deployment/direct-agents.md).

## 3. Give the agent the ontology

**1. Connect the environment**

In **Tools**, select **Connections**, then **Tilde Catalog**, and choose **Tilde Ontology**. Select **Add account**, and enter the `production` environment's ID.

**2. Add the tools**

Open the `support` agent, select **Tools**, then **Add tool**, and choose the connection. Switch on `listCustomers`, `customerOverview`, and `setNotes`.

**3. Allow them**

In the agent's **Capabilities** tab, add the three tools to `tools.invoke`.

Now ask the agent: "What plan is Acme on? Note that they asked about SSO." It calls `listCustomers`, `customerOverview`, and `setNotes`, and each call is decided by your policies. The new note shows in the **Customers** space. Review the calls in the agent's [Sessions](https://trytilde.ai/docs/sessions.md) tab.

## Deploy from CI

Run both on every merge, ontology first. Each agent gets its own step.

```yaml .github/workflows/deploy.yml theme={"system"}
name: Deploy
on:
  push:
    branches: [main]
jobs:
  ontology:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      # Install the tilde CLI here.
      - run: tilde ontology deploy --environment production
        env:
          TILDE_URL: ${{ vars.TILDE_URL }}
          TILDE_DEPLOY_TOKEN: ${{ secrets.TILDE_DEPLOY_TOKEN }}
  support-agent:
    needs: ontology
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: agents/support
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm run build
      # Build and push the image here, then register the release:
      - run: npx tilde deploy dist/index.js --external-id ${{ github.sha }} --json > release.json
        env:
          TILDE_URL: ${{ vars.TILDE_URL }}
          TILDE_API_KEY: ${{ secrets.TILDE_API_KEY }}
          TILDE_AGENT_ID: ${{ vars.SUPPORT_AGENT_ID }}
      # Store the token from release.json in your secret manager, and roll out.
```

## Next steps

> [card] [Bring in real data](https://trytilde.ai/docs/ontology/sources-and-models.md)
>
> Replace the reference data with a pipeline and a connection.

> [card] [Tighten the policies](https://trytilde.ai/docs/ontology/policies.md)
>
> Limit agents, mask fields, and require approvals.

> [card] [Call third parties](https://trytilde.ai/docs/ontology/views-and-actions.md#call-third-parties)
>
> Have actions update the systems you already use.

> [card] [Roll out agent releases](https://trytilde.ai/docs/routing.md)
>
> Move conversations to a new release safely.


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