# Chat agents

> Serve many customer conversations over shared data, with a person able to take over.

A **chat agent** (`kind: chat`) has no goal. Conversations drive it: each customer message is a turn,
and the agent answers with a reply and, if needed, proposals.

```yaml
name: front-desk
schema_version: v1
kind: chat
channels:
  - name: web
    identity: web-widget
conversations:
  idle_close: 2h
  delete_after: 30d
handoff:
  operators: [staff]
behavior:
  directive: "Answer questions and book appointments for a dental clinic."
inference:
  provider: anthropic
  model: claude-haiku-5-5
```

A dentist's, a barbershop's or a parking lot's bot is a different bundle on the same core.

## Over the API

```http
POST /conversations                  {"channel": "web", "customer": "cust-a"}
POST /conversations/{id}/turns       {"channel": "web", "customer": "cust-a", "text": "Hi"}
GET  /conversations/{id}/turns
```

- **Many at once.** One agent serves many conversations. Each keeps its own history; data, measures
  and capabilities are shared. A second turn on a busy conversation gets `409`.
- **Actions first, then the reply.** Every proposal from a turn passes the
  [safety pipeline](/loom-site/concepts/safety-pipeline/). The reply is written after the actions run,
  and the turn returns each outcome. Trust the outcomes; the reply is still model-written text.
- **Held actions come back.** An action that needs a person is parked; when it is released, the
  conversation gets an event the agent reads.
- **Customers are told apart.** Each turn names its channel and customer, and Loom, never the model,
  supplies that identity to the gate.

## Human handoff

A caller holding a role listed in `handoff.operators` can take a conversation over, answer as a
person, and hand it back:

```http
POST /conversations/{id}/takeover
POST /conversations/{id}/operator-turns
POST /conversations/{id}/handback
```

While a person holds it, customer turns are recorded without a model reply.