# Smart Auto-Reply with Knowledge Base
URL: /recipes/smart-auto-reply
Type: howto
Description: Search your knowledge base for relevant articles, generate a grounded AI draft reply, and surface it in the Zendesk agent sidebar for one-click approval.
Keywords: smart auto-reply with knowledge base, smart-auto-reply, recipe, workflow template, workflow builder, zendesk
Search your knowledge base for relevant articles, generate a grounded AI draft reply, and surface it in the Zendesk agent sidebar for one-click approval.

<Callout type="info">
  **Prerequisites:** Connect **Zendesk** before adding this recipe. See [Integrations](/integrations).
</Callout>

How it works [#how-it-works]

Each box is a block; arrows show the order Stylo runs them, and branch labels show the path taken on each outcome.

<Mermaid
  chart="flowchart TD
  trigger[&#x22;New Ticket&#x22;]
  get_context[&#x22;Get Ticket Context&#x22;]
  search_kb[&#x22;Search Knowledge Base&#x22;]
  has_kb_results[&#x22;KB Has Results?&#x22;]
  generate_draft[&#x22;Generate Draft Reply&#x22;]
  review_draft[&#x22;Review Draft&#x22;]
  post_reply[&#x22;Post Reply&#x22;]
  flag_rejected[&#x22;Flag for Manual Reply&#x22;]
  no_match_note[&#x22;Flag No KB Match&#x22;]
  trigger --> get_context
  get_context --> search_kb
  search_kb --> has_kb_results
  has_kb_results -->|&#x22;Relevant Results&#x22;| generate_draft
  generate_draft --> review_draft
  review_draft -->|&#x22;approved&#x22;| post_reply
  review_draft -->|&#x22;rejected&#x22;| flag_rejected
  has_kb_results -->|&#x22;No Match&#x22;| no_match_note"
/>

Parameters [#parameters]

Set these when you add the recipe to your workspace:

| Parameter           | Type   | Default                                                                                                                      |
| ------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
| `min_kb_confidence` | number | `0.4`                                                                                                                        |
| `brand_voice`       | string | `Friendly, professional, and empathetic. Use the customer's first name when available. Keep responses concise but thorough.` |

Blocks used [#blocks-used]

Every block in this recipe, linked to its reference page where one exists:

| Block                                                                           | Type                                   | What it does                                                                                                       |
| ------------------------------------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| [Webhook](/reference/blocks/trigger-webhook)                                    | `trigger/webhook`                      | Trigger workflow via HTTP webhook                                                                                  |
| Get Ticket Context                                                              | `zendesk/get-ticket-context`           | Get complete ticket context (ticket, conversation, attachments, customer, assignee, organization) optimized for AI |
| [Search Knowledge Base](/reference/blocks/context-engine-search-knowledge-base) | `context-engine/search-knowledge-base` | Search synced knowledge base documents using semantic search with automatic reranking                              |
| [Condition](/reference/blocks/system-condition)                                 | `system/condition`                     | Branch the workflow based on a boolean expression                                                                  |
| [Generate Text](/reference/blocks/ai-generate-text)                             | `ai/generate-text`                     | Generate text using AI models                                                                                      |
| Human Review                                                                    | `system/human-review`                  | Pause and wait for human approval before continuing                                                                |
| Add Comment / Reply                                                             | `zendesk/add-comment`                  | Add a public reply or internal note to a ticket                                                                    |

When to use it [#when-to-use-it]

Use this when you want agents to start from a knowledge-grounded draft instead of a blank reply box. It searches your knowledge base, drafts a reply only when a confident match exists, and surfaces it in the Zendesk sidebar for an agent to review.

Adapt it [#adapt-it]

This recipe is a starting point. To fit it to your workspace:

* Tune the `min_kb_confidence` parameter to control how strong a knowledge-base match must be before a draft is generated.
* Edit the `brand_voice` parameter to set the tone and style of the generated draft.
* Adjust the confidence **condition** branch if you want different behavior when no confident match is found.

Related [#related]

* [All recipes](/recipes)
* [Workflow blocks reference](/reference/blocks)
* [Workflow Builder overview](/workflow-builder-overview)
* [Integrations](/integrations)