Skip to main content

Overview

KnowledgeBase supports full document lifecycle management after initial setup. You can add new sources, insert raw text, remove documents, refresh changed files, update metadata, and delete by filter — all without recreating the knowledge base.

Adding Sources Dynamically

Use add_source() to add new files or directories to an existing knowledge base:

Adding Raw Text

Use add_text() to insert text content directly:
add_text() is idempotent — if the same text content is added twice, the duplicate is automatically skipped based on content hash.

Removing Documents

Remove a document and all its chunks by document ID:

Deleting by Metadata Filter

Delete all chunks matching a metadata filter — useful for bulk cleanup:

Refreshing Changed Sources

Re-scan all sources for changes and re-index modified documents:

Updating Document Metadata

Update metadata for all chunks of a specific document:

Method Reference