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

# Refresh and export agent knowledge

> Maintain saved knowledge sources, preserve reviewed changes and download a revision-bound export while handling stale jobs and cleanup safely.

**FIXED · agent** One live knowledge base belongs to an agent. Its attached numbers use that base on enabled channels. Only the active revision and eligible, unsuppressed pieces enter live retrieval.

**NOT OFFERED → do this instead · number** Knowledge and its enabled channels belong to the agent. Retired per-number knowledge operations return 410 number\_knowledge\_removed. Use separate agents when a number needs different knowledge or none.

**YOU CAN CHANGE · source** Use pasted text, PDF, DOCX or plain UTF-8 text, or discover a website and import selected pages. API submissions can request review.

**SCOPE · agent** Review knowledge drafts and publish approved material. Limits per base: `sources` 50 · `kbTokens` 100,000 · `topics` 1,000.

[Read the compact AI rules](https://docs.nixflex.com/ai-rules.md#knowledge)

Refresh saved source material deliberately and export a known knowledge revision without losing reviewed changes.

Refresh: **Selected saved sources** · Export: **Revision-bound result** · Cleanup: **Track the returned job**

**The important part**

* A website source changes only when you request and review the appropriate refresh.
* Deleting a topic prevents that same saved source from recreating it on refresh.
* Exports expire after one hour and become stale when the base revision changes.

[Business guide](https://docs.nixflex.com/guides/business/knowledge/test-and-fix.md) · [API reference](https://docs.nixflex.com/api-reference/introduction.md) · [Glossary](https://docs.nixflex.com/guides/glossary.md)

## Choose the saved source

Read the base, its current revision and the source list. Keep source IDs separate from topic and job IDs. Review which live topics came from the source before refreshing it. A new explicit source addition is a separate operation from refreshing the existing one.

Submit the documented [source refresh](https://docs.nixflex.com/api-reference/knowledge/post-knowledge-bases-kb-sources-refresh.md) request with a saved idempotency key, the selected `source_ids` and `review:true`. Poll the returned job and review any resulting draft before treating changed material as published.

## Preserve review decisions

Deleting a topic prevents refresh of the same saved source from resurrecting that piece. Deleting the last topic also removes its source and retained original. If you intentionally want the material back, add it as a new explicit operation and review it again.

A stale base, source or draft revision requires a fresh read and review. Do not automatically replace the revision number in an older destructive request. During a live-topic edit, the old live answer is suppressed; inspect the resulting publication before declaring the edit finished.

## Create and read an export

Create an [export job](https://docs.nixflex.com/api-reference/knowledge/post-knowledge-bases-kb-exports.md), save its ID and poll the job. When ready, use the export ID returned by the job to [read the export](https://docs.nixflex.com/api-reference/knowledge/get-knowledge-exports-id.md).

| Format | Result |
| - | - |
| Default JSON | Knowledge content with developer metadata. |
| `?format=text` | An envelope containing `filename`, `content_type` and `text`. |

An export excludes raw uploaded files. It lasts one hour and requires an unchanged base revision. If it expires or becomes stale, create another export from the current revision with bounded retries. Do not present an expired link as a durable backup.

Store exports in private application storage with your own access and retention controls. Their facts may contain customer information even when uploaded originals are absent.

## Reconcile cleanup

Whole-base deletion revokes access first and returns a cleanup job. Save and monitor that job to completion; an accepted deletion does not confirm that every cleanup step has finished. Treat a lost deletion response as unknown until you read the current state and job.

| Condition | Recovery |
| - | - |
| Stale revision or cursor | Read the current base; restart that list or review. |
| Refresh returns unchanged | Retain the existing facts; no new publication is implied. |
| Export expired or stale | Create a fresh export from the current revision. |
| Cleanup pending | Keep the job visible and continue bounded reads. |

* [Read source state](https://docs.nixflex.com/api-reference/knowledge/get-knowledge-bases-kb-sources.md)
* [Review a prepared draft](https://docs.nixflex.com/guides/developer/knowledge/review-and-publish.md)
* [Test the current answers](https://docs.nixflex.com/guides/developer/knowledge/test-and-troubleshoot.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.