---
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), its agents are switched from `config.yaml`:

- **Module agents** are on while their module is `READY`, and off while it is not. A workspace with an `agents:` list keeps on only the module agents it names.
- **The agents ABI ships** (`naas_abi`, the marketplace) follow 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, which every sync turns back on, and a module agent whose module is down, which stays off. 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 published 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`, the marketplace module that runs Nexus. Give one an `agents:` list and optionally its own `default_agent`. A module agent is `<module id> <agent name>`, the name of its `AgentDescriptor`; an agent ABI ships is `<module> <AgentClass>`:

```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_project.research Reviewer"
                agents:
                  - "my_project.research Reviewer"
                  - "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 module agent on the list is on only while its module is `READY`. A workspace without `agents:` gets its default agent, its own `default_agent` or the project's top-level one, plus every module agent that is up. The default agent is always on.

## When a workspace syncs

A sync reconciles one workspace's agent records with the agents the engine loaded and the agents discovery lists: it adds the new ones, deletes the records of classes the engine no longer loads, turns off the records of module agents no module publishes (it keeps them), 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.
