> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/guides-and-quickstarts/knowledge-and-retrieval/knowledge-base-maintenance.md).

# Knowledge base maintenance

Knowledge-base maintenance keeps the searchable collection aligned with its source information. Use document status, source selections, and references to understand the effect of a change.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQ1Sgy933krTyK0S4JpP%2Fuploads%2F1M29ZLpkq7Sqo7msJCri%2FG045.mp4?alt=media&token=b65a2382-91b3-4cd0-954b-6ac544fee594>" %}

## Before you start

Have permission to change the selected base and retain the original files. [Review References](https://docs.stackai.com/guides-and-quickstarts/knowledge-and-retrieval/inspect-knowledge-base-references.md) before deleting or replacing shared content.

## Inspect a document

Find the document you intend to maintain and check its filename and status.

![Knowledge base document inspection](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/IxBYCXQ4V70KJ3AMwz89/assets/g045-g045-01-locate.png)

Select the exact source before using item-level actions.

Open Parsed, Chunks, and Metadata to inspect the document.

![Knowledge base document inspection](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/g6A4x3x6dNVPn1lxvUj4/assets/g045-g045-02-inspect.png)

Use these views to identify extraction problems, passage issues, or properties that need attention.

## Rename the knowledge base

Use the edit control beside the knowledge-base name when its label needs to change.

![Knowledge base name editing](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/hz6e8G59rN3p53HAbOzz/assets/g045-g045-03-rename.png)

Renaming the base does not rename its source files or create a new base.

## Reindex a document

Open Item actions and select Reindex for the intended document.

![Document reindexing and verification](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/N7DGqdiIKZ0fUcNAbT7w/assets/g045-g045-04-reindex.png)

Read the confirmation and check the filename before proceeding.

Wait for indexing to finish, then inspect the document's chunks.

![Document reindexing and verification](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/o7xW6sXrP4Edwtn0mpk6/assets/g045-g045-05-verify.png)

Reindexing content already in the base is different from synchronizing a changed source from a provider.

## Remove a document

Use Delete only when the selected document should be removed.

![Document removal and remaining files](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/IMx8PvxK5CCdGoifybYW/assets/g045-g045-06-delete.png)

Check the filename and deletion warning, and retain an original copy if you may need to upload it again.

After removal, clear any document search and review the remaining files.

![Document removal and remaining files](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/6lViz7acDLpjTaBsPorE/assets/g045-g045-07-remaining.png)

Confirm that the sources you still need remain available and indexed.

## Review the remaining collection

Use Evaluate to check retrieval from the retained documents.

![Remaining knowledge base content](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/NrYpdWko3t5CcHEZhMhw/assets/g045-g045-08-evaluate.png)

Inspect the returned passage and source to confirm the collection still supports the intended questions.

Review the knowledge-base name and remaining document list.

![Remaining knowledge base content](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/3ITuaWEguoaEhbQo9Wv7/assets/g045-g045-09-restore.png)

Keep original source files outside the knowledge base if you may need to import them again.

## Important behavior

Reindexing processes content already in the base. Use synchronization to retrieve changes from a connected source.

Renaming a knowledge base does not rename its source files.

## Continue

* [Sync and ingestion lifecycle](https://docs.stackai.com/guides-and-quickstarts/knowledge-and-retrieval/sync-and-ingestion-lifecycle.md)
* [Inspect knowledge base references](https://docs.stackai.com/guides-and-quickstarts/knowledge-and-retrieval/inspect-knowledge-base-references.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/guides-and-quickstarts/knowledge-and-retrieval/knowledge-base-maintenance.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
