---
question: How do I make an agent available for chat?
kind: task
via_web: available
via_cli: na
via_python: na
via_api: available
via_config: available
ref_web: Settings › Agents
ref_api: PATCH /api/agents/{id}
ref_config: agents:
next:
  - /capabilities/build/agents/chat-with-an-agent
  - /capabilities/build/agents/edit-prompt-and-model
---

# Enable in a workspace

Each Nexus workspace keeps its own record of every agent, with an on/off switch. The chat offers only the enabled ones. This is the business workspace (members, chat), not a code workspace.

Each time a workspace [syncs](#when-a-workspace-syncs), the engine's agents are switched from `config.yaml`: the workspace's `agents:` list when it has one, otherwise only the default agent. `naas_abi`'s Abi agent is added to every list. A switch set by hand, in Nexus or with the API, wins over the list from then on, except for the default agent: every sync turns it back on. To turn the default agent off, change `default_agent` first.

## Web UI

### Open the agent list

In the workspace, open Settings › Agents. The header shows how many agents are enabled.

### Switch the agent

Check or clear the **Enabled** box on the agent's row (its tooltip reads **Enable agent** or **Disable agent**). The change is saved at once.

**Edit Agent** has the same **Enabled** box, saved with **Save**. The **Status** filter shows only enabled or disabled agents.

![Workspace Settings on Agents, enabled agents](/abi/Screenshot_Agents.png)

*Settings › Agents, filtered to enabled agents. The Enabled box switches an agent on or off for this workspace.*

## CLI

Not applicable. No `abi` command switches an agent (`abi workspace` manages members, not agents): use the Web UI, the REST API or the `agents:` list.

## Python

Not applicable. Each workspace, not the agent class, decides where an agent is on: use the `agents:` list, the Web UI or the REST API.

## REST API

### Find the agent's id

```http
GET /api/agents/?workspace_id=<id>
```

It lists the workspace's agents with their `id` and `enabled`. `POST /api/agents/sync?workspace_id=<id>` first creates the records of agents loaded since the last sync.

### Switch it

```http
PATCH /api/agents/{id}
```

```json title="Request body"
{ "enabled": true }
```

Send `false` to turn it off. Auth: a Nexus session with access to the workspace.

## Config

### List the workspace's agents

Workspaces are declared in `naas_abi`'s `nexus_config`. Give one an `agents:` list, each entry `<module> <AgentClass>`, and optionally its own `default_agent`:

```yaml title="config.yaml"
modules:
  - module: naas_abi
    enabled: true
    config:
      nexus_config:
        organizations:
          - name: "Dev"
            slug: "dev"
            workspaces:
              - name: "Default"
                slug: "default"
                default_agent: "my_module ReviewerAgent"
                agents:
                  - "my_module ReviewerAgent"
                  - "naas_abi OntologyEngineerAgent"
```

### Restart and sync

Restart the engine. The workspace's next sync turns on the listed agents and turns off the others, except Abi and the agents switched by hand. A workspace without `agents:` gets only its default agent: its own `default_agent`, or the project's top-level one. The default agent is always on.

## When a workspace syncs

A sync reconciles one workspace's agent records with the agents the engine loaded: it adds the new ones, deletes the records of classes that are gone, and applies the `agents:` list. It runs for that workspace only, when someone opens an agent's **Edit Agent** page, when someone opens the chat pane (once per page load), or on `POST /api/agents/sync?workspace_id=<id>`. Opening the Settings › Agents list does not sync.
