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

# Knowledge

> Add, inspect, resync, delete, and maintain chatbot knowledge from links, websites, sitemaps, files, text, YouTube, and custom responses.

Knowledge commands manage the content SiteGPT uses to answer questions.

Run this first when exploring:

```bash theme={null}
sitegpt knowledge --help
```

## Knowledge resources

| Resource                     | Purpose                                                                                       |
| ---------------------------- | --------------------------------------------------------------------------------------------- |
| `knowledge documents`        | List, inspect, edit, resync, delete, and measure ingested documents. Alias: `knowledge docs`. |
| `knowledge links`            | Add one or more exact URLs.                                                                   |
| `knowledge website`          | Crawl a website from a starting URL.                                                          |
| `knowledge sitemap`          | Add URLs from a sitemap.                                                                      |
| `knowledge youtube`          | Add YouTube video URLs.                                                                       |
| `knowledge text`             | Replace the chatbot text knowledge document.                                                  |
| `knowledge files`            | Upload local files.                                                                           |
| `knowledge sync-jobs`        | Manage recurring content sync and sitemap scan jobs.                                          |
| `knowledge sources`          | Manage external data-source connections. Alias: `knowledge connections`.                      |
| `knowledge custom-responses` | Manage dashboard Custom Responses.                                                            |

## Add knowledge

### Add exact links

Use this when you know the exact pages to train:

```bash theme={null}
sitegpt knowledge links add --chatbot <chatbot-id> https://example.com/a https://example.com/b
sitegpt knowledge links add --chatbot <chatbot-id> https://example.com/a --only-main-content true
sitegpt knowledge links add --chatbot <chatbot-id> https://example.com/a --sync WEEKLY
```

### Crawl a website

Use this when you have a starting URL and want SiteGPT to discover pages:

```bash theme={null}
sitegpt knowledge website add --chatbot <chatbot-id> https://docs.example.com
sitegpt knowledge website add --chatbot <chatbot-id> https://docs.example.com --depth 3 --max-links 200
sitegpt knowledge website add --chatbot <chatbot-id> https://docs.example.com --include-path /docs --exclude-path /blog
sitegpt knowledge website add --chatbot <chatbot-id> https://docs.example.com --allowed-domain docs.example.com
```

Website options:

| Option                      | Description                                                      |
| --------------------------- | ---------------------------------------------------------------- |
| `--depth <1-5>`             | Maximum crawl depth. Default: `3`.                               |
| `--max-links <1-1000>`      | Maximum URLs to queue. Default: `50`, capped by remaining quota. |
| `--include-path <path>`     | Include path pattern. Repeatable.                                |
| `--exclude-path <path>`     | Exclude path pattern. Repeatable.                                |
| `--allowed-domain <domain>` | Allowed domain. Repeatable.                                      |

### Add a sitemap

Prefer sitemap ingestion when the website exposes a sitemap:

```bash theme={null}
sitegpt knowledge sitemap add --chatbot <chatbot-id> https://example.com/sitemap.xml
sitegpt knowledge sitemap add --chatbot <chatbot-id> https://example.com/sitemap.xml --max-links 500
sitegpt knowledge sitemap add --chatbot <chatbot-id> https://example.com/sitemap.xml --scan WEEKLY --sync WEEKLY
```

Sitemap options:

| Option                  | Description                                                                                           |
| ----------------------- | ----------------------------------------------------------------------------------------------------- |
| `--max-links <1-1000>`  | Maximum URLs to queue. Default: `50`, capped by remaining quota.                                      |
| `--include-path <path>` | Include path pattern. Repeatable.                                                                     |
| `--exclude-path <path>` | Exclude path pattern. Repeatable.                                                                     |
| `--sync <frequency>`    | Refresh known page content. Values: `NEVER`, `DAILY`, `WEEKLY`, `MONTHLY`. Default: `NEVER`.          |
| `--scan <frequency>`    | Scan sitemap for added/deleted URLs. Values: `NEVER`, `DAILY`, `WEEKLY`, `MONTHLY`. Default: `NEVER`. |

<Note>
  Sync and scan frequencies are plan-gated. Unsupported requests may be downgraded by the API with warnings.
</Note>

### Add YouTube videos

```bash theme={null}
sitegpt knowledge youtube add --chatbot <chatbot-id> https://www.youtube.com/watch?v=...
sitegpt knowledge youtube add --chatbot <chatbot-id> https://www.youtube.com/watch?v=... --sync MONTHLY
```

### Upload local files

```bash theme={null}
sitegpt knowledge files add --chatbot <chatbot-id> ./guide.pdf
sitegpt knowledge files add --chatbot <chatbot-id> ./pricing.pdf ./faq.docx
```

The CLI reads local files and uploads them. Pass file paths, not remote URLs.

### Add or update text knowledge

`text update` creates or replaces the chatbot's text knowledge document:

```bash theme={null}
sitegpt knowledge text update --chatbot <chatbot-id> "Refund policy: ..."
sitegpt knowledge text update --chatbot <chatbot-id> --name FAQ --file ./faq.md
```

`text add` is accepted as an alias, but `text update` is clearer because the text block is replaced.

## Scrape options

These options work with links, website, sitemap, and document config updates:

| Option                          | Description                                                                                                                    |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `--only-main-content <boolean>` | Extract main content only. Accepts `true`, `false`, `1`, `0`, `yes`, `no`, `on`, `off`. Default: `true` for new URL ingestion. |
| `--include-selector <selector>` | CSS selector to include. Repeatable.                                                                                           |
| `--exclude-selector <selector>` | CSS selector to exclude. Repeatable.                                                                                           |
| `--header "Name: value"`        | Send request header. Repeatable. Allowed names: `User-Agent`, `Accept`, `Accept-Language`.                                     |
| `--sync <frequency>`            | Auto-sync page content. Values: `NEVER`, `DAILY`, `WEEKLY`, `MONTHLY`.                                                         |

Example:

```bash theme={null}
sitegpt knowledge links add \
  --chatbot <chatbot-id> \
  https://example.com/docs \
  --only-main-content true \
  --include-selector main \
  --exclude-selector nav \
  --header "User-Agent: SiteGPT"
```

## Documents

Documents are individual trained, pending, failed, or queued knowledge items.

### List documents

```bash theme={null}
sitegpt knowledge documents list --chatbot <chatbot-id>
sitegpt knowledge documents list --chatbot <chatbot-id> --json
sitegpt knowledge documents list --chatbot <chatbot-id> --status SUCCESS
sitegpt knowledge documents list --chatbot <chatbot-id> --source LOCAL_FILE
sitegpt knowledge documents list --chatbot <chatbot-id> --state failed
sitegpt knowledge documents list --chatbot <chatbot-id> --query "refund"
```

`knowledge docs` is accepted as an alias for `knowledge documents`.

Filters:

| Option              | Description                             |
| ------------------- | --------------------------------------- |
| `--query <text>`    | Search by document name/content.        |
| `--source <source>` | Filter by source. Repeatable.           |
| `--status <status>` | Filter by ingestion status. Repeatable. |
| `--type <type>`     | Filter by document type. Repeatable.    |
| `--limit <1-100>`   | Limit results. Default: `50`.           |
| `--cursor <cursor>` | Continue from a previous response.      |

Allowed source values:

```text theme={null}
TEXT, URLS_LIST, YOUTUBE, SITEMAP, WEBSITE, LOCAL_FILE,
NOTION, GOOGLE_DRIVE, DROPBOX, ONEDRIVE, BOX, SHAREPOINT,
CONFLUENCE, GITHUB
```

Allowed status values:

```text theme={null}
BACKLOG, QUEUED, QUEUED_FOR_RESYNC, QUEUED_FOR_UPDATE,
QUEUED_FOR_DELETION, PROCESSING, SUCCESS, FAILED, CANCELLED
```

Allowed type values:

```text theme={null}
TEXT, URL, FILE, NOTION_DOCUMENT, GOOGLE_DRIVE_DOCUMENT,
DROPBOX_DOCUMENT, ONEDRIVE_DOCUMENT, BOX_DOCUMENT,
SHAREPOINT_DOCUMENT, CONFLUENCE_DOCUMENT, GITHUB_DOCUMENT
```

### Get document details

```bash theme={null}
sitegpt knowledge documents get --chatbot <chatbot-id> <document-id>
sitegpt knowledge documents get --chatbot <chatbot-id> <document-id> --content
sitegpt knowledge documents get --chatbot <chatbot-id> <document-id> --include-content --max-content-chars 50000 --json
```

`--content` includes raw and parsed text when available. Use `--max-content-chars <1-500000>` to limit included text.

### Edit document content

```bash theme={null}
sitegpt knowledge documents edit --chatbot <chatbot-id> <document-id> --content "Updated content"
sitegpt knowledge documents edit --chatbot <chatbot-id> <document-id> --file ./updated-content.md
```

`documents update` is accepted as an alias for `documents edit`.

### Resync documents

```bash theme={null}
sitegpt knowledge documents resync --chatbot <chatbot-id> <document-id>
sitegpt knowledge documents resync --chatbot <chatbot-id> --document <document-id>
sitegpt knowledge documents resync --chatbot <chatbot-id> --state failed
sitegpt knowledge documents resync --chatbot <chatbot-id> --source WEBSITE --status FAILED
```

### Delete documents

```bash theme={null}
sitegpt knowledge documents delete --chatbot <chatbot-id> <document-id> --yes
sitegpt knowledge documents delete --chatbot <chatbot-id> --document <document-id> --yes
sitegpt knowledge documents delete --chatbot <chatbot-id> --state failed --yes
sitegpt knowledge documents delete --chatbot <chatbot-id> --all --yes
```

`documents remove` is an alias for `documents delete`.

Bulk selector options:

| Option               | Description                                                                 |
| -------------------- | --------------------------------------------------------------------------- |
| `--document <id>`    | Select a document ID. Repeatable.                                           |
| `--document-id <id>` | Alias for `--document`. Repeatable.                                         |
| `--state <state>`    | Values: `all`, `trained`, `pending`, `failed`.                              |
| `--all`              | Select every matching document. Use carefully.                              |
| Filters              | `--query`, `--source`, `--status`, and `--type` can narrow bulk operations. |

### Update document config

```bash theme={null}
sitegpt knowledge documents update-config --chatbot <chatbot-id> --document <document-id> --sync WEEKLY
sitegpt knowledge documents update-config --chatbot <chatbot-id> --document <document-id> --only-main-content false
sitegpt knowledge documents update-config --chatbot <chatbot-id> --document <document-id> --include-selector main
sitegpt knowledge documents update-config --chatbot <chatbot-id> --document <document-id> --exclude-selector nav
sitegpt knowledge documents update-config --chatbot <chatbot-id> --document <document-id> --header "User-Agent: SiteGPT"
```

### Document stats

```bash theme={null}
sitegpt knowledge documents stats --chatbot <chatbot-id>
sitegpt knowledge documents stats --chatbot <chatbot-id> --source LOCAL_FILE
```

## Sync jobs

Sync jobs are recurring maintenance jobs. Auto-sync refreshes known content. Sitemap auto-scan discovers URL additions/deletions.

```bash theme={null}
sitegpt knowledge sync-jobs list --chatbot <chatbot-id>
sitegpt knowledge sync-jobs get --chatbot <chatbot-id> <job-id>
sitegpt knowledge sync-jobs update --chatbot <chatbot-id> <job-id> --sync WEEKLY
sitegpt knowledge sync-jobs update --chatbot <chatbot-id> <job-id> --scan MONTHLY
sitegpt knowledge sync-jobs delete --chatbot <chatbot-id> <job-id> --yes
```

Aliases:

* `knowledge jobs` → `knowledge sync-jobs`
* `knowledge sync-jobs disable` → `knowledge sync-jobs delete`

List filters:

| Option               | Values                                                             |
| -------------------- | ------------------------------------------------------------------ |
| `--source <source>`  | `URLS_LIST`, `SITEMAP`, `WEBSITE`, `YOUTUBE`, `GITHUB`; repeatable |
| `--sync <frequency>` | `DAILY`, `WEEKLY`, `MONTHLY`; repeatable                           |
| `--scan <frequency>` | `NEVER`, `DAILY`, `WEEKLY`, `MONTHLY`; repeatable                  |
| `--limit <1-100>`    | Default: `50`                                                      |
| `--cursor <cursor>`  | Continue pagination                                                |

Deleting a sync job disables recurring sync/scan. It does not delete existing knowledge documents.

## Custom responses

Custom Responses are manual question-and-answer overrides in the Knowledge section.

```bash theme={null}
sitegpt knowledge custom-responses list --chatbot <chatbot-id>
sitegpt knowledge custom-responses list --chatbot <chatbot-id> --state OPEN
sitegpt knowledge custom-responses list --chatbot <chatbot-id> --source MANUALLY_ADDED
sitegpt knowledge custom-responses get --chatbot <chatbot-id> <custom-response-id>
sitegpt knowledge custom-responses add --chatbot <chatbot-id> --question "What is your refund policy?" --answer "..."
sitegpt knowledge custom-responses update --chatbot <chatbot-id> <custom-response-id> --answer "Updated answer."
sitegpt knowledge custom-responses delete --chatbot <chatbot-id> <custom-response-id> --yes
```

Filters:

| Option              | Values                                                                |
| ------------------- | --------------------------------------------------------------------- |
| `--query <text>`    | Search questions.                                                     |
| `--state <state>`   | `ALL`, `OPEN`, `UPDATED`. Default: `ALL`.                             |
| `--source <source>` | `DOWNVOTED_BY_USER`, `MANUALLY_ADDED`, `MARKED_BY_ADMIN`. Repeatable. |

Fields:

| Option                       | Description                                             |
| ---------------------------- | ------------------------------------------------------- |
| `--question <question>`      | Custom response question.                               |
| `--answer <answer>`          | Custom response answer.                                 |
| `--original-answer <answer>` | Optional original answer when adding a custom response. |

## Full reference

* [Knowledge documents](/cli/command-reference#knowledge-documents)
* [Knowledge links](/cli/command-reference#knowledge-links)
* [Knowledge website](/cli/command-reference#knowledge-website)
* [Knowledge sitemap](/cli/command-reference#knowledge-sitemap)
* [Knowledge YouTube](/cli/command-reference#knowledge-youtube)
* [Knowledge text](/cli/command-reference#knowledge-text)
* [Knowledge files](/cli/command-reference#knowledge-files)
* [Knowledge sync jobs](/cli/command-reference#knowledge-sync-jobs)
* [Custom responses](/cli/command-reference#custom-responses)
