Knowledge Base Delete
Knowledge Base Delete removes whole sources from a knowledge base: every chunk stored under one source key. It removes the sources the previous node names, or keeps only those and removes every other source. You find it on the node picker’s AI shelf.
The node has one input handle and one output handle.
What a source is here
Section titled “What a source is here”A source is everything Knowledge Base Insert stored under one source key, such as all the chunks of one help-centre article. Documents stored without a source key cannot be named, so this node never removes them; delete them on the knowledge base’s Sources page.
A removed source is gone for good. Getting it back means ingesting it again, embeddings included.
Configuration
Section titled “Configuration”

| Field | Type | Default | Description |
|---|---|---|---|
Knowledge base (collectionId) | string ✦ (required) | — | The knowledge base to remove sources from. |
Delete (mode) | one of these, allBut (optional) |
these |
Delete the sources the previous node names, or keep only those and delete every other keyed source. |
Key path (sourceKeyPath) | string ✦ (optional) | — | Where each previous item carries its source key, as a dot path such as id. Leave empty when the items are the keys themselves. |
Source limit (maxSources) | integer ✦ (optional) | — | The most sources one run may remove. When more would go, nothing is deleted and the node fails, saying how many. |
Dry run (dryRun) | boolean ✦ (optional) | — | Say which sources would be removed, and delete nothing. |
Fields marked ✦ accept expressions.
Try this node — run it once against your own workspace, with your credentials, without building a flow first.
Naming the sources
Section titled “Naming the sources”Each item of the previous output names one source: the item itself (a list of keys), or the value at Key path in it, such as id. Use the same key your ingestion gives Knowledge Base Insert.
An item without a key fails the run rather than being skipped. A wrong path would otherwise turn “keep these” into “keep nothing”.
Keeping a knowledge base in sync
Section titled “Keeping a knowledge base in sync”Keep only the sources the previous node names is the mode for a sync. Pass it every source that still exists upstream, and it removes the rest:
- Fetch the current articles from the source system.
- Knowledge Base Delete, with Delete set to keep only the named sources and Key path set to the article id.
- Split, embed and insert the articles as before.
Two guards stop an upstream outage from emptying the knowledge base:
- An empty list is refused. A sync that fetched nothing has almost always failed.
- Source limit (50 unless you set it) bounds one run. When more sources would go, nothing is deleted and the run fails, saying how many.
Leave Dry run on for the first run: the output lists the sources that would go, each with its number of chunks, and nothing is deleted.
Output
Section titled “Output”{ "deleted": 3, "sources": [ { "sourceKey": "article-1", "chunks": 2 }, { "sourceKey": "article-3", "chunks": 1 } ], "collection_id": "d3u7k1h0000000000a1b"}deleted counts chunks. A name that matches no source is not an error; it is left out of sources. A dry run adds "dryRun": true and deletes nothing.
Related
Section titled “Related”- Knowledge Base Insert: store chunks under a source key.
- Knowledge bases: the Sources page, and deleting a source by hand.
- Approvals: gating this node when an agent calls it.