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

# Execution Modes

Charm supports three execution lifecycles. Choose the lifecycle that matches how your agent should behave for users.

## Configure Lifecycle

```yaml theme={"theme":{"light":"min-light","dark":"min-dark"}}
runtime:
  lifecycle: "serverless"
```

Valid values:

* `serverless`
* `interactive`
* `daemon`

## Comparison

| Lifecycle     | Best For                                | Runtime Behavior                 | State              |
| ------------- | --------------------------------------- | -------------------------------- | ------------------ |
| `serverless`  | One-off tasks, reports, transformations | Start, run, stop                 | Short-lived        |
| `interactive` | Chat, streaming, multi-turn UX          | Route through interactive worker | Thread-based       |
| `daemon`      | Background workers, bots, monitors      | Long-lived machine               | Persistent process |

## Serverless

Serverless is the default lifecycle. Use it for tasks that can complete within a bounded execution window.

Examples:

* summarize a document,
* generate a report,
* transform data,
* call external APIs.

## Interactive

Interactive agents stream responses back to the user and work well for conversational interfaces.

Use this for:

* chat agents,
* multi-turn assistants,
* agents that need immediate UI feedback.

## Daemon

Daemon agents run as long-lived machines. Use them when the agent needs to keep running after the initial request.

Use this for:

* Slack or Discord bots,
* monitors,
* scheduled or event-driven agents,
* persistent background workflows.

## Choosing a Mode

Start with `serverless` unless you specifically need streaming or always-on behavior. Move to `interactive` for chat UX and to `daemon` for background processes.
