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

# Generate KB articles

> Turn resolved tickets and detected knowledge gaps into draft KB articles using AI, generated from Slack reactions or the Ravenna web app.

You can turn ticket conversations and detected knowledge gaps into draft knowledge base articles using AI. This turns real questions into reusable documentation.

There are three ways to generate a KB article:

* React with the 🧠 emoji on a Slack message.
* Use the **Generate KB Article** action on a ticket in the web app.
* Generate from a knowledge gap cluster on the **Gaps** tab.

## Generation methods

### From Slack with 🧠

Add the 🧠 (`:brain:`) emoji reaction to any Slack message to generate a KB article from that thread.

1. Find a Slack thread that contains a question and an answer worth capturing.
2. React to the **original channel message** (not a thread reply) with 🧠.
3. You see an ephemeral message confirming that knowledge generation has started.

If the thread does not already have a ticket, Ravenna creates one automatically before generating the article. If a ticket already exists for the thread, Ravenna uses it.

If you react with 🧠 on a thread that has already produced a KB article, Ravenna updates the existing article with the latest conversation instead of creating a duplicate. The confirmation message indicates whether a new article was created or an existing one was updated.

<Note>
  Emoji actions only trigger on the original message in a channel. Reacting to a reply inside a thread does not trigger article generation.
</Note>

<Callout icon="link" color="#6B7280">Learn more about [Emoji actions](/integrations/slack/emoji-actions)</Callout>

<Note>
  Microsoft Teams: the 🧠 (`:brain:`) reaction is **not** in the [Microsoft Teams emoji action set](/integrations/microsoft-teams/emoji-actions) (currently ✅ ❌ 📖 👀 👎). Generate KB articles from Teams threads using the web app instead.
</Note>

### From a ticket in the web app

You can generate or regenerate a KB article from any ticket in the web app.

1. Open the ticket in Ravenna.
2. Click the **⋯** (more) menu on the ticket.
3. Select **Generate KB Article**.
4. The **Create KB Article** dialog opens and starts generation automatically.
5. When generation completes, click the article preview to open and edit it in your knowledge base.

If a KB article already exists for the ticket, the dialog shows the existing article and offers a **Regenerate** option.

### From a knowledge gap cluster

The **Gaps** tab on the **Knowledge** page surfaces topics where your agents could not find an answer. Each gap is a cluster of related tickets, sized by how often the topic comes up. Generating from a cluster produces a single, comprehensive article that draws on every ticket in the cluster.

1. Navigate to **Knowledge** > **Gaps**.
2. Find a cluster you want to document. Use the example tickets and frequency to assess impact.
3. Open the **⋯** menu on the cluster row and select **Generate KB Article**, or select multiple clusters and use the bulk action to generate articles for all of them.
4. Track progress on the cluster row. When generation finishes, open the new article from the cluster or from your knowledge base.

<Callout icon="link" color="#6B7280">Learn more about [Knowledge gaps](/documentation/automate/knowledge/overview#knowledge-gaps)</Callout>

## How generation works

The generation workflow:

1. **Enriches the conversation** with ticket metadata and message context.
2. **Segments the conversation** into question-and-answer exchanges and identifies bot failures.
3. **Classifies knowledge gaps** to determine which exchanges represent missing documentation.
4. **Generates article sections** from the identified gaps, using ticket and cluster context.
5. **Saves the article** to your knowledge base and ingests it for search.
6. **Notifies the requester** when the article is ready.

Generated articles are drafts. Review and edit them in your knowledge base before relying on them for agent answers.

### Generation states

The generation dialog reflects the current status:

| State        | Description                                                                                  |
| ------------ | -------------------------------------------------------------------------------------------- |
| Initializing | Article generation has been requested but not yet queued.                                    |
| Queued       | The generation job is waiting to run.                                                        |
| Generating   | The workflow is running. A progress bar shows completion percentage.                         |
| Completed    | The article is ready. A preview and link to the KB are shown.                                |
| Failed       | The workflow could not complete. Try regenerating, or contact support if the issue persists. |

<Note>
  Generation may finish without producing an article if the conversation does not contain a clear knowledge gap. For example, the bot may have already answered correctly, or the thread may not have added any new information.
</Note>

## After generation

* New articles land in your knowledge base and are immediately searchable by agents that have access to the parent folder.
* Edit the article to refine wording, add screenshots, or link to related content.
* Archive or delete the draft if it is not useful. The source ticket remains unchanged.
* For tickets, the **Generate KB Article** action becomes **Regenerate KB Article** once an article exists.

## Programmatic generation

You can also trigger KB article generation via the API:

* [Generate a KB article from a ticket conversation](/api/ticket/generate-a-kb-article-from-a-ticket-conversation)
* [Generate KB article from cluster](/api/knowledge-gap-clusters/generate-kb-article-from-cluster)
* [Get unified KB article status](/api/ticket/get-unified-kb-article-status-including-existing-articles-and-job-progress)
* [Get KB article generation status](/api/knowledge-gap-clusters/get-kb-article-generation-status)
