---
url: /en/build/internal-steps/knowledge/update.md
---
`knowledge:update`

\==Update knowledge base==, used to build Issues, repository documents, etc. into the knowledge base.

* [Applicable Events](#knowledge-update-applicable-events)
* [Parameters](#knowledge-update-parameters)
* [Configuration Examples](#knowledge-update-configuration-examples)

## Applicable Events {#knowledge-update-applicable-events}

[All Events](../../trigger-rule.md#trigger-event)

## How it works {#knowledge-update-how-it-works}

Fetch repository Issues & documents -> chunking -> vectorization -> into knowledge base

## Parameters {#knowledge-update-parameters}

The list below groups the parameters by purpose (documents / issues) for a quick
overview.

* [include](#knowledge-update-parameters-include): Files to include in the knowledge base, matched by `Glob`
* [exclude](#knowledge-update-parameters-exclude): Files to exclude, matched by `Glob`
* [chunkSize](#knowledge-update-parameters-chunkSize): Text chunk size
* [chunkOverlap](#knowledge-update-parameters-chunkOverlap): Overlapping tokens between adjacent chunks
* [embeddingModel](#knowledge-update-parameters-embeddingModel): Embedding model (only `hunyuan` is supported)
* [issueSyncEnabled](#knowledge-update-parameters-issueSyncEnabled): Whether to sync issues into the knowledge base
* [issueState](#knowledge-update-parameters-issueState): Sync only issues of a given state (`open`/`closed`)
* [issueLabels](#knowledge-update-parameters-issueLabels): Sync only issues with given labels
* [issueExcludeLabels](#knowledge-update-parameters-issueExcludeLabels):
  Exclude issues with given labels (takes precedence)
* [forceRebuild](#knowledge-update-parameters-forceRebuild): Whether to drop the knowledge base and rebuild it
* [ignoreProcessFailures](#knowledge-update-parameters-ignoreProcessFailures):
  Update the knowledge base even if some files fail to process

Detailed descriptions for each parameter are provided below.

### include {#knowledge-update-parameters-include}

* type: `String` | `Array<String>`
* required: `false`
* default: `**/**.md`

Specify which files to include, using `Glob` pattern matching. Defaults to `**/**.md` (all Markdown files).
Supports arrays or comma-separated values. Supported file types: .md, .mdx, .docx, .txt, .pdf.

### exclude {#knowledge-update-parameters-exclude}

* type: `String` | `Array<String>`
* required: `false`

Specify files to exclude using `Glob` patterns. By default, nothing is excluded.
Supports arrays or comma-separated values.

### chunkSize {#knowledge-update-parameters-chunkSize}

* type: `Number`
* required: `false`
* default: `1500`

Specify the text chunk size.

### chunkOverlap {#knowledge-update-parameters-chunkOverlap}

* type: `Number`
* required: `false`
* default: `0`

Specify the overlapping token count between two adjacent chunks.

### embeddingModel {#knowledge-update-parameters-embeddingModel}

* type: `String`
* required: `false`
* default: `hunyuan`

Embedding model. Currently, only `hunyuan` is supported.

### issueSyncEnabled {#knowledge-update-parameters-issueSyncEnabled}

* type: `Boolean`
* required: `false`
* default: `true`

Whether to enable Issue sync. If enabled,
Issues from the repository will be automatically pulled and added to the knowledge base.

### issueState {#knowledge-update-parameters-issueState}

* type: `String`
* required: `false`

Only sync Issues with the specified state. Defaults to all. Optional values: `open` | `closed`.

### issueLabels {#knowledge-update-parameters-issueLabels}

* type: `String` | `Array<String>`
* required: `false`

Only sync Issues with the specified labels. Defaults to all. Supports arrays or comma-separated values.

### issueExcludeLabels {#knowledge-update-parameters-issueExcludeLabels}

* type: `String` | `Array<String>`
* required: `false`

Exclude Issues with the specified labels. By default, no Issues are excluded.
Supports arrays or comma-separated values. When overlapping with `issueLabels`, exclude takes priority.

### forceRebuild {#knowledge-update-parameters-forceRebuild}

* type: `Boolean`
* required: `false`
* default: `false`

Whether to delete and rebuild the knowledge base. When set to `true`, the knowledge base is deleted and created afresh.

### ignoreProcessFailures {#knowledge-update-parameters-ignoreProcessFailures}

* type: `Boolean`
* required: `false`
* default: `false`

Whether to ignore document processing failures. If set to `true`,
the knowledge base will update even if some documents failed to process.

## Configuration Examples {#knowledge-update-configuration-examples}

### Basic Usage {#knowledge-update-configuration-examples-basic-usage}

```yaml title=".cnb.yml"
main:
  push:
    - stages:
        - name: build knowledge base
          type: knowledge:update
          options:
            include: "**/**.md"
```
