> For the complete documentation index, see [llms.txt](https://docs.pagerly.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pagerly.io/sre-ai-agent/how-to-use.md).

# How to Use

## Trigger the Agent

In any Slack channel where Pagerly is installed, mention the bot with the `assist` keyword:

```
@Pagerly assist <describe the issue>
```

### Examples

| Message                                                                    | What the Agent Does                                                                           |
| -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `@Pagerly assist seems people are having issues with billing on dashboard` | Queries GitHub for recent commits, checks Vercel deployments, searches logs for errors        |
| `@Pagerly assist API latency is high for payment service`                  | Queries Datadog/Grafana metrics, checks K8s pod health, looks at recent deployments           |
| `@Pagerly assist kafka consumer lag is increasing on orders topic`         | Checks Confluent for consumer group status, queries Prometheus metrics, checks ArgoCD deploys |
| `@Pagerly assist database connections are maxing out`                      | Queries PostgreSQL for active connections, checks RDS metrics, looks at recent changes        |

## What Happens Next

When you mention `@Pagerly assist`, the agent:

1. **Acknowledges** your request instantly in the thread
2. **Creates an investigation plan** — decides which data sources to query based on your description
3. **Queries your connected tools** — you'll see live updates like:
   * 🔍 *Querying GitHub...*
   * 🔍 *Querying Vercel...*
   * 🔍 *Querying Datadog...*
4. **Produces a structured report** — a root cause analysis with:
   * 📋 **Incident Report** with a unique ID
   * 🔴 **Root Cause** — what broke and why
   * 📝 **What Happened** — timeline of events
   * 🔗 **Evidence** — links to commits, logs, dashboards

{% hint style="info" %}
**Investigations typically take 30–90 seconds** depending on how many data sources are connected and how many tools the agent needs to query.
{% endhint %}

## Mapping Data Sources to Teams

The SRE Agent is **team-scoped** — each on-call team gets its own set of connected data sources. This ensures the agent only queries what's relevant during an investigation.

### How to Map

1. Go to [SRE Agent Integrations](https://workspace.pagerly.io/integrations/sre-agent) in the Pagerly dashboard
2. Click **Add Integration**
3. Select the integration type (e.g., Datadog, Kubernetes, GitHub)
4. Enter the credentials (API key, URL, etc.)
5. **Select the team** this integration belongs to
6. Optionally, add a **context prompt** — this tells the agent how your team uses this tool

![Navigate to SRE Integration page in the dashboard](/files/sDCIbPaw7cpZ4qtiC53F)

![Select the integration and fill in credentials](/files/chQ7ciHVxeOn8bGxaGUo)

![Fill in the integration details and map to a team](/files/xseSfpEphqYtgi8tZQpd)

### Context Prompts

When mapping a data source, you can provide a **context prompt** — a short description that helps the agent query more effectively.

| Integration    | Example Context Prompt                                                               |
| -------------- | ------------------------------------------------------------------------------------ |
| **Datadog**    | *"Our services use service:api-gateway tag. Production env uses env:prod."*          |
| **Kubernetes** | *"Production namespace is prod. Critical deployments: api, worker, web."*            |
| **GitHub**     | *"Main repos: org/api, org/frontend. Production branch is main."*                    |
| **Grafana**    | *"Main dashboards are in the SRE folder. Key dashboards: api-latency, error-rates."* |

{% hint style="success" %}
**Good context prompts dramatically improve investigation quality.** The more the agent knows about your setup, the faster it finds the root cause.
{% endhint %}

## Tips for Best Results

* **Be specific** — `@Pagerly assist API latency is high for payment-service in us-east-1` is better than `@Pagerly assist things are slow`
* **Connect multiple tools** — The agent is most powerful when it can correlate signals across logs, metrics, traces, and code changes
* **Add context prompts** — Tell the agent about your naming conventions, key services, and namespaces
* **Use in incident channels** — Trigger the agent in your war room channel during active incidents
