# Task Summary

AI Task Summary gives you an instant overview of any task — what it's about, what's happened, and where things stand — without reading through the full description, comments, and timeline.

This feature is available on **Sayr Cloud** and on **self-hosted instances** (Community and Enterprise) when a `MISTRAL_API_KEY` is configured.

## How It Works

When you open a task's detail panel, Sayr checks whether a fresh summary already exists. If one is available, it appears immediately. If not (or if new activity has occurred since the last summary was generated), Sayr automatically generates a new one.

Summaries are generated by an AI model and take into account:

- The task title and description
- Current status, priority, labels, and assignees
- Comments and timeline activity

## Generating a Summary

Summaries are generated automatically when you open a task. You can also manually trigger a new one using the **Regenerate** button in the AI panel.

The panel shows when the summary was last generated (e.g. "Generated 2 hours ago") so you always know how fresh it is.

## Caching & Freshness

Sayr caches summaries so you get instant results on repeat visits without making a new AI request every time.

A cached summary is shown immediately when:

- The summary was generated after the most recent task activity
- The cached version hasn't expired (summaries are cached for up to 7 days)

A new summary is generated when:

- New activity (comments, status changes, timeline entries) has occurred since the last summary
- The cached summary has expired

### Grace Period

If you have a task open and new activity comes in via real-time updates, the summary does **not** automatically re-evaluate staleness mid-session. The freshness check only runs when you next open the task. This prevents distracting summary refreshes while you're actively working.

## Availability

| Edition | Available |
|---------|-----------|
| Cloud | Yes |
| Community (self-hosted) | Yes, when `MISTRAL_API_KEY` is set |
| Enterprise (self-hosted) | Yes, when `MISTRAL_API_KEY` is set |

On Sayr Cloud, AI is managed and ready to use with no configuration. On self-hosted instances, set the `MISTRAL_API_KEY` environment variable to enable AI features. See the [self-hosting configuration guide](https://sayr.io/docs/self-hosting) for details.

Once enabled, organization admins can control AI features per-organization from **Settings → AI**.